Midnight Sundial
prusaprinters
<p>The best play with light is done by sun. There's not much of it in the UK in winter. This is an indoor, midnight sundial clock. Perfect mood lighting or a bedroom clock for those nights you wake up in the middle of and a reminder of summer times (requires imagination, but... it's a sundial after all :) )</p> <p>The sundial is controlled by an ESP8266 and runs on 2 x 18650 batteries. It gets accurate time through NTP and lights appropriate LEDs (WS2812b) to cast a shadow indicating the hour.</p> <h3>Print instructions</h3><h3>The Clock</h3> <p>The creation and how it works can be seen in the video:</p> <figure class="media"> <oembed url="https://www.youtube.com/embed/AT7oIGUjlyo"></oembed> </figure> <p>It proudly hangs above our bed, it seems very bright in the video, but it's actually just alright not to disrupt sleep and is perfect to give us an idea what time it is those nights when the kids wake up in the middle of them ...</p> <h3>Materials needed:</h3> <ol> <li>ESP8266 - NodeMCU v3</li> <li>LM2596 SMD - Buck converter</li> <li>2 x 18650 - batteries</li> <li>WS2812b - NeoPixel LED strip</li> <li>Resistors:<ul> <li>560 kOhm</li> <li>220 Ohm</li></ul> <li>Filament</li> <li>Wires</li> <li>CA glue (super glue)</li> <li>Body filler for plastic (bumper) - optional</li> <li>...some patience</li> </li></ol> <h3>Tools</h3> <ul> <li>Soldering iron</li> <li>Semi-decent 3d printer</li> </ul> <h3>Printing</h3> <h4>Housing</h4> <p>I've printed all my parts with white PLA, 20% infill. All with 0.4 nozzle and at 0.24 layer height as I filled the print lines anyway with (as explained later). I did use modifier cylinders around corners of the housing parts to add "brim" and prevent them from lifting. Do not use slicer's brim setting as you need the latches where the housing parts connect quite clean.</p> <h4>Numbers</h4> <p>For ease of printing, I've created the numbers as a single body. I merged them altogether with a thin plane of 0.0001 mm, hence it will not print. I have included all the numbers, but it was getting too crowded for my liking, so I used small ticks for the numbers in between 12,3,6,9 and 12.</p> <p>You may be asking, why two 12? Very good question and thanks for asking so eloquently. There are two 12 to be able to show 11:55 as well, but as soon as you reach the 2nd 12, the shadow hand will jump back to the 1st one. <p>As to the numbers themselves, there are 3 perimeters, 2 bottom layers and no infill. The perimeters are painted black with the marker (easy with no infill).</p> <h4>Other</h4> <p>Other than that there is a gnomon, which is the bit that throws shadow.</p> <p>You need to print the arc onto which the shadow falls as well, this makes it visible even in the brighter conditions. Just as in case of main part housing you need 3 pieces of it and stich them together</p> <h3>Assembly</h3> <h4>Housing</h4> <p>Assemble the 3 housing pieces together. Use some superglue to ensure they are fixed. We wanted a "stone" look, so we've covered the whole part with bumper filler to give it the right texture. The whole part was then painted white. Those steps are optional, but they do make the part look like one piece. it does look so good that you can't even tell it's 3d printed. You can see the texture in good lighting in one of the pictures on the floor.</p> <h4>Electronics</h4> <p>Connect all the parts as in the schematic picture. The battery slots have a 2perimeter (@ 0.4mm) arc that serves as a spring. It does have 2 holes to thread through a solid core wire as a terminal. (see the picture). The voltage regulator and NodeMCU snuggly fit in the other slots, I did not have to attach them</p> <h5>Power</h5> <p>The circuit is powered by 2 x 18650 batteries. Together they do produce 8.4V when fully charged connected in series. This is too much for NeoPixel and NodeMcu as both need 5V. You could use linear regulator, however they are not the most efficient ones and lose a lot of energy through heat. Considering the clock is battery powered I have opted for LM2596 buck converter adjusted to 5 V</p> <p>The output of the buck converter is then connected to Vin and ground of NodeMCU as well as power terminals of WS2812 strip</p> <h5>Reset</h5> <p>ESP8266 has an internal clock (RTC) that is running when the microcontroller is in deep sleep. In this deep sleep most other functions like WiFi are disabled to save some power. When putting NodeMCU into sleep we do set RTC to send a wake up signal after certain time. This signal is sent through D0 pin. Hence we need to connect this pin to Reset pin of the controller.</p> <p>In my case I have the timer set to 60s</p> <h5>LED strip data</h5> <p>The data is sent to the strip from NodeMCU's D6 pin. I have included small 220 Ohm resistor here to prevent signal bounce back.</p> <p>NeoPixels work at 5V, the data is being sent at 3.3V. With my strip, this works reliably. However you may need to include a level shifter with other LEDs. Alternatively there is a nifty little hack where you can use another pixel as a level shifter described on <a href="https://hackaday.com/2017/01/20/cheating-at-5v-ws2812-control-to-use-a-3-3v-data-line/">Hackaday</a> <h5>Battery protection</h5> <p>Last but not least, discharging the batteries too far can damage them. Something we definitely want to avoid. You could use some ready battery protection circuits, however form my personal use I don't think it's necessary</p> <p>Instead I use NodeMCUs analogue pin to monitor the battery and if the voltage drops below certain threshold I do switch off all the LEDs and put NodeMCU to sleep and save batteries from any further "high" power consumption. This provides a visual cue that it's time to charge.</p> <p>ESP8266 analogue pin allows to measure between 0-1V. NodeMCU has built in voltage divider with 100k and 220k Ohm resistors which increases the range to ~3.2V. However as I mentioned before we have voltages up to 8.4V. To correct this we do include 560k Ohm resistor between battery positive terminal and analogue pin of NodeMCU, now we effectively have a voltage divider with 780k and 100k Ohm, which allows us to measure V of up to ~8.8V</p> <h4>Use of the clock</h4> <p>I have included a very basic server in the clock to show off some possibilities (definitely non exhaustive though :) ). To use the server you need to get your NodeMCU's IP either through serial monitor or your router, then you can use simple commands: <ul> <li> ip/demo - this will stop using NTP time and iterate through the day moving the shadow hand across the entire dial, in my case in about 100 seconds</li> <li> ip/red - turns dial/LEDs red</li> <li> ip/green - turns dial/LEDs green</li> <li> ip/blue- turns dial/LEDs blue</li> <li> ip/white- turns dial/LEDs white</li> </ul> <p>However once you're done with playing about. I would recommend uncommenting the deep sleep line in the code. ESP8266 is quite power hungry especially with the WiFi, however if we just take time once every minute (or maybe even every 3?) it will greatly improve the battery life.</p> <h3>The code</h3> <p>I've uploaded the code to <a href="https://github.com/rokfor2000/Midnight-Sundial">GitHub</a>, and commented most of the lines/blocks to explain the ideas behind them. As always, there is space for improvement and only your imagination is the limit</p> <h3><b>If you've made it this far, <u>THANK YOU</u> for reading and your interest. </b></h3></p></p></p>Happy printing!!!
With this file you will be able to print Midnight Sundial with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Midnight Sundial.