High Tide Tracker

We think there’s something in the water in Southend on Sea, on the east coast of England: there’s a really flourishing local Raspberry Pi community there, with a very busy Raspberry Jam (follow them on Twitter), a pretty Pi-centric weekly Linux User Group (SoSLUG), and a small army of Pi users we seem to bump into regularly at events. Those users include Digital Girl of the Year 2016, the very clever Yasmin Bey (Yasmin’s giving a talk about young people and computing on our stand at Bett tomorrow, if you’re at the event); and STEM ambassador Jane “ChatnStitcher“, who inadvertently became the first person in the UK to own a Pi Zero when she found a copy of The MagPi on a newsstand in London a day before the magazine was supposed to launch. Big wave to all the Southend Raspberry Pi users from here at Pi Towers in Cambridge – we hope plenty of you are coming to our fourth birthday party in March!

Young Southenders get stuck into a Minecraft Hackathon at the Southend Raspberry Jam

Young Pi users get stuck into a Minecraft Hackathon at the Southend Raspberry Jam

Richard “Average Man vs Raspberry Pi” Saville, whom I have great difficulty not greeting as “Average” when I meet him in real life, is another Southender, who lives beside the seaside. (Beside the sea.) Average makes a number of affordable prototyping boards for the Raspberry Pi, and used one in this project: they’re a great buy, and I particularly recommend his ProtoCam board, which I’ve found very useful on several occasions.

Southend on Sea lies at the mouth of the Thames estuary. If you venture out to the seafront at the wrong time of day, you’ll be greeted with a view of miles of mud. I’m of the view that sea-mud is more interesting and attractive than the fen-mud that we get in Cambridgeshire, 70 miles from the beach, but Average is resolute: no muddy vistas will spoil his walks.

IDL TIFF file

Mud in Southend FROM SPACE

Average’s solution: use a Raspberry Pi to build a high tide-tracker.

Raspberry-Pi-High-Tide-tracker-2

How does it work?

The code used in this project is actually a mash-up of the Python I learnt from two previous projects – my Raspberry Pi Social Network monitor (based on the RasPi.TV Kickstarter tracker project) and the clock example that came with the 7-Seg kit. It’s great to learn programming from others, but it’s even better if you learn them well enough to remember, re-use and combine that code later on as well.

First let’s first summarise what my code does:

  1. Setup – Imports, GPIOs, segment characters etc
  2. URL check (every hour or so) – check the URL and pull back next high tide time
  3. Display next high tide time on the display

It really is that simple – start up, check the URL and display data. I haven’t added anything else at this stage which means it’s still a bit ‘rustic’, although I may work on another version that includes more features with buttons/LEDs etc.

Richard has made complete instructions on the build and all the code you’ll need available at his website. Perfect for seaside-dwelling Pi users. Useful for sunset and sunrise calculation for the rest of us. Thanks Richard: we really don’t think you’re average at all!

12 comments

Avatar

It’s a great project – Mr Average has done really well there to make it very ‘maker-y’.

Brilliant community in Southend – they do so much to foster a great atmosphere at their Jams and even take the Jam “on the road” to places like Chelmsford. I really like their Jams – they’re definitely some of the best-run and enjoyable!

Avatar

My dad had an old battery powered tide clock for our sailing in Suffolk. Very unreliable (the clock, not my dad). I haven’t been sailing for years but this has brought back so many happy memories for me.

Great project.

Avatar

I pinched the tide-time URL scraper code from this project and grafted it into Kevin Uhlir’s PiClock, so it now displays the next local high tide as well as temp and weather info.

Very useful, thanks!

Avatar

So good I put a link on my GOOGLE + ACCOUNT,

The Pi Geek

https://plus.google.com/u/0/101010000783981915270/posts/UL5ivVpdW2s

Avatar

Yes, but does it do what any real Tide Clock must do, and greet the owner with “Hi Tide!” and ” ‘Lo Tide!” twice each per day (except for the rare places around the planet that only get one high and one low tide each day)? Yes, it’s an oldie joke, but a true goody :D

Avatar

Four times, round the Solent.

Avatar

Interesting. But what I want is not to forecast the time, but also the magnitude of the tides. This needs, for any given site, four ‘harmonic constants) giving the solar and lunar diurnal and semi-diurnal contributions, and the ‘Julian time’.
Time is easy. Getting the tidal constants for UK sites is very hard- the Hydrographic has commercialised their supply.
I managed to obtain values for Hinkley Point (nuclear coastal power station near me) but the calculation does not agree at all with commercial tide tables.
I wonder if anyone reading this can help me with either a source of the constants or whether I’ve missed something in the calculation?

Avatar

Well, there are tables at
http://www.ntslf.org/tides/tidepred?port=Hinkley%20Point
Also and RSS feed from
https://www.tidetimes.org.uk/watchet-tide-times
I also found this, which perhaps is more what you are looking for
http://www.sporttaco.com/uk.rec.sailing/Tidal_harmonic_constants_for_UK_3885.html
I just looked for locations I think are near your area of interest. Hoep it helps.

Avatar

Thanks- but I’ve already been to these and many other locations. I have WXTide already installed. None include the constants in a form I can use.
The whole point is that I want to do the calculation MYSELF- I already have permalinks to on-line sites which calculate the tide for the sites I am interested in. I need numerical predictions not a graph from such sites. Then I can start looking for associations between my met-station pressure (and perhaps tiltmeter) data and the tide in the Bristol Channel. (Does Somerset tilt slightly North each high tide?)

Avatar

Well, the Wirral used to (up until the Bidston Hill observatory closed)

Avatar

PyEphem is a python library that can calculate the position of pretty much all known astronomical bodies for any given latitude and longitude for any given moment in time. I’m not sure if it does Julian time but surely that’s just arithmetic?
Anyway, would something like that be what you are after?

Avatar

Calculation from gravitational attractions is way too complex. Stuff for supercomputers…

What IS used is to analyse historical records for the amplitudes of components at the solar & lunar day frequencies. The most important are lunar diurnal, lunar semi-diurnal, and solar demi diurnal. It’s like Fourier, except the frequencies are not in whole-number ratios. The Hydrographic Institute does the calculation and sells the data as tables of these amplitudes and phases.

tideLevel =sumOf( compAmp *cos( omega *t +phase)) over the four main components.

My Julian calculation works correctly. (tested against on-line JD calculators)

My calculations give the correct two tides per ‘day’. of different sizes, and the correct intervals for neap/spring etc. Just not synchronized with real life!

I’ve now paid for the official table of tidal constants ( which as a taxpayer I’ve paid for already- rant!) So it must be something in my calculation since the constants are correct. More de-bugging to come…

Leave a Comment

Comments are closed