Making a WS2811 based NeoPixel clock
Ingredients:
- 2 strands of NeoPixels (50 + 8 additional)
- 2 pc. 3D printed reflector
- 1 pc. LED diffusion acrylic
- 3′ x 1×4 wood
- 1/8″ plywood (small piece for back – about 260mm x 102mm)
- Screws, glue, nails
- Case finish
- Paint: Primer, Final color, Chrome (optional for reflector)
- Stain: Primer, Stain, Polyurethane or other finish
- 5v3A power supply
- 5v power connector that fits power supply
- ESP32
- protoboard
Summary:
First we’ll get the reflectors started. Then we’ll cut some wood, build the frame and start painting. Then we’ll do the electronics and final assembly.
The goal (before buttoning it up) is to make a bit of a sandwich like this:
From the top, we’ve got the clock-back, the NeoPixels, reflector, and screen. For optimal results, the screen needs to be as close to the reflector as possible to prevent light leakage resulting in blurry segments.
Note: I use both sides of the ruler. Sometimes mm are easier to use (3d printing, etc.) and at others, Imperial measure (US wood).
Steps:
Reflector preparation
-
Print or acquire a set of reflectors.
-
Paint or primer the reflector.
The LEDs are bright! With a PLA or even lighter-colored ABS, the light leaks through the reflector segments and makes a less appealing final result.
Exception: Black ABS seems to be able to block the light.
Painting the inside of the reflector segments with white or chrome will block the light leakage and reflect more light directly out of the segment.
Clean up the internal segments of the reflector before painting. Strings and blobs will cast a shadow on the screen.
Zoom in on the picture below – the red circles show some of the problem areas.
Note: Clean up the part before you paint it so you don’t scrape the paint off.
Frame Construction
-
Sand or route the edges of the boards to round or otherwise finish the edges.
-
Cut the sides, top and bottom.
I used a 45 degree bevel cut. It made things a lot harder to assemble, but looks nicer.
Inside lengths were 3 5/8″ and 9 7/8″
-
Cut slots for back and screen on all four sides and cut slots for reflector on top and bottom.
Make the front and back slots 1/4″ from the edge – that is, leave 1/4″ of wood. A whole lot more and you wont be able to fit the wires from the NeoPixels in-between the clock-back and reflector.
The additional slots on the top and bottom for the reflector should be 14-15mm away from the front slot. The idea is to keep the reflector as close to the glass as possible.
Go for 1/4″ deep too.
The slots should be 1/8″ wide – wide enough to fit the screen and reflector-tabs without a lot of play. I needed to move the table-saw gate and run the board through two times as my blade kerf is less than 1/8″.
Watch out for staples! (This was a scrap piece…)
-
Test fit.
Make sure the screen fits the front slots.
Make sure the reflect fits tightly against the reflector.
It is very difficult to widen the slots after the frame is assembled!
If you go a little too wide on your slots, you can use some hot-glue or putty during final assembly to set things in place.
-
Attach one side to top and bottom and prepare the other side:
I’m not a frame builder and this is harder than it sounds. With bevel cut ends, they slip around as you are working with them. Using a helper like a Band Clamp makes it easier but it is still fiddly work. Square cut ends would make this step a lot easier but wouldn’t look right with the router-rounded edges.
a. Set up the frame. Square the corners. Make sure the slots are aligned. I put the reflectors in the front slots and clock back into the back slots which makes sure the slots are aligned and helps keep the box square.
b. Glue/nail only one side, leaving the other unattached at the moment.
c. Drill with countersink the other side. Pay attention to where the slots are and avoid placing the screw in a slot.
I also tried V-nails, which didn’t look as good and threaded-inserts which were impossible (for me and my tools) to set into the beveled edge properly.
-
At this point, the frame should be together. If you used some glue (remember, only on the one side), let it dry.
-
Unclamp the frame, and sand/finish the edges/corners. Fill and finish the nailheads if you used nails. You’ll want to remove the clock back and reflectors if you installed them when building the frame.
It may be useful to leave them in when finishing the edges and corners and remove them to finish the inner parts of the frame – but be careful not to damage them.
-
Primer and paint or stain.
Primer really helps with paint absorption on lighter woods, making the surface smoother. The primer I used was white so I used it also on the reflector.
-
Lightly sand and reprimer.
Two coats of primer to ensure even coverage.
-
Paint many light coats.
This will help prevent drips and runs.
Don’t fill the slots with paint – it is a tedious task to clear them.
-
Let the paint dry.
Follow the directions for the paint or stain that you’re using. Don’t rush. Reapply within the time-limit specified or let it dry completely before reapplying. This step will likely take days.
Electronics
-
Assemble the LED strand.
We need 58 pixels. Unfortunately, the strands come in lengths of 50, so you’ll need two. No worries, we’ll make use of the other 42.
a. Cut 8 pixels off of the end of one of the strands.
Cut it off of the end of the strand, not the beginning. Note the connector types in the picture above.
Cut the wires in the middle – between two pixels – so you’ll have some wiring on either end. You’ll end up with a 8 pixel strand and a 42 pixel strand.
b. Separate and strip the wires on the 8 pixel strand.
c. Cut the end connector off of the remaining 50 pixel strand and solder the two together.
Make sure you get the wires right. The colors from different strands aren’t always the same. Test it before soldering and wrapping because you don’t have a lot of extra wire to work with.
I used shrink-tubing to clean it up.
-
Insert the LEDs into the reflector.
Again, sounds simple, but some preparation will make things easier:
a. Use a reamer to properly size the holes.
Depending on your 3D printer configuration, material used, first-layer settings, etc. the actual diameter of the holes in the reflector vary slightly so use a reamer to clean and size the holes. Doing this will also remove any paint buildup.
Use some tape around the reamer to mark the depth once you’ve determined a good diameter.
b. Clean up any fragments or hairs.
They will be silhouetted onto the screen.
c. Use the PixelTool if your thumbs get sore.
d. Looking at the back of the clock, insert the pixels in this order:
e. The stretch between 30 and 31 is at the limit of the stretch between pixels. Take time to pull apart the two sets of wires at the bottom of the pixels to give yourself a few more mm to work with.
f. If you’re having problems inserting a pixel, look at the ridge around the top. Sometimes there is a bit of rubbery flashing left over from the molds.
Use a knife to clear the blockage.
-
Insert the loaded reflectors into the frame. Make sure you orient the end connector towards the fixed side of the frame.
-
Insert the screen into the front slots.
-
Cut a slot on either side of the clock-back for power ingress and strand output.
I used a drill and box-cutter. I should have been more careful.
-
Insert the clock-back into the back slots. Feed the tail end of the strand out of one of the slots on the clock back before you slide the clock-back entirely into place.
-
Program the ESP32:
Use the Moddable SDK to compile the source or download an .img file to flash to your ESP32.
-
Set up electronics:
First, I used a piece of protoboard, then a very simple PCB. At a price of under $20 for 10 boards, it was fun and worth it to learn a bit of Eagle. I used the panelizing technique to replicate the design 4 times to fit within the allowed space and thus get 40 boards for under $20. Its prettier and I can put my name on it 🙂
The electronics are fairly simple. We only use VIN, GND and GPIO 22 on the ESP32. The NeoPixels may have come with a connector, or you can order it when you order the strands. Use a power connector that matches your power supply.
- 5v+ Red (center pin) on power connector to ESP32-VIN and NeoPixels 5v+.
- GND Black (outer sleeve) on power connector to ESP32-GND and NeoPixels GND.
- ESP32-GPIO22 to NeoPixels signal.
-
Connect the NeoPixel strand in the clock to the electronics board. Tuck it into the clock between the wires and clock back.
It’s a tight fit. Gently press down on the neopixel wires to make some space. Be careful not to push the neopixels in too hard causing the reflector to break. You can use some hot-glue if you need to make repairs.
-
Attach the remaining side panel with the screws. The power connector should come out of the slot you made in the clock back.
Almost done.
Remember those extra pixels we have left over? And did you wonder why you clipped and soldered the end of the strand instead of just clipping 8 pixels off the beginning of the strand and attaching it to the 50 pixel segment without soldering?
-
Attach the remaining 42 pixel strand to the NeoPixel connector coming from the back of the clock.
This is called the Tail and gives some additional flair to the clock. You can link a number of strands but you may overwhelm the power supply if you add too many.
-
Plug it in. Connect and configure.
Configuring and using the clock
In the setup, you will need to specify the Layout as Legacy and use Pin 22.
Enjoy!