Recently, I fabricated a crude prototype of the buoy’s sensor circuit board using perfboard and soldering connections to wire the inertial measurement unit (IMU), GPS , RGB LEDs, and Xbee to the Ndogo microcontroller. All the connections have been tested and the individual modules all function correctly so the next step is to write code for the microcontroller that will pull data from each of sensors in a specific sequence and time interval before transmitting the data to a base station wirelessly. For preliminary testing the base station will be my laptop but the concept can easily be scaled for longer ranges.
Currently, I am using two Series 1 Xbee modules for simple point to point communication. These are the simplest type of Xbee radios to use since they only allow for direct communication between two modules (like older walkie-talkies with a single channel) but eventually these Series 1 radio modules could be swapped out for the more powerful Pro Series 2 units to provide longer transmission range and more sophisticated mesh networking with multiple buoys communicating to each-other. I am still learning about Xbees and their protocols but if you are interested in using these little units in your own projects a great reference is Rob Faludi’s book Build Wireless Sensor Networks. Since the book was published in 2010, the Xbee manufacturer Digi has released a new version of the software XCTU which is used to configure the Xbees. The software can now run on Windows, Mac, and Linux, making it really easy to reconfigure the radios. Previously it was only available on Windows making it difficult/impossible to reconfigure the more advanced Xbees without a Windows machine.
After configuring the two Xbees to talk to each other, you can wire the units directly to the RX and TX pins on an Arduino to send data wirelessly using the Serial.print(). For testing, I mounted one Xbee to a breadboard using an adapter PCB (the pin spacing on the Xbees is smaller than the conventional 0.1″ pin spacing) and wired the Xbee to the RX and TX on an Adafruit Trinket Pro 3.3v running at 12MHz. I powered the breadboard with 3xAA batteries and ran the regulated 3.3V from the Trinket Pro directly to the Xbee (warning – don’t use 5V to power the Xbee).
A second Xbee module was wired to my laptop using this adapter board the FTDI Serial TTL-232 USB cable. Following the instructions from http://www.matlabarduino.org/ I was able to configure the Arduino Trinket Pro to send data wireless over the Xbees and then import analogRead( ) values directly into the program MATLAB. Now, instead of simply monitoring the outputs from the Arduino over the SerialMonitor, I can stream the data in almost real time and save the values on my laptop memory where the data can be manipulated and plotted. MATLAB is great for performing matrix operations and manipulating large arrays of numbers so it will be much easier to work with the accelerometer and gyro data in this way and implement FFTs or signal processing.
The tutorials from matabarduino.org are great, and provide step by step instructions for writing the code and getting the Arduino and Xbee to communication wirelessly with your laptop. You have to modify the code slightly depending on if you want to use an Xbee or Arduino to connect to the USB port on your computer, but they provide instructors for both setups. Once of their tutorials ever goes over visualization of your acceleration data to create 3D vector plots and continuous streaming of the data signals. I hope to implement some of these visualization codes in the buoy project to help during development of the wave height measurement codes for easier debugging. If you know MATLAB and use Arduino, I would highly recommend you check out the matlabarduino.org youtube channel and look over all the different tutorial videos they offer.