T3W9: Assembling The Clock

Last week we did all the wiring that we will need for the clock project. This week we will finish up the soldering and try to do the clock assembly. I don't know if the Tuesday class has one more week after this or not, but if they do we will spend it on setting up the WiFi and controlling the clock.

Before assembling the parts of the clock, plug the microcontroller board into a USB +5V power supply (like a phone charger) and make sure the strip lights up. There should be a tiny blue LED on the microcontroller board that also lights up. Unplug the USB cable once the LED strip is working.

Step 5: Bend Strip and Attach to Tube

There is a slot in the 5 inch diameter plastic tube segment that allows the wires to the LED strip to go inside the tube where the microcontroller board will be. Gently bend the wires and end of the strip before the first LED down, at a right angle to the LED strip. The strip will wrap clockwise around the top of the tube, so orient the slot so it is on top and test wrap the LED strip around the tube. The other end of the LED strip should just overlap the slot and go on top of the wires. When it seems right, remove the blue backing from the back of the LED strip to expose the adhesive, and stick the LED strip around the top of the tube. Put the strip slightly below the top of the tube so it doesn't interfere with the disc which will be glued to the flat top of the tube.

Step 6: Attach the Microcontroller Board to the Disc

Plug the USB connector into the board again and route the USB cable through the slot in the plastic tube. Find the tiny blue LED on the microcontroller board by the antenna. You have a choice for mounting the board: blue light towards the disc or away. With the blue light toward the disc, the light will shine through the disc and serve as a center point for the cicle of LEDs. But unfortunately the corner of the metal can with the microcontroller is right near the LED and can shadow the blue light. Hold the board under the plastic disc and center the LED under the inner circle engraved into one side of the disc. Press the board against the disc and see how the light looks through the disc. If it looks okay to you, use double stick tape on the metal can to attach the board to the disc, while keeping the LED centered under the small inner circle. If you don't like the way it looks, flip the board over and use double stick tape to tape the other (non-LED) side of the board to the disc, towards the center (nothing to align in this case).

Step 7: Attach the Translucent Disc to the Top of the Tube

Put the translucent plastic disc on top of the tube with the LEDs up admire the LEDs shining through it. There is a circle the size of the tube etched on one side of the disc, put this side down onto the end of the tube. Use the shadow of the circle to line up the tube in the center of the disc. When you are happy with the alignment, carefully flip the disc and tube over and apply hot-melt glue to the joint to fix them together.

Step 8: Connect to the Microcontroller Over WiFi

Look for WLED-AP in your phone's wifi menu and connect to it. The password is wled1234. If you open a web browser you should see the WLED control web page. You can either configure the WiFi connection (once you are home, don't do it at Lowell) or just connect to the control panel and play with the LEDs.

More Information on the WLED Software

We didn't have much time for this project so I didn't do a lot of explanation of how it works. The microcontroller board uses an Espressif ESP8266 module which has integrated USB and WiFi. The software that controls the LEDs is WLED. WLED firmware is loaded on the ESP8266 board using their installation website (which has to be run from the Chrome or Edge browser) with the ESP8266 board plugged in to a PC's USB port.

You can configure the WLED program using the built-in webserver or with an Android or iPhone app. The ESP8266 can be configured to connect to an existing WiFi network if you provide the SSID and password, or to broadcast its own WiFi access point. Since everyone will have a different WiFi setup, the boards were configured to be WiFi access points. From a phone, enter the WiFi setup and look for a WiFi network called "WLED-AP" that is broadcast by the ESP8266 board. Connect to WLED-AP and open a web page and you should see the WLED user interface. Some phones are set up to disconnect from WiFi networks that don't have internet access so you may need to change a setting on your phone to stay connected to the WLED server.

From the WLED web server you can enter your home WiFi information to connect the board to your home network. This is required if you want to run the WLED app on your phone. However you can also set up the LED colors and patterns directly in the WLED webserver, so you don't need to connect the board to your home WiFi to program the LEDs.