Arduino

Shadow Box

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.

Wiring diagram

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

ESP32 – https://www.amazon.com/dp/B0B3JD1K1T

Creating a Radio Part 1 – General Hardware

The project I have been working on for the last two months was a radio for my parents anniversary; but not a normal radio, I got a replica of a 1934 Thomas Radio (Collector’s Edition), gutted it, then built my own system to put music on. I figured for fun I will write a few posts about it, and anyone who wanted to try to reproduce it again would have ample data.

Radio Picture

This is the front of the final radio

To start let us look at the model radio I started with, most will work, just with varying degrees of work put into them. The closet website I can find to the version I have is here, http://tweakeddesigns.blogspot.com/2011/07/reproduction-of-1934-thomas-radio.html. I think this is the exact radio, but with a slightly different wood stain on it. First I got that radio, then ripped all the parts out of it, except for the two outer front knobs (potentiometers). It turned out that the middle knob was just a stick with a string around it that went to a sensor and the channel dial. So the whole dial moved then this string was twisted, but that was only held up by the old internal electronics. Since that was a very… janky, I removed that, and replaced it with a separate potentiometer and a servo to change the dial hands. I made a awesomely horrible 3D render of how this looked, with all the original parts removed, and a servo added. I will do another post all about the Arduino and how that was hooked up.

3D back of radio

Here is a bad 3d model of the empty radio in the back

Now for the best of prototyping, I used cardboard to support all this, cardboard is your friend for prototyping, except when it catches on fire, then it’s bad. Afterwards, I got these wooden splints from Home Depot, and put them in to reinforce everything, they came in about 14 inches long by 1.5 inches wide by 1/8 inch thick. I secured them with super glue, then screwed the Arduino microcontroller into these supports. Of course with plenty of electrical tape over the wood to shield it all.

One key part of the system is how the music is played. The music is played through a Mini-ITX board that is attached on the back. I needed a power supply for this, so I got a Mini-ITX  case(Antec Mini-ITX Case ISK100) and just removed the power parts. The original plan was to put the pc outside this device, in a normal pc case, but I figured I’d just go for this design. Then I drilled a hole in the side so that I could use the Antec cases external power brick, and just plug it in the side. That had plenty of electrical tape on its supporting splint, along with a plastic shield that the power supply part had under it in the Antec case. I don’t like fire, so I was sure to be careful when handling these power systems; also, this was the only splint that was secured with screws and super glue, I dont want a charged power supply falling. The picture below shows this.

Back of radio

Real radio back

In a simple wiring diagram, we have the Arduino all wired up, post to follow, that goes into the mini-itx board through a USB hub. The USB hub also has a SD card reader, the software and Ardunio goes into the USB hub to make everything easier. The SD card reader is aligned to the side port, where the tape drive used to be, then songs can be updated by taking SD card out and updating the files. Then we have the original speaker in the radio wired into a 3.5mm headphone jack, available at Radio Shack, I’m sorry THE SHACK, and that goes into the audio on jack of the mini-itx board. The power supply cable goes into the Mini-ITX board, along with the SATA SSD. I know that doesn’t explain it well, but I will be writing more articles, one about the wiring and the Arduino wiring; then another about the software running the Ardunio and on the Mini-ITX board.

I’m not great with technical documents, if anyone has any questions feel free to email or even better post a comment.