We show you how to add amazing lighting effects to your souvenirs (or display case) using this ESP8266-based Arduino project.
BUILD TIME: 3 HOURS
DIFFICULTY RATING: Intermediate
When we used to be able to travel overseas you would often find 3D engraved crystal souvenirs of famous places and attractions, like the one shown here. If you were lucky, you might have been able to get a custom one made with your portrait or image.
These crystal models are quite impressive and make a nice ornament, however, the display stands they come with are often of subpar quality. The stands normally use cheap dim LEDs that don’t properly illuminate the model, which is why we converted our existing display stand to a smart stand to keep the original exterior design while giving some new light to the aging electronics.
The Broad Overview
We will be converting one of these crystal display cases from a basic low-power single-colour LED design to a highly-customisable bright addressable display case. We will document the process of disassembly and finding suitable parts.
We will explain how we assembled and fitted everything within the constraints of our case. Finally, we will go through the software setup so that we can control the display stand from the internet or voice assistant.
You will be able to use some, or all, of what we have done with our display project, and adapt it to suit your own needs. You may have a completely different application for using these WiFi controlled lights.
The Original Stand
The display case can be powered via the rear DC jack or with the triple AAA battery compartment underneath. The display case features 12 LEDs, comprising 4 x red, 4 x green, and 4 x blue. These LEDs are attached to a simple PCB that alternates the power to create a basic colour changing effect.
We decided to retain the original stand housing, so we began by disassembling the stand and determining the number of LEDs we could install, power requirements, etc.
The stand has a model number XLD-678-12, however, after searching for this number online we found no documentation or information about the product. The battery cover does include some details, including a voltage of 4.5V and a current of 250mA.
To get inside the base we had to remove the four rubber feet to reveal the six Phillips-head screws. Once these screws were removed we could lift the base out of the stand to reveal the inner workings of the electronics. We also noticed that the DC jack and battery compartment are wired in such a way that when a DC jack is inserted the battery is cut out of the circuit.
We decided that if we wanted to create a high-quality stand we would have to replace the entire electrical system as it could not deliver the power required to drive multiple RGB LEDs and our mainboard.
We liked the idea of having battery and DC power options so we kept the original battery compartment and replaced the DC jack with one rated for a higher current. The small slide switch also needed replacement as we suspected it would not be able to handle the high current of our new components.
The original device featured a 4.5V DC jack input and an internal battery compartment for three AAA batteries. Both of these power inputs provide a voltage of 4.5V, which is fine for a simple LED circuit without a microcontroller or RGB LEDs. To ensure our new components would get the consistent 5V they needed, we changed to a 5V DC power supply and added a 5V Boost converter to our battery compartment that was capable of handling our current requirements.
In our case, we didn’t know the quality of the existing electrical wiring used so we replaced them all with new 22 AWG stranded wire.
For our lighting and controller, we decided to go with a high-density strip of WS2812B addressable RGB LEDs and an ESP8266 mainboard. This combination allowed us to increase the light count from 12 on the original to 21 on our upgraded version. The ESP8266 mainboard allows us to connect to the internet and control the addressable RGB LEDs to create custom effects.
We first wanted to test that all our components were working before we assembled and secured them in our display stand. We started by removing the silicon waterproof enclosure from our WS2812B strip, then measured and cut the strip at 21 lights so that it would fit in place of our original channel.
We soldered the included header pins to the side of the ESP8266 main board, and then attached the green data wire from the WS2812B LED strip to D4, the red wire to 5V, and the white wire to G.
Note: This setup can only deliver 500mA to the WS2812B so we will need to drive them at low power when testing.
We then planned to flash the software to the ESP8266 mainboard using WiFi Lighting Effects Driver (WLED). WLED is a feature-rich web server for ESP8266 and ESP32 boards to control WS2812B and other RGB LEDs over WiFi.
The first step to program our mainboard was to install the appropriate drivers for the integrated CH340 USB-to-SERIAL converter. This is available from https://www.wemos.cc/en/latest/ch340_driver.html
|Parts Required:||Jaycar||Altronics||Core Electronics|
|1m x WS2812B 144 LED/M Strip||XC4390^||X3222A^||CE04855|
|1 x ESP8266 Main Board||XC3802||Z6381||ADA2821|
|1 x 5V Boost Converter||XC4609||Z6339||POLOLU-2123|
|1 x 5V 2A DC Power Supply with 2.1mm connector||MP3480||M8904A||AM8904|
|1 x DC Power Barrel Socket||PS0519||P0620||POLOLU-1139|
|1 x Toggle Switch||ST0300||S1310||ADA3221|
|1 × 1000μF 16V Electrolytic Capacitor||RE6220||R5182||COM-08982|
Hook-up wire and electrical tape is also required. ^ The Jaycar and Altronics LED strip are 60 LEDs per metre.
Note: Our build used most of the parts from Core Electronics, apart from the ESP8266, which we sourced from Jaycar.
SETUP.EXE needs to be run as an administrator to launch the driver setup application. Clicking the INSTALL button installs the necessary drivers so that the computer recognises our main board when inserted.
Note: If you encounter any errors, check to see if the application was launched as administrator. Otherwise, you may already have a version of the driver - to get the latest, click UNINSTALL then INSTALL.
With the drivers installed, we proceed to download the esptool bootloader utility. esptool.py is a Python-based open-source utility to flash firmware to ESP8266 and ESP32 devices. The program requires Python 2.7/3.4 or newer installed on your computer. If you don’t have Python, you can download it from the following website, ensuring that you enable the add to PATH option when installing: https://www.python.org/downloads/
To install esptool.py we used pip. Launch the command prompt and enter the following command:
pip install esptool
This will download the required files and install them. If you encounter a “pip is not recognized” error you need to ensure pip has been added to your PATH system variable.
With our driver and flashing tool ready, we downloaded the latest WLED binary for our mainboard. The latest release can be found here: https://github.com/Aircoookie/WLED/releases (The binaries can be found under assets).
We need the WLED_0.x.x_ESP8266.bin file, which we recommend you download to your root directory as it will make flashing it easier.
Note: If you are running an ESP32 board, you can find the appropriate binary to download by checking this guide: https://github.com/Aircoookie/WLED/wiki/Install-WLED-binary#what-binary-should-i-use
Next, we flashed the binary we downloaded to our main board using esptool.py. Attach the ESP8266 main board to your computer with a USB cable, open up a command prompt, and navigate to the directory where you download the WLED binary using the CD command. eg. if you downloaded the binary to Downloads you can enter cd Downloads. If you saved it to a subfolder you will need to enter the complete path.
Once you have navigated to the correct folder in the command prompt, enter:
esptool.py write_flash 0x0 ./WLED_XXX.bin
Replacing XXX with the number of the version we downloaded.
Note: You can also click TAB after WLED_ to autocomplete the command.
Running this command installs the binary to our mainboard.
We can now power on the ESP8266 main board, which boots and creates an access point called WLED-AP. We need to connect with password: wled1234.
Once connected to the access point, we open a web browser and navigate to the setup page at 188.8.131.52 or wled.me.
This setup page will allow us to configure our network settings. We need to enter our network name and network password. We can leave the other settings as default and then click ‘Save & Connect’. This will cause our mainboard to close its access point and attempt to connect to our network.
The main board should now be connected to the home network and ready to test. Navigate to the WLED dashboard by finding your main board’s IP address.
Note: Modern WiFi systems may have an app that will tell you each device’s IP, otherwise you can use a network scanner program of choice.
We can now simply connect to our mainboard's IP address from a web browser or using the WLED app for Android.
Test that the RGB LED strip is working correctly by selecting a colour using the colour wheel on the WLED dashboard. The RGB strip should change to that colour. With that confirmed, we can proceed to add the power circuits and package the project into an enclosure.
The Main Build:
To install our new components, begin by disassembling the original case. We removed all the original electronics, but kept the PCB as we would use that as a support to mount our new lights later.
To prepare the original PCB, we removed all electronic components with a pair of pliers. Once all components were removed from the PCB we checked for any exposed traces and covered them with tape to avoid any issues.
With the bare PCB we could attach our RGB LED strip.
The next step was to design and construct our electrical system. We wanted the system to be portable so we designed a circuit that would allow the device to be powered via three AAA batteries or via a 5V DC jack.
We assembled our electrical components, including our new DC power barrel and switch, along with our voltage booster.
This circuit will use the internal switch in the DC power barrel to allow us to switch between power sources automatically (switching the negative side of the battery or power supply). When the DC socket doesn't have a power supply plugged in, the batteries and voltage booster supply power to the circuit. When a DC jack is connected, the batteries are disconnected.
With our circuit now complete, we tested the project to ensure everything worked as expected and could be controlled through the WLED web-interface.
The final step was to fit and secure all the components into the housing. We started by protecting any exposed wires with electrical tape and then started positioning our components. The DC barrel and power switch required slightly larger spaces than the original components so we had to remove some material. Finally, all the components could be secured in place with a dab of hot glue. With all the electronics securely mounted inside the casing, we can reinstall the top cover and screw everything back together.
With the hardware component of our build complete, we could test the software for our display case with the 3D crystal model. To do this, we can connect to our main board's IP address from a web browser or with the WLED app for Android, as we did earlier during testing. This will enable us to configure and customise the lighting effects for our display case. The WLED homepage gives us access to basic single colour control that allows us to set our display case to a single colour using the colour wheel or palette.
We can also enable more advanced lighting effects thanks to the use of addressable RGB LEDs. To do this, we need to tell WLED how many RGB LEDs we have connected so that it can correctly display advanced lighting effects. Navigate to Config - LED Preferences and enter the number of RGB LEDs we have in LED count. The other settings can be left as default or configured to your liking.
With the LED Count configured, we can return to the Effects page where there are over 100 custom options to choose from. Selecting any effect will enable it on our display case.
Note: You can also find previews for the effects at: https://github.com/Aircoookie/WLED/wiki/List-of-effects-and-palettes
The final important option to take note of is the favourites feature which allows us to create custom presets that can be easily enabled with one click. With any lighting effect configured you can navigate to Favourites and select Create preset to save that current effect, including the brightness level.
There are many more advanced options and features of WLED available, including Alexa integration, which you can read more about at the WLED project page: https://github.com/Aircoookie/WLED
Where To From Here?
We hope you are now able to apply the ESP8266 and WS2812B combination to your display application. Perhaps your crystal display stand could benefit from more or fewer LEDs, or you are just using the LED strip to illuminate your entire display cabinet instead.
Some of the improvements that could be made to this project would include quality-of-life improvements for the WS2812B’s, which includes adding a 300-500Ω resistor on the data line, a 1000µF capacitor across the power lines, and a 3.3V to 5V logic level converter. Our project worked fine without these additions but if you wanted a more robust scalable product engineered to last as long as possible, these would be good additions.
You may also want to improve the project if you plan to run it from batteries. The existing battery bay integration sounded good in theory but it had a few flaws. The new RGB LEDs drew a lot more current than the previous single colour LEDs, which resulted in the batteries being fully drained within 90 minutes when running at full brightness. You can, of course, use 1.2V rechargeables, but the circuit has no way to facilitate charging them so they must be removed and charged externally each time they are depleted. Also, when switching between power sources, the power is cut to the entire system for a split second, which causes the ESP8266 to restart. This unfortunately resets the colours to their default state. This power switching issue can be fixed with the integration of a capacitor but this would further complicate the electrical circuit. The best solution would be to replace the AAA battery bay with a LiPo battery and charging solution that would retain the ability to hot-swap batteries and also allow for continuous operation.