Tide Clock

I’ve developed an interest in kayaking, which can be a very fun thing to do in the Hudson River and the New York Harbor.  Since you use your human power on a mighty river, you need to be aware of tides and currents. The standard solution is to use Eldridge’s book of tides and currents.   All the cross checking on dead-tree format seemed antiquated in this modern age, so I decided to build a clock which shows tides and currents near Pier 40 in New York City.

The display is a Noritake GU256x64-3900, a much faster and more sophisticated graphics VFD than the GU128x32-311; I found a couple for a good price on ebay.  The left-hand side displays the time and date, along with the time of the last tide.  Next to the left is the phase of the moon (which can affect the tide), then the position in the tide cycle. Each tick represents one hour, the photo was taken shortly before low tide. Next is the position in the current cycle – I took the current (in knots) from Eldridge’s.  The line represents the slack tide point.  Yes, around Manhattan the Hudson flows north at high tide.  I also found that the current seems to follow the tide by about 10 minutes (out of phase by 10 minutes).

The clock uses the usual combination of a DS3232 with a capacitor backup and an AVR microcontroller, in this case a mega644.  The clock stores a 30-year span of tide data, which is too much for the mega644 alone.  The chip on the lower right is a 1 Mbit flash eeprom, and stores the time of day for each tide.  The Mega644 stores an array which maps days to positions in the eeprom.

The average distance between a high and low tide (or vice versa) is about 6 hours, 23 minutes.  Simple tide clocks run in a 12 hour, 46 minute cycle.  However, actual tides are more complex: half-cycle time can be as little as five hours, or more than seven.  Tide cycles depend not only on the relative positions of the sun, earth, and moon, but also on the topology of the harbor.  Tide predictions are made by curve fitting.  Standard tide predictors make use of 37 parameters; the parameters for the Battery, NYC are here. Tides (and therefore currents) are also affected by high or low pressure weather systems, so it’s best to double-check with real-time measurements provided by NOAA.

To generate the data for the clock, I used the xtide program.  Building my own installation was surprisingly difficult - the Flaterco site was down when I started (seems to be back now); and the build process isn’t well documented and relies on always-cranky X libraries.  One special problem is that xtide depends on libtcd (which manages the database of tide prediction parameters), and needs to have access to the libraries even to run the configure script. When libtcd builds, it puts its libraries in the hidden directory .lib.  I remember why I dislike linux.  But of course xtide is high quality software used behind most tide prediction websites and was written and is maintained for free.