Hi everyone! This is a brief(ish) summary of our smart buoy project. We’ll break down the technical build into separate posts, to explain: electronics, 3D print, and dashboard.
You Will Need
For the complete smart buoy build, you need a LOT of stuff. We will have the breakdown of specific materials required for each stage of the build in the relevant tutorial, but for some context, here’s the complete list:
- Arduino Nano - Amazon
- Raspberry Pi Zero - Amazon
- Battery (18650) - Amazon
- Solar panels - Amazon
- Blocking diodes - Amazon
- Charge controller - Amazon
- Buck booster - Amazon
- GPS module - Amazon
- GY-86 (accelerometer, gyroscope, barometer, compass) - Amazon
- Water temperature sensor - Amazon
- Power monitor module - Amazon
- Real-time clock module - Amazon
- Radio modules - Amazon
- i^2c multiplexer module - Amazon
- 3D printer - Amazon
- PETG filament - Amazon
- Epoxy - Amazon
- Primer spray paint - Amazon
- Rope - Amazon
- Floats - Amazon
- Glue - Amazon
All the code used can be found at https://gitlab.com/t3chflicks/smart-buoy.
What Does It Do?
The sensors on board the smart buoy enable it to measure: wave height, wave period, wave power, water temperature, air temperature, air pressure, voltage, current usage and GPS location. In an ideal world, it would also have measured wave direction - based on the measurements it was able to take, we were quite close to making it work. However, it turned out to be pretty complicated and it’s actually a massive problem in the actual research community. If there’s anyone out there who can help us out and suggest an effective way to get wave direction measurements, please let us know - we’d love to understand how we could get it to work!
All the data the buoy collects is sent via radio to a base station, which is a Raspberry Pi. We made a dashboard to display them using Vue JS.
This buoy was probably the most difficult thing we’ve printed so far. There were just so many things to take into consideration as it was going to be in the sea, exposed to the elements and a lot of sun. We will talk more about that in another episode in the Smart Buoy series. In brief: we printed a near hollow sphere in two halves. The top half has slots for the solar panels and a hole for a radio aerial to go through. The bottom half has a hole for a temperature sensor to go through and a handle for a rope to be tied to.
After printing the buoy using PETG filament, we sanded it, spray painted it with some filler primer, and then put on a couple of layers of epoxy.
Once the prep of the shell was complete, we put all the electronics inside and then sealed the water temperature sensor, radio aerial and solar panels using a glue gun. Finally, we sealed the two halves with StixAll glue/adhesive (super aeroplane glue).
And then we hoped it was waterproof…
- Picture of full circuit for buoy
The buoy has lots of sensors on board and we go into detail about these in the relevant tutorial. As this is a summary, we’ll try to keep this informative, but brief!
The buoy is powered by an 18650 battery, which is charged by four, 5V solar panels. Only the real-time clock is constantly powered, however. The buoy uses the real-time clock’s output pin to control a transistor allowing power to enter the rest of the system. When the system is turned on, it starts by getting measurements from the sensors - including a voltage value from the power monitor module. The value given by the power monitor module determines how long the system sleeps for before taking the next set of readings. An alarm is set for this time, then the system turns itself off!
The system itself is a lot of sensors and a radio module connected to an Arduino. The GY-86 module, RealTimeClock (RTC), Power Monitor module, and I2C multiplexer all communicate with the Arduino using I2C. We needed the I2C multiplexer is required because the GY-86 and the RTC module we used both have the same address. The multiplexer module allows you to communicate with no extra hassle, although it might be a bit overkill.
The radio module communicates via SPI. Originally, we had an SD card module as well, but it caused so many headaches because of the size of the SD library that we decided to scrap it.
Take a look at the code. It’s likely that you have some questions - probably lingering doubts as well - and we’d be happy to hear them. The in-depth tutorials include code explanations, so hopefully they will make it a bit clearer!
We tried to logically separate the code files and use a main file to include them - a method which worked perfectly.
Base Station Electronics
- Picture of pi circuitry
The base station is made using a Raspberry Pi Zero with a radio module attached. We got the casing from https://www.thingiverse.com/thing:1595429. You’re fab, thanks so much!
Once you have the code running on the Arduino, it’s quite simple to get the measurements on the Raspberry Pi by running the receive.py code.
One member of the T3ch Flicks team is a web developer who has recently learnt Vue JS. They got very excited when we decided we needed a dashboard and blew us away by making this pretty legit dash.
To show you how we made the entire dash would be a bit of an Odyssey because it was a pretty long and complicated project. If anyone wants to know how we did it, do let us know - the T3ch Flicks resident web developer would be more than happy to do a tutorial on this!
Once you put these files onto a Raspberry Pi, you should be able to run the server and see the dashboard with the data coming in. For development reasons and to see what the dash would look like if it were supplied by good, regular data, we added a fake data generator into the server. Run that if you want to see what it looks like when you have more data.
We also explain this in some detail in a later episode.
This project is absolutely not perfect - we like to think of it more as a prototype/proof of concept. Although the prototype works on a fundamental level: it floats, takes measurements and it able to transmit them, there are lots of we’ve learned and would change for version two:
- Our biggest issue was not being able to change the code for the buoy after glueing it shut. This was really a bit of an oversight and could be solved very effectively with a USB port covered with a rubber seal. That, however, would have added a whole other layer of complexity to the 3D print waterproofing process!
- The algorithms we used were far from perfect. Our methods for determining wave properties were pretty crude and we ended up spending a lot of our time reading up math for combining the sensor data from the magnetometer, accelerometer, and gyroscope. It wasn’t super helpful in the end, but we did find this interesting video. If someone out there understands this and is willing to help, we think we could make these measurements much more accurate.
- Some of the sensors acted a little bit weirdly. The water temperature sensor was the one which stood out as being particularly dodgy - almost 10 degrees out from the real temperature at times. The reason for this could have been it just being a bad sensor, or something was heating it up...
The Arduino was good, but as mentioned before we had to scrap the SD card module (which was supposed to be the data backup if radio messages weren’t able to send) due to memory issues. We could change it to a more powerful microcontroller like an Arduino Mega or a Teensy or just use another Raspberry Pi zero. However, this would have increased cost and power consumption.
The radio module we used has a limited range of a couple of kilometers with direct line of sight https://www.youtube.com/watch?v=57pdX6b0sfw . However with (very) many Buoys around the island we could have formed a mesh network such as https://www.youtube.com/watch?v=xb7psLhKTMA . There are so many possibilities for long range transmission of data, including lora, grsm. If we were able to use one of these, maybe a mesh network around the island would be possible!
Using Our Smart Buoy for Research
We built and launched the buoy in Grenada, a small island in the south Caribbean. While we were out there, we had a chat with the Grenadian government, who said that a smart buoy like the one we created would be helpful in providing quantitative measurements of water characteristics. Automated measurements would cut out some human effort and human error and provide helpful context for understanding changing coasts. The government also suggested that taking wind measurements would also be a helpful feature for their purposes. No idea how we’re going to manage that one, so if anyone has any ideas… An important caveat is that although it’s a really exciting time for coastal research, particularly involving tech, there’s a long way to go before it can be fully adopted.
Thanks for reading the smart buoy series summary blog post. If you haven’t already, please take a look at the video for this on our YouTube channel. In part one of the series, we’ll be showing you how we took wave and temperature measurements. If you enjoyed our work and would like to help us do more, it’d be amazing if you would consider sponsoring us on Patreon. Thanks so much to Giacomo, who is our first Patreon sponsor!
Check out the next blog post where we show how we made wave and temperature measurements https://create.arduino.cc/projecthub/t3chflicks/smart-buoy-making-wave-and-temperature-measurements-257ca1