LED Desk Lamp (ESP32 + WLED + Sound) a DIY W/Stop Motion
by dadwithtowel in Circuits > Electronics
2880 Views, 43 Favorites, 0 Comments
LED Desk Lamp (ESP32 + WLED + Sound) a DIY W/Stop Motion
I wanted to build something that felt like it came out of a starship cargo bay; a glowing containment device with sound that could be holding anything from warp plasma to unstable biomass.
I also wanted it to integrate with my Home Assistant setup, so when I walk into my office, the unit powers up with light and sound.
This Temporary Containment Unit is a fully 3D printed desk lamp featuring:
- 90 addressable LEDs
- ESP32 running WLED
- Adafruit Audio FX sound board
- dual layer diffuser
- push button control system
- multiple lighting modes
- integrated sound effects
- modular construction
To make the build more fun, I documented the entire project in stop-motion, with Commander Bear organizing parts, soldering electronics, and assembling the unit step by step. Combined with the instructions below, the project is designed to be something you can replicate at home.
The result is both a working lamp, a short sci-fi build film, and hopefully some inspiration for some DIY variations.
Supplies
Electronics
- ESP32
- Adafruit Audio FX Sound Board
- Speaker (small 8Ω recommended)
- 90 LED strip (WS2812)
- 2x momentary push buttons
- 82Ω resistor (LED data line)
- 6 sets of 20 cm wire (used as long leads)
- 4 sets male/female connector pairs
- heat shrink
- USB cable (for ESP32 power)
Hardware
- M3 screws
- Cyanoacrylate glue (instant glue)
- Tape (for wire routing trick)
- wooden stir stick (or any thin wire snake)
- 5V 3A USB power supply (recommended)
3D Printed Parts
- TCU bottom housing
- TCU bottom plate
- TCU exterior posts (x4)
- TCU inner core bottom
- TCU inner core spine pin
- TCU inner core spine (x16)
- TCU inner core top
- TCU inner defuser
- TCU outer defuser
- TCU top cap
- TCU top houseing
(All STL files at thingiverse : https://www.thingiverse.com/thing:7320448 )
Tools
- 3D printer
- Soldering iron
- Wire cutters
- Heat gun or lighter (for shrink tube)
- Small screwdriver (M3 screws)
- Optional: helping hands
3D Print the Parts
All parts of the Temporary Containment Unit are designed to be 3D printed and assembled without special tools.
Recommended Print Settings
- Layer height: 0.2mm
- Walls: 3
- Infill: 15–20%
- Material: PLA or PLA+
- Supports are required for most parts, particularly the housing. I did not use supports for the diffuser components.
Diffuser Tips
Clear PLA will show LED hotspots. To reduce this, I lightly sanded the exterior of the inner diffuser, which helped soften the light and improve the glow.
You can also use:
- white PLA for the inner diffuser
- natural PLA for the outer diffuser
Both produce a smoother containment glow.
Print the Following Parts
Download all STL files from Thingiverse and print:
- TCU bottom housing
- TCU bottom plate
- TCU exterior posts (x4)
- TCU inner core bottom
- TCU inner core spine pin
- TCU inner core spine (x16)
- TCU inner core top
- TCU inner diffuser
- TCU outer diffuser
- TCU top cap
- TCU top housing
Once printed, test fit the major pieces, but do not glue anything yet.
Prepare Electronics (WLED + Sound)
Before assembling the lamp, flash WLED to the ESP32 and load audio files onto the Adafruit FX board.
This is much easier to do before everything is installed.
Flash WLED with MultiRelay
Open:
https://wled-compile.github.io/
Step 1 - Select Build Options
Scroll to Step 1 and select:
- Orginal Aircoookie
- Branch "0_15_x"
- esp32dev (RECOMMENDED for esp32)
Step 2 - Enable Usermods
Scroll to Step 3: Usermods
select:
- MultiRelay
- Max number of relays
- 4
- Enable HA discovery for external relays
- True
- Relay Pins
- 17, 18, 22, 23
- Relay Delay (seconds)
- 0, 0, 0, 0
- WLED does not control relay
- false, false, false, false
Step 3 - Compile Firmware
Scroll to Step 5: Start Compiling and download
Start Compile/build ...and wait.
Step 4 - Flash the ESP32
Scroll to Step 6: insall compiled SW
Follow the on-screen instructions to flash the ESP32 directly from the webpage.
After flashing, the ESP32 will reboot and ask for:
WiFi network
WiFi password
Once connected, open the IP address assigned by your router.
Configure WLED
Navigate to: Config \ LED Preferences
Under Hardware setup, Set:
- LED type: WS281x
- mA/LED:55 mA (5 V ws281x)
- Color order: GRB
- Length: 90
- Data CPIO: 16
Buttons
- Button 0 GPIO: 32
- Button 1 GPIO: 33
Save and reboot.
Configure MultiRelay
return/continue in config to: Config \ Usermods
Multirelay
check:
- Enabled
- HA Autodiscovery
set:
- Relay 0: Pin 23 Delay 0
- Relay 1: Pin 22 Delay 0
- Relay 2 Pin 18 Delay 0
- RElay 3 Pin 17 Delay 0
Check:
- reboot after save
Save and reboot.
Load Audio Files to Adafruit FX Board
Plug the Adafruit Audio FX board into your computer.
It will appear as a USB drive.
Copy your audio files using trigger naming:
- T00.ogg
- T01.ogg
- T02.ogg
- T03.ogg
(The T## numbers correspond to the trigger inputs on the Adafruit board)
Example:
- T00.ogg would be -> startup
- T01.ogg would be -> scan
- T02.ogg -> red alert
- T03.ogg -> shutdown
Eject the drive and unplug.
Power Supply Check
Use the WLED calculator:
https://wled-calculator.github.io/
Settings:
- LED count: 90
- Type: WS2812
- Voltage: 5V
Recommended:
- 5V 3A power supply
Wire the ESP32 and Electronics
Prepare the LED connector.
Cut the data wire and solder in an 82Ω resistor.
- Add heat shrink over the resistor to protect the connection.
This improves signal stability.
Wire the ESP32:
LED Connector:
- GPIO16 -> LED data
- VIN -> LED power -> Adafruit
- GND -> common ground ->Adafruit
- (2 female lead ends for switch to use)
Switch leads (use female lead end):
- GPIO32 -> black (button 0)
- GPIO33 -> (red button 1)
Audio board trigger pins:
- GPIO17 -> Adafruit T03
- GPIO18 -> Adafruit T02
- GPIO22 -> Adafruit T01
- GPIO23 -> Adafruit T00
These pins will trigger the audio effects through the MultiRelay usermod.
Extend the Leads
Solder an extra 20 cm of wire (male leads) to:
- both switches
- speaker.
This provides enough length for routing through the core during assembly.
Test Before Assembly
Before moving on:
- Power the ESP32
- Confirm LEDs turn on
- Confirm buttons change modes
- Confirm audio triggers work
Testing now makes troubleshooting much easier.
Once everything is working, continue to assembly.
Build the LED Core
The center light core is made from 16 stacked spine segments.
Stack the spine segments and glue them together.
- Make sure they are aligned straight as you build the stack.
- Allow to dry before continuing.
Wrap the LED strip around the spine from bottom to top.
- Keep the wrap tight and consistent to ensure even spacing between each loop. This helps create a smooth and uniform glow.
When the LED strip is fully wrapped on the spine:
- Insert the spine into the inner diffuser.
- Then slide the outer diffuser over the inner diffuser.
This creates the dual-layer containment glow.
Leave the LED connector accessible for wireign in the next step.
Build the Top Control Module
Insert the speaker into the inner top.
- Align the speaker with the mounting holes and secure it using M3 screws.
- Route the speaker wires through the center hole of the inner top.
Install both push buttons into the top cap.
- Make sure the buttons are oriented correctly, then tighten them in place.
- Route the switch wires through the center hole.
Attach the top cap to the top houseing.
- Use cyanoacrylate (super) glue to secure.
- Allow the glue to set before continuing.
Insert the inner core top to create the speaker chamber.
- Leave all wires exiting through the center hole on the bottom.
Route Wiring Through the Core
Use a wooden stir stick or similar solid thin long tool as a wire snake.
- Tape all wires to the stir stick snake.
- Make sure the wire ends are aligned so they pull through smoothly.
Feed the stir stick snake through the center channel of the LED core spine.
Continue feeding the stir stick through:
- the inner connector pin
- the inner core bottom
Carefully pull the stir stick snake through:
- the inner connector pin
- the inner core bottom.
This keeps all wiring hidden inside the lamp and routed cleanly to the base.
Final Assembly
Install the four external support posts into the top housing.
- Make sure each post is fully seated in its socket.
Insert the bottom housing into position.
- Feed all wires through the base opening as the bottom housing slides into place.
You should now have the following wires accessible in the base:
- LED connector
- speaker wires
- switch wires
- audio board trigger wires
- power (USB)
Install the ESP32 inside the base.
Connect:
- LED connector
- speaker
- switches
- Adafruit audio board
- USB power
Carefully tuck the wiring into the base.
Route the USB cable through the slot in the bottom housing.
Install the cable cover.
Close the base using M3 screws.
- Tighten until snug, but do not overtighten.
Secure the external posts:
- Two posts are secured using screws (top and bottom)
- The remaining two posts are glued at the bottom only
This allows easier assembly while keeping the structure rigid.
Allow glue to set before continuing.
Apply Decals and Test
Apply the TCU decals to the exterior of the unit.
- Take your time aligning the markings. Once applied, they complete the Temporary Containment Unit look.
Power On
Connect the USB power cable and power on the unit.
The startup sequence should begin automatically
Test controls
- Black button : short press/Startup sequence
- Red button : long press/Sensor scan
- Black button : double press/Green Stable mode
- Red button : double press/Yellow Stable mode
- Red button : short press/Red alert
- Black button : long press/ Shutdown
Your Temporary Containment Unit is now operational.
Containment field stable.