The best play with light is done by sun. There's not much of it in the UK in winter.
In the contest Lights and 3D printing
248
200
0
6611
updated September 27, 2020

Description

PDF

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 :) )

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.

Print instructions

The Clock

The creation and how it works can be seen in the video:

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 ...

Materials needed:

  1. ESP8266 - NodeMCU v3
  2. LM2596 SMD - Buck converter
  3. 2 x 18650 - batteries
  4. WS2812b - NeoPixel LED strip
  5. Resistors:
    • 560 kOhm
    • 220 Ohm
  6. Filament
  7. Wires
  8. CA glue (super glue)
  9. Body filler for plastic (bumper) - optional
  10. ...some patience

Tools

  • Soldering iron
  • Semi-decent 3d printer

Printing

Housing

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.

Numbers

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.

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.

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).

Other

Other than that there is a gnomon, which is the bit that throws shadow.

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

Assembly

Housing

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.

Electronics

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

Power

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

The output of the buck converter is then connected to Vin and ground of NodeMCU as well as power terminals of WS2812 strip

Reset

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.

In my case I have the timer set to 60s

LED strip data

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.

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 Hackaday

Battery protection

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

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.

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

Use of the clock

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:

  • 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
  • ip/red - turns dial/LEDs red
  • ip/green - turns dial/LEDs green
  • ip/blue- turns dial/LEDs blue
  • ip/white- turns dial/LEDs white

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.

The code

I've uploaded the code to GitHub, 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

If you've made it this far, THANK YOU for reading and your interest.

Happy printing!!!

Tags



Model origin

The author hasn't provided the model origin yet.

License