My parents recently got a place on the water and have been obsessed with looking up the tides everyday so I decided to build them a custom TideTracker. The idea is to present the predicted high and low times for the day and a plot showing the tide over the last 24 hours. In addition to that I added some basic weather data to give them info at a glance.
This project uses a Raspberry Pi for the brains and an E-Ink display for the information. When researching the project initially I found a similar project by Luke Haas that I used to test the display's functionality before writing my own program, check that project out here.E-Ink Display
For this project I wanted to use an e-ink display for a few reasons. The first being that they are low energy; once the screen has been written to the image on screen will remain even when power is removed which means the device can enter a sleep mode without needing to power the display. Secondly this is going to located likely in a very sunny place and there's no need to worry about brightness or glare on e-ink screens. And lastly because I think they're cool and I haven't had the chance to use them in any of my projects yet.
This project uses the WaveShare 7.5 Inch Display and HAT for the Raspberry Pi. There are a number of different versions of this display but I'm using the basic 800x480 black and white.
This project is running on a Raspberry Pi ZeroW which is perfect given it's compact size and wifi connectivity. All of the computation and code is done in python; this includes gathering tide/weather data, analysis, image processing, and writing to the e-ink display. The program is a loop that pulls data from the two sources, analyzes it, prints it to the display, then sleeps for 10 minutes and repeats.
The weather is pulled directly from OpenWeatherMap.org based on coordinates of the town/city. Using the free One Call API we get get current, forecast and historical weather data all in a single json file. This is the information that will be printed to the screen and used to determine the weather icons used.
Local NOAA station using noaa_coops python package which is an awesome tool that allows you to pull requested data through their easy API. First you have to identify the closest local station that collects the data we're after and get the station ID number.
From this station the past 24 hour tide level data is pulled and analyzed to create a plot which is then exported and saved as a png to use later. The predicted tide times are also pulled based on local standard and daylight time.
For purposes of the display the the plot was actually saved as greyscale as it can't display color.Image Processing:
The information that is displayed is actually a single image file that is pushed to the screen meaning that a new image is created every time the program updates (currently set to 10 minute intervals). It begins with a blank image that matches the size of the display (800x480) on which all the information is systematically added/pasted. I began with drawing the straight dividing lines that separate out the different sections then moved onto the weather. The weather icons are determined based off of the data that is pulled; the icon is selected from the image library, resized, then pasted into the appropriate location. After that the tide data is added, writing in the high and low times and pasting in the previously generated plot. The resulting image is what you see below.
As mentioned above an image file is generated then sent to the display via SPI communication. In order to do this the screen first needs to be initialized which is easily done thanks to the source code on the e-ink's wiki. When refreshing the image the display will flicker while updating. Afterwards it's important to put the screen to "sleep" to help prevent potential damage that may occur from constant voltage during prolonged use. The display will maintain the image even after the power has been removed.
The way I imagined the project was to look like one of those digital photo frames that sit on a coffee table. The frame housing and stand were designed in fusion 360 and printed on a Prusa i3 MK3. The frame is a simple design with a flat front face for the display to be set in with a back plate with room for the RPi and e-ink HAT. Below you can see the back plate showing the power port hole and kick stand mounting spots.
Once the frame pieces were printed out the components were assembled with some miscellaneous hardware.
The kick-stand is printed separately and is snapped into place on the back of the frame.
Once all the parts were printed and assembled a final test was done to make sure everything worked properly.
Given that the TideTracker is set up a couple hundred miles away, I'd like to create a script that makes the device self updating so that I can push patches without needing to manually reinstall in person.
Also want to look into creating a backlit display that can be turned on and off so that the information can be viewed at night. Along with this, adding other buttons that provide additional functionality like toggling between different screens that show various information.
Let me know what you think and any comments, questions, or suggestions you have for the project. Thanks.