The Surfsonar Project Prevents Underwater Collisions by Using Sonar to Detect Obstacles

The surfsonar is a surfboard that has a sonar module for detecting any hidden obstacles that might be lurking beneath shallow water.

Why the surfsonar was created

Surfing is a fun activity that is enjoyed by millions of people each year around the world. But it does come with a few risks, including the possibility of hitting a sandbar that might be hidden in the shallow tide. To avoid this unfortunate situation and even learn something about waves in general, Aaron Curtis (who goes by foobarbecue) built the surfsonar surfboard, which has a small sonar module that continuously reads the distance between itself and anything directly underneath.

The required components

Curtis had started out by using the Raspberry Pi Pico development board, but after realizing the Python libraries required for the sonar module wouldn't function correctly without significant changes, he switched to the Raspberry Pi Zero W instead. This had the additional side effect of providing the system with WiFi for direct communication with a mobile device. The sonar sensor is the Ping Sonar module from Blue Robotics, and it operates by sending sound waves at 115kHz to a target up to 30m away and with a beam width of 30 degrees. The distances measured by the sensor are displayed on a 2.13 inch e-Paper HAT from Waveshare that also is easily viewable in the bright outdoor sunlight. Finally, power is provided by combining a PiSugar S 1200mAh battery bank with a wireless Qi receiver. This was done to allow the board to charge without needing to be opened and harm its water-repelling surface.

Wiring up the Raspberry Pi Zero W

The wiring for the surfsonar was quite easy to do. After Raspberry Pi OS had been written to an SD card and placed in the Pi Zero W, Curtis soldered a couple of pin headers and slotted the PiSugar S power module on the top. Next, the sonar module was connected to the Pi via an FTDI-to-USB converter, although directly connecting it to the GPIO pins was also an option. Finally, the e-ink display was attached and tested by running a simple Python script.

How does the code work?

The script begins by importing all of the necessary libraries and initializing the sonar and display modules. From there, it enters into an infinite loop that reads the current distance and profile, creates a new string to store this data, and outputs it to both the display and to a text file for future analysis.

Attaching the device to a surfboard

After placing all of the electronics into a watertight plastic container, Curtis cut two holes into a surfboard. The first holds the case in the correct orientation so its displayed can be easily viewed by the surfer at any given time, and the second is a cylinder that holds the sonar module towards the water. A generous amount of silicone sealant was applied to repel water and prevent any from getting in and ruining the electronics.

Taking it all for a test run

Charging is done by placing a wireless charging transmitter against the receiver coil within the plastic case for around five hours to provide a full battery. The PiSugar switches off the circuitry automatically when the voltage gets below 3v.

According to Curtis, his surfsonar project works quite well in deep water, but as he got closer to the shoreline, the confidence of the sonar readings dropped significantly. In the future, he wishes to add GPS, battery voltage monitoring, and a way to turn off the system externally without introducing potential weaknesses. You can view the code in more detail here on GitHub.

Arduino “having11” Guy
20 year-old IoT and embedded systems enthusiast. Also produce content for Hackster.io and love working on projects and sharing knowledge.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles