Lunar Light Tide Clock
This is another variation on my theme of making tide clocks run by tiny microcontrollers. This variation relies on the many lithophane designs out there for 3D printing: https://www.printables.com/model/23859-designer-lithophane-moon-lamp. The design is based on a ESP32 microcontroller attached to a real time clock with battery back-up running a tide program that allows it to output a light based corona that designates high and low tide. The microcontroller will run the tide script endlessly as long as it has power, requiring no internet connection for its calculations. It is again based on Luke Millers very nice work: http://lukemiller.org/index.php/2015/11/building-a-simple-tide-clock/ . The TTGO version of the ESP32 board accommodates a screen that details the HI/Low tide Hour and Minute for the next 12 hours as well as the number of hours to next Hi/Low and the current tide level in feet. The back lighting of the moon changes with the hours of the day and can even accommodate hidden features such as celebrating birthdays or holidays with customized lighting patterns.
Supplies
- TTGO T-Display ESP32 CP2104 WiFi bluetooth Module 1.14 Inch LCD Development Board $11
- 1PCS DS3231 AT24C32 IIC Precision RTC Real Time Clock Memory Module For Arduino $1
- One-meter of Adafruit NeoPixel LED Side Light Strip - Black 60 LED $18
- Adafruit NeoPixel Digital RGB LED Strip - White 60 LED - WHITE $24
- Five-Volt female power connector. $0.50
3D Print Your Parts
Other than the main backing plate which is made of aluminum, all the parts are 3D printed with PLA. None require support and all are printed using standard Cura settings for PLA. The hardest print is of course the lithophane moon. I am not sure if the full file for this uploaded as it is so large. If it didn't just go to the original source file listed above. The moon file is for the whole moon light and for this project you only want 1/2 of the globe so when you insert it into your slicing software just have have 1/2 suspended above the slicing floor and 1/2 below. This will truncate the model and it will print appropriately. The main light ring has a window for the ESP32 to peak its screen through and a wire opening for the Neopixel power from the main computer. Individual holders for the ESP32 and the RTC are also printed. The moon itself is attached to the light ring with a unique screw attachment. The moon is glued to the female attachment and the male ring is glued to the light ring. This allows easy removal of the moon globe cover to check the neopixel lights as well as the power connections and computer.
Build It
The back of the clock is made of 1/4 inch thick aluminum plate. I use this stock a lot and it is easily cut with a skill saw in seconds to the 12 in square size that accommodates the 8 inch moon sphere. It is treated by sandblasting a nice mat finish on it with a sandblaster or you can give it a even finish with a fine grade of sandpaper. Alternatively, you can use a plywood board stock with a smooth finish and paint it grey or some other pleasing color. The aluminum mat finish has the advantage of being generally reflective to the moon light corona effect. The backside of the aluminum plate does not have to be blasted and can be painted with a flat black. A 1/4 inch hole is drilled through the plate centrally to accommodate the power supply to the unit. After sandblasting it is best if you spray the metal with a flat clear overcoat to protect the finish.
All the 3D printed parts were painted with Rust-Oleum Multicolor Sand textured paint. This was mainly to absorb and minimize any reflective surface from the light ring that the LEDs were being mounted on. Two types of LED's are used in this clock. One is the corona ring that will indicate the hours of tidal current and the other will serve as the background lighting for the lithophane moon effect. The side light strip is cut for the length that will go once around the light ring and mount at the top of the ridge that you can see in the photo. Make sure that this ring of led's is arranged so that the individual lights point downward and you have the correct orientation of the power and control wires. This stretch of led lighting is glued into place after stripping off the silicon cover with E6000 glue. The power and control wire are led into the supplied opening. The regular backlight neopixel strip is broken up into sections that will fit the rings back struts. Each section of led's is connected to the next with power, gnd and control wires going the appropriate direction. (see photos) The led strips are then glued with E6000 to the struts. The female connector ring is glued to the inside of the the moon sphere with E6000. Make sure the orientation with the male section that is glued to the light ring section is straight. This male section can be glued with superglue. The ring with mounted LED's is then centered on the aluminum background and glued into place with E6000. The holder for the RTC is mounted in between the struts and glued into place along with the RTC. The ESP32 is glued into its holder and then the holder is glued into place so that its screen can be viewed through the square window of the light ring. Finally, the moon is screwed into its holder to complete the clock.
Wire It
The fritzing diagram for the wiring is located above. The wiring is very straight forward. The RTC (real time clock) is connected through the I2c connections on the ESP. The SDA connects to Pin 21 and the SCL connects to pin 22. The 3 volt connects to the 3 volt connector on the ESP and the ground to ground. The power supply which is 5V and 6 amps is brought out through a female connector at the edge of the clocks bottom frame. I enclosed this in a section of aluminum bar that was glued to the back frame with JB Weld along with the picture hanging connectors that the clock is suspended from. The 5 Volts from this connector is fed into the 5 Volts pin on the ESP32 and also connects with the two strands of Neopixels. The grounds are connected in the same way. The control wire from the background LED's is connected to pin 13 on the ESP board and the corona ring led lights are connected to pin 26. I used several sectional JST SM plug snap connectors to make attaching the led's easier.
Program It
The programming for the tide predictive software is from Luke Millers original work with microcontrollers and tides. It was used in several previous clocks: https://www.instructables.com/Giant-Tide-Clock/ and it is the heart of this software. I have modified the cpp file so that it runs on a ESP32 rather than an Arduino. I have included the file so you can see the modifications I made. The program uses FastLED to control the Neopixels since I wanted to use several palettes to rapidly change colors to give the corona light dazzle effect. Two sets of FastLed's were set up. One to control the backlighting of the moon and the other the light hazing of the corona effect. They were run off of two different control wires. One color palette was from LavaColors for the High tides color effect and the OceanColors palette was used for the Low tides effect. EVERY_N_MINUTES(1) the loop program checks the current time and then figures the next Hi and Low tides as well as the time to next high or low. It then sets up the ring of lights to express the next hours to high or low based on the tide prediction. One neopixel is lit with green to indicate which direction the tide is moving toward high or toward low. Two functions then dither the lights from the chosen color palettes to make the dynamic quality of the surrounding corona. The TFT screen is mounted on a holder inside the ring so that the real data can be read out at anytime. The background lighting for the moon is color/time dependent. At night the background lighting is blue, early morning yellow and daytime white. Programming of the RTC can accommodate a variety of Easter Eggs depending on the date which can be programmed to trigger a variety of light effects in this tide clock. Like all RTC the date/time must be set in the Setup function initially.
Using It
Presenting the graphical data from a tide clock in a simple manner can be difficult. In this case the lunar corona is easily parsed by its color and its relative size to a warmer (high) or colder (low) ring: if most of the ring is blue tinted the tide is toward the low size of the cycle--if most of the ring is lava tinged it is toward high. The direction of the tide flow is designated by a single Green LED. The tide cycle will be progressing in the direction of the single green color. The above example you see nearly a complete red corona with a tiny amount of blue inferiorly and a single green pixel at the bottom: Progressing to nearly high tide with perhaps only one hour to go. At high tide it will switch the green pixel to 12:00 position and the blue will slowly grow to encompass the corona. The unit can be unplugged for months and battery back-up will keep the accurate time. The small screen with the relevant information can be seen in the tiny window.