Pretty tide clock

By Rob Zwetsloot. Posted

If you’ve ever lived near the sea, you’ll know that it never gets old to walk along the beach, especially when the weather is good. For Levi Maaia, it turned out the weather wasn’t the main problem.

“I live 200 feet above the Pacific on an ocean cliff,” Levi explains. “I try to make it a weekly ritual to walk down the cliff to the shore. However, it’s disappointing to reach the seaside stairs, expecting a nice sandy walk, only to find waves lapping against the base of the bluff.”

For us landlubbers, tides aren’t always something we have to think about, although Levi was familiar with the tide clocks where he grew up. Not being able to find one for his new Californian home, Levi decided to make his own: “It displays current tide height in feet, predicted hours until next tide and predicted height of the next tide using analogue meters and LED lights.”

Tidal changes

Making a clock wasn’t quite as easy as he first thought, though.

The gauges and LEDs are controlled by the GPIO pins on Raspberry Pi

“Growing up in Rhode Island, round, four-segmented tide clocks were a common sight in homes near the Atlantic,” Levi tells us. “But after moving to California, I noticed that these simple analogue clocks were nowhere to be found here. As it turns out, there’s a good reason for that. Similar to many coastal areas around the Pacific and some of the northern Mediterranean coast, the US west coast has a more complex tidal pattern, which means that without constant adjustment, a basic tide clock would get out of sync with the ‘mixed semi-diurnal’ tides here in just a few days.”

This meant Levi needed a way to keep the clock up to date with the NOAA (National Oceanic and Atmospheric Administration) tide data, which led him to turn to Raspberry Pi. “The device stays accurate as long as it has a Wi-Fi connection,” Levi says. “The red light on the right side of the front panel indicates a rising tide and the green light on the left illuminates when the tide is falling. All of the meters and lights are driven by the GPIO pins on a Raspberry Pi 3B+ running a Python script that gathers tide predictions from the US National Oceanic and Atmospheric Administration’s API. The script converts the raw tidal data into PWM values to drive the meters and the binary state voltage for the LEDs.”

Sea worthy

As well as the electronic aspect of the project, Levi was keen to make it look more rustic to camouflage the internal tech, using analogue gauges and a wooden fascia. “Obviously there are more efficient ways to communicate tide predictions than with analogue meters,” Levi admits. “A digital display driven by a Raspberry Pi could easily show graphs and numbers based on the tide API. But I wanted something more rustic but just as accurate. They say measure twice and cut once. I must have tinkered mentally with the physical build design a thousand times over the past two years.

The LEDs let you know if it’s a good time to head out, with green as the usual ‘go’ signal

“So when it finally came time to assemble it, I had a very clear vision of how it should look, down to the brass plaque declaring that the information displayed was for ‘Santa Barbara Harbor’.”

According to Levi the finished project works ‘really well’, which hopefully means he’s been able to go for his weekly walks without worrying about the tide since completing it.

From The MagPi store


Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.