Neopixel Based Moon Clock
This is a tutorial for an adafruit trinket M0 based neopixel moon phase tracking clock. its different from other clocks out there that use round LCDs as it uses a much simpler and robust neopixel display and can be made for around 40$
Supplies
De-soldering Original Leads From Rings
Now, this step is not necessary required, however it makes the plate of LEDs have a much smaller form factor, making the final project slimmer. if you feel confident in your soldering skills, follow theses next couple of steps:
carefully pass a tinned soldering iron over the ends of the leads and pads to melt the solder while gently pulling the end of the wires with your other hand.
Soldering GND and +5v on the Rings
carefully strip some wires and tin them and, in a strait line, from GND to GND, and 5v to 5v. Press the soldering iron to the pads and wire to solder them down, be careful as the exposed wire can get hot. add or remove solder as needed.
finally add the 470uf capacitor to the ends of the two power rails to protect from voltage spikes.
Soldering the Signal Wires
now comes the hardest part of the re wiring. The signal wire needs to move from the DO to DI so the data overflow from one ring goes to the input of the other.
because of this we need to strip and tin small pieces of wire and snake it over the 5v and GND lines.
the easiest way I found was to:
- solder one side to the pad
- cut the wire to length
- strip and tin the other side of the wire
- using a pair of pliers hold down the other side and
- solder the other side
Use a Multimeter to Test Continuity
Using a multimeter, carefully test the resistance between all of the data pins and the GND and 5V lines. all of them should have inf. resistance as they should not be touching. if any of the lines are touching carefully pull them apart or re solder it.
Setting Up the Trinket and Librarys in the Arduino IDE
first off we need to update the Arduino IDE to recognize the Trinket board.
open the IDE and go to File>Preferences>Additional boards manager URL and paste this URL from the adafruit website, click OK, and wait for it to load.
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
source: https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/arduino-ide-setup
then, on the right of the IDE, click on the books and search of the top 'adafruit neopixel' and click install. wait for it to load and then do the same for 'DS3231' by Andrew Wickert.
Soldering Control Board
now we take out the perf board and make the final circuit.
connections we will be makeing:
- USB > + on the DS3231 and 5v on neopixel rings.
- GND > - on the DS3231 and GND on the rings.
- PIN0 > D on DS3231
- PIN1 > DI on outer ring
- PIN2 > C on DS3231
*make sure to not cover the reset button like I did on my first prototype.
Soldering the Trinket Headers
first we want to solder the headers or pins for the trinket. this involves putting the pins on the trinket, soldering them on, and then slotting them into the perf board. you can also place the pins in the perf board, solder one side and then slot the other pins and use the trinket for spacing, so that it can slot on and off for testing. then flip the board over and solder the other side
DS3231 Headers
ok, now this is where I say don't do what I did. this is what I recommend doing:
solder 5 pins to the perf board and slot on the DS3231
However if you really want this thing slim and you are very comfortable with a soldering iron, follow this:
- using the soldering iron (or better a hot air gun) carefully heat up the back side of the connector on the DS3231
- next using pliers (careful the board will be hot!) carefully pry the connector off of the DS3231.
- what I had to do to connect the new header was to do it one pin at a time, heating it up and then slotting the pin through the hole so that the integrated circuit will be at the bottom to prevent short circuits or stray voltage from the coin cell. If you have a hot air gun this would be a lot easier.
- finally slot the new pins into the perf board and solder them down.
finally take 3 pins and solder in the neopixel header.
Connecting 5v and GND Wires
here comes the most complex step. we are going to make the connections previously listed.
- USB > + on the DS3231 and 5v on neopixel rings.
- GND > - on the DS3231 and GND on the rings.
- PIN0 > D on DS3231
- PIN1 > DI on outer ring
- PIN2 > C on DS3231
there really is no easy way to describe how to do this so use the gif and pictures for reference, however i will try my best. first lets do USB and GND.
- you want to strip and tin a wire and solder it into the hole next to the USB pin.
- then, add more solder while heating up both the wire hole and the pin, and a solder bridge should form.
- then on the other side of the wire, pull it lightly and line it up with the hole next to '+' on the DS3231.
- cut it to be just longer than you expect you will need.
- strip and tin that side too.
- finally bend the end of the wire with pliers as it can be sharp, and insert it into the hole next to '+'.
- make a solder bridge here too.
- do this again with the GND pin and the '-' header on the DS3231.
next we want to connect the Neopixels. I use the clipped ends of the capacitor as the distance traveled is short but the inside of a wire would work as well
- carefully place the piece next to the pin you want to connect and heat it up with the soldering iron.
- the solder when melted should pull in the lead.
- once the part is cool, bend it till it makes contact with the other pin you want to connect
- heat and solder the other pin as well.
- if the wire is making weird bends, you can also solder it down to the perf board by heating up the wire and placing some solder on it and one of the perf board pads
Signal Wires
do the same as above with:
- pin0 (SCL)> DS3231 C
- pin1 (Aout)> Neopixel DI
- pin2(SDA) > DS3231 D
Test the Rings
now we get to see our hard work in action. strip and tin the other ends of the 5v, GND, and DI of the outer ring. now we take out the trinket, and connect the DI to pin 1, GND to GND and 5v to USB. don't connect the 5v to any other source on the board unless you're going to make it battery powered as it will pull way too much current from the board.
Diffusion
if you dont want harsh pixels on the lithophane, make sure to add some diffusion, I used layers comprised 1 layer of thin plexiglass and 2 layers of parchment paper totaling 6 total layers. more layers is more diffuse but it insulates the LEDs and can possibly damage them. my recommendation is to experiment :D find what works for you and play with the brightness values in the next step.
Customization
you can even customize the phases, loading screen, or error screen using the attached pjs program. simply open the program and click on the circles to turn them on or off. then click s to post the Boolean array to the console. then copy and paste the code to the phase or add a new one in the arduino code
Upload Final Code
finally we get to see it fully working, solder the wires from the plate to their respective pins, and upload this code to the trinket as described above. there should be a brief smiley face and then the current moon phase should appear.
3D Print Enclosure
I have included the f3d files if you want to make any changes to the enclosure.
here is the link to the thingiverse page with the 3d models:https://www.thingiverse.com/thing:7200076
Downloads
Final Assembly
finally screw down the final board with the m2 screws (and heat inserts if you choose) and then test the plate of neopixels. if it works, glue the led plate in place (i know, not ideal, but there is no real mounting points on the LEDs) and finally glue the lithophane on top of it all. you should be able to plug in and hang it on the wall
Hanging
mount the final product on a screw in a drywall anchor or into a stud, and hang the body using the cutout at the top of the body
Enjoy :D