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

20260322_194741(1).jpg
TCU System Interface Log

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:

  1. 90 addressable LEDs
  2. ESP32 running WLED
  3. Adafruit Audio FX sound board
  4. dual layer diffuser
  5. push button control system
  6. multiple lighting modes
  7. integrated sound effects
  8. 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

  1. ESP32
  2. Adafruit Audio FX Sound Board
  3. Speaker (small 8Ω recommended)
  4. 90 LED strip (WS2812)
  5. 2x momentary push buttons
  6. 82Ω resistor (LED data line)
  7. 6 sets of 20 cm wire (used as long leads)
  8. 4 sets male/female connector pairs
  9. heat shrink
  10. USB cable (for ESP32 power)


Hardware

  1. M3 screws
  2. Cyanoacrylate glue (instant glue)
  3. Tape (for wire routing trick)
  4. wooden stir stick (or any thin wire snake)
  5. 5V 3A USB power supply (recommended)


3D Printed Parts

  1. TCU bottom housing
  2. TCU bottom plate
  3. TCU exterior posts (x4)
  4. TCU inner core bottom
  5. TCU inner core spine pin
  6. TCU inner core spine (x16)
  7. TCU inner core top
  8. TCU inner defuser
  9. TCU outer defuser
  10. TCU top cap
  11. TCU top houseing

(All STL files at thingiverse : https://www.thingiverse.com/thing:7320448 )


Tools

  1. 3D printer
  2. Soldering iron
  3. Wire cutters
  4. Heat gun or lighter (for shrink tube)
  5. Small screwdriver (M3 screws)
  6. Optional: helping hands

3D Print the Parts

TCU log 1 component fabrication
frame-00094.jpg

All parts of the Temporary Containment Unit are designed to be 3D printed and assembled without special tools.

Recommended Print Settings

  1. Layer height: 0.2mm
  2. Walls: 3
  3. Infill: 15–20%
  4. Material: PLA or PLA+
  5. 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:

  1. white PLA for the inner diffuser
  2. natural PLA for the outer diffuser

Both produce a smoother containment glow.

Print the Following Parts

Download all STL files from Thingiverse and print:

  1. TCU bottom housing
  2. TCU bottom plate
  3. TCU exterior posts (x4)
  4. TCU inner core bottom
  5. TCU inner core spine pin
  6. TCU inner core spine (x16)
  7. TCU inner core top
  8. TCU inner diffuser
  9. TCU outer diffuser
  10. TCU top cap
  11. TCU top housing

Once printed, test fit the major pieces, but do not glue anything yet.

Prepare Electronics (WLED + Sound)

WLED Powercore set up.bmp
WLED settings.bmp

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:

  1. Orginal Aircoookie
  2. Branch "0_15_x"
  3. esp32dev (RECOMMENDED for esp32)

Step 2 - Enable Usermods

Scroll to Step 3: Usermods

select:

  1. MultiRelay
  2. Max number of relays
  3. 4
  4. Enable HA discovery for external relays
  5. True
  6. Relay Pins
  7. 17, 18, 22, 23
  8. Relay Delay (seconds)
  9. 0, 0, 0, 0
  10. WLED does not control relay
  11. 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:

  1. LED type: WS281x
  2. mA/LED:55 mA (5 V ws281x)
  3. Color order: GRB
  4. Length: 90
  5. Data CPIO: 16

Buttons

  1. Button 0 GPIO: 32
  2. Button 1 GPIO: 33

Save and reboot.

Configure MultiRelay


return/continue in config to: Config \ Usermods

Multirelay

check:

  1. Enabled
  2. HA Autodiscovery

set:

  1. Relay 0: Pin 23 Delay 0
  2. Relay 1: Pin 22 Delay 0
  3. Relay 2 Pin 18 Delay 0
  4. RElay 3 Pin 17 Delay 0

Check:

  1. 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:

  1. T00.ogg
  2. T01.ogg
  3. T02.ogg
  4. T03.ogg

(The T## numbers correspond to the trigger inputs on the Adafruit board)

Example:

  1. T00.ogg would be -> startup
  2. T01.ogg would be -> scan
  3. T02.ogg -> red alert
  4. T03.ogg -> shutdown

Eject the drive and unplug.

Power Supply Check

Use the WLED calculator:

https://wled-calculator.github.io/

Settings:

  1. LED count: 90
  2. Type: WS2812
  3. Voltage: 5V

Recommended:

  1. 5V 3A power supply

Wire the ESP32 and Electronics

TCU Log 2 Electronic Integration
TCU ESP32 WLED pinouts05032026.jpg
frame-01163.jpg
frame-01139.jpg
frame-01051.jpg
frame-00960.jpg
frame-00795.jpg
frame-00194.jpg

Prepare the LED connector.

Cut the data wire and solder in an 82Ω resistor.

  1. Add heat shrink over the resistor to protect the connection.

This improves signal stability.


Wire the ESP32:

LED Connector:

  1. GPIO16 -> LED data
  2. VIN -> LED power -> Adafruit
  3. GND -> common ground ->Adafruit
  4. (2 female lead ends for switch to use)

Switch leads (use female lead end):

  1. GPIO32 -> black (button 0)
  2. GPIO33 -> (red button 1)

Audio board trigger pins:

  1. GPIO17 -> Adafruit T03
  2. GPIO18 -> Adafruit T02
  3. GPIO22 -> Adafruit T01
  4. 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:

  1. both switches
  2. speaker.

This provides enough length for routing through the core during assembly.


Test Before Assembly

Before moving on:

  1. Power the ESP32
  2. Confirm LEDs turn on
  3. Confirm buttons change modes
  4. Confirm audio triggers work

Testing now makes troubleshooting much easier.

Once everything is working, continue to assembly.

Build the LED Core

TCU Engineering Log 03 of 06; LED Core Assembly
frame-00068.jpg
frame-00211.jpg
frame-00298.jpg
frame-00337.jpg

The center light core is made from 16 stacked spine segments.

Stack the spine segments and glue them together.

  1. Make sure they are aligned straight as you build the stack.
  2. Allow to dry before continuing.

Wrap the LED strip around the spine from bottom to top.

  1. 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:

  1. Insert the spine into the inner diffuser.
  2. 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

TCU Engineering Log 04 of 06: Control Module
frame-00718.jpg
frame-00858.jpg

Insert the speaker into the inner top.

  1. Align the speaker with the mounting holes and secure it using M3 screws.
  2. Route the speaker wires through the center hole of the inner top.

Install both push buttons into the top cap.

  1. Make sure the buttons are oriented correctly, then tighten them in place.
  2. Route the switch wires through the center hole.

Attach the top cap to the top houseing.

  1. Use cyanoacrylate (super) glue to secure.
  2. Allow the glue to set before continuing.

Insert the inner core top to create the speaker chamber.

  1. Leave all wires exiting through the center hole on the bottom.

Route Wiring Through the Core

TCU Engineering Log 05 of 06: Final Integration
frame-00929.jpg
frame-00945.jpg

Use a wooden stir stick or similar solid thin long tool as a wire snake.

  1. Tape all wires to the stir stick snake.
  2. 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:

  1. the inner connector pin
  2. the inner core bottom

Carefully pull the stir stick snake through:

  1. the inner connector pin
  2. the inner core bottom.


This keeps all wiring hidden inside the lamp and routed cleanly to the base.

Final Assembly

frame-01102.jpg
frame-01154.jpg
frame-01218.jpg

Install the four external support posts into the top housing.

  1. Make sure each post is fully seated in its socket.


Insert the bottom housing into position.

  1. 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:

  1. LED connector
  2. speaker wires
  3. switch wires
  4. audio board trigger wires
  5. power (USB)


Install the ESP32 inside the base.

Connect:

  1. LED connector
  2. speaker
  3. switches
  4. Adafruit audio board
  5. 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.

  1. Tighten until snug, but do not overtighten.

Secure the external posts:

  1. Two posts are secured using screws (top and bottom)
  2. 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

TCU Engineering Log 06 of 06: Final Assembly
20260322_194647(1).jpg
20260322_194700(1).jpg
20260322_130109(1).jpg
20260322_130305(1).jpg
20260322_130423.jpg
20260322_130611.jpg
20260322_130703.jpg
20260322_130821.jpg
20260322_194627(1).jpg
20260322_130056(1).jpg

Apply the TCU decals to the exterior of the unit.

  1. 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

  1. Black button : short press/Startup sequence
  2. Red button : long press/Sensor scan
  3. Black button : double press/Green Stable mode
  4. Red button : double press/Yellow Stable mode
  5. Red button : short press/Red alert
  6. Black button : long press/ Shutdown

Your Temporary Containment Unit is now operational.

Containment field stable.