I enjoy working on projects that can mix a bit of art with tech/electronics. I was playing around with the idea of doing something with a shadow box which could go up on the wall. Something to do with lighting and an ESP32 came to mind. The eventual goal was to get the ESP32 onto the Wi-Fi, allowing you to control the lights and mode of a device from your phone and perhaps HomeKit. I got part of the way there, adding a button to change modes; but then I got off on another project as I am to do. I wanted to document my progress, and state for later; as well as put the code and designs up online before I go off and work on a more ambitious project.
General Design
I started playing around with 3D designs, so that a light could shine through; the designs were really 2D, but I used SolidWorks to do all the modeling, then adjusted the heights until the light came through well. I glanced around online at artwork people had, as well as periodically looking at Dribbble.com. I came around to the idea of a skyline; a city at night where the different buildings could light up, and blink. Then the idea added on; the buildings could blink to music, adding a microphone onto the controller would allow the lights to reflect the volume of audio.
I at first tried to print out individual, large, buildings and this proved to be too much and take a very long time. If you look at some of the below early renders, you can see how complex those buildings are.







I decided on the New York city skyline and started modeling the buildings. I needed a mix of decent sized windows, so the 3D print did not take forever; and small enough that the light effect came across well. I modeled several buildings, a few different ways, and did test prints. A few times I printed them taller than the printer could go, and that made me split the buildings in half. I did not like how putting them back together looked and decided to shrink the buildings a bit. I currently have a Creality Ender 3 Pro, making my bed size roughly 200mmx200mm.
Electronics
The plan was always to use an ESP32; I had not used them before and for a few dollars getting the capability to use the Arduino IDE along with Wi-Fi and Bluetooth made me interested. I also had not done much with LED strips before either. I dabbled with both on my workbench, and decided for this purpose an LED grid would be easier than working with strips. Those can be had for a few dollars online. I also got a diffusion sheet, a thick sheet of plastic that softens the light from the LED.

I worked on the Arduino code for a little while. I ended up writing a bit of code that averages the volume over time from the tiny microphone I hooked up to the ESP32, and then uses that to equate to a light level on the LED grid. The different columns in the grid matched different frequency ranges; this ended up giving a neat lighting effect with distinct types of music triggering different buildings. I need to calm it down a bit, but I didn’t put enough time into the code to get it exactly where I want it. Another code the box offers currently does a much much slower fade across the LED grid, but its sensitivity is too low, and the only way I got it to react was tapping the box; this can be seen in the video below.
I also used this as an opportunity to use KiCad for my wiring diagrams. The diagrams for this are not that complex, but I wanted to be able to quickly reference what went where. All these files are in the Github for the project. There is a button on the side of the box which cycles modes the system is in. There is an always on light, a mode to go to the music/audio in the room, slow light effects from audio (but not sensitive to the mic enough), and last was going to be a Wi-Fi mode (but I never got that working). I was going to mount an SD card for longer storage of assets for the Wi-Fi network; with the Wi-Fi not being implemented, this needed up not being needed, but a good learning experience.

There were small issues along the way, like how I wanted to make a power bus come in, and 3D printing little risers to hold everything off the back of the shadow box enough to get a good effect through the front window. Those were slowly overcome, mostly by trial and error, and I worked through the project. I fed the whole thing from a 5V wall plug. This would give power to the LED grid, and the ESP32.







I ended up simplifying the building models to speed up prints, and it generally looked nicer. The bigger windows were easier to print, and the effect functioned better. I attempted to make a mount for the LED light grid, that would have a front snap onto it to lock in the grid. I at first made the mounts too small for this, then got lazy and used hot glue over pushing forward small snapping plastic pieces.
In the end, I think the project came out well. I thought I may make more of them, for different cities, and then have a wall of them; and get the controller to the point where you could Wi-Fi control it. Except I have another project idea that has taken me away. Perhaps I will one day return to this, until then here is a video of it running (actually 3 videos spliced together), and the files will be on Github. I don’t have a ton of photos from putting it together, but here are a few.
Github: https://github.com/daberkow/shadow-box
















Parts Used (I am not including things like wire, or little common parts):
Button – https://www.amazon.com/dp/B07KX24WWS
Microphone – https://www.amazon.com/dp/B092HWW4RS
Mat – https://www.amazon.com/dp/B00BN1XIR2
Diffusion film – https://www.amazon.com/dp/B09XGZP71S
Shadow Box (8×10) – https://www.amazon.com/dp/B08V5RR6D5
LED Grid – https://www.amazon.com/dp/B09KB7WC75


