Neil Pomerleau

Neil Pomerleau

Software Engineer, Comedian, Musician

Music at the flip of a switch

My roommate wanted to have a light switch in the bathroom that plays the Fairy Fountain song on loop. After all, we had agreed to a Legend of Zelda theme for our new apartment. Here’s how I did it.

Parts

In the bathroom, there were three switches for the main light, fan light, and fan. The fan light enclosure was the perfect place to encapsulate this setup.

The two key challenges of this project were 1) powering this device and 2) remotely triggering the song to play. I initially considered using some sort of Arduino setup with a 120V relay triggered by the switch, but then I would need to find a separate way to power the Arduino and didn’t want to worry about batteries.

It turned out I could solve both problems by having the song loop when the device is powered on with 120V. However, this would make the Arduino less appealing due to boot time and steered me toward the Adafruit Audio FX Sound Board. This particular board has a built-in micro USB port for both power and adding audio files, as well as a built-in amplifier. Because this board specializes in audio effects, it requires no additional programming and supports playback when powered on and looping with minimal delays.

I grabbed a copy of the song and edited it down to a loopable WAV file, then loaded it onto the board with the name T10HOLDL.wav. As explained in the product tutorial, the board will attempt to loop a file with that name when pin #10 is connected to ground. Since I always wanted this to happen when the board has power, I soldered a tiny wire from 10 to a nearby GND. I also soldered the speaker to the appropriate pins on the board.

To power the device in the GU24 light socket, I used a GU24 to E26 adapter, followed by an E26 to outlet adapter, followed by USB power adapter to connected to the device via a micro USB cable. Since I had two GU24 sockets, I used the other one to squeeze in a purple light bulb for additional effect.

I unveiled the final product on Christmas.

December 26, 2018 at 12:00 pm

2 Comments

Does the sound come on instantly when light switch is triggered?

Patrick on March 17, 2024 at 9:44 am

This is pretty close to what I was looking for. I bought a “kiddie ride” (one that used to sit outside at grocery stores, parents would put their kids on, drop in a quarter, and it would start). The one I have is a motorcycle and I want it to play “Born to be Wild” every time it’s started. So, gonna use your guide…and help appreciated.

Matt Hallmark on April 18, 2024 at 10:27 am

Leave a Comment

About Me

Hi, I'm Neil! I'm passionate about building delightful products at scale, creating music, and performing in theatre and comedy shows.

Learn more