r/arduino • • Nov 04 '26

Microcontroller Mic controlled LEDs for a Halloween Pumpkin

Enable HLS to view with audio, or disable this notification

My youtube channel name is ALMA Industries

CH004 FN2: HALLOWEEN — my kind of Treat. Talking Pumpkins and Little Monster Rockstars, see how Jack's put together on my channel.

8 Upvotes

11 comments sorted by

2

u/ALMA_x11 Nov 04 '26

This is a led strip that reacts to the audio waveform inputs sent into a microcontroller. The amplitude of the wave is mapped to pumpkin brightness levels. I walk through all steps and how the sensors work and such in the full video. Full video is on my channel if your interested -- See you next Halloween!

2

u/ALMA_x11 Nov 04 '26

What song would you have him sing?

2

u/ALMA_x11 Nov 04 '26

I had this reacting to the movie Ghostbusters on Halloween... works like a charm!

2

u/feldoneq2wire Nov 04 '26

Are you using an op amp to handle the sound input?

2

u/ALMA_x11 Nov 04 '26

Thanks for the comment. So there are two things I did.... both are shown in the full video CH004 FN2: HALLOWEEN. But as an overview:

  1. Microphone input (what you see in the demo to illuminate pumpkin). So in this case, the microphone used (either the MAX4466 or MAX9814... 4466 has manual gain adjustment, 9814 has automatic gain). So the mic itself handles the gain... and also the offset (which is about 1.25V). That way the AC waveform received by mic analog input is not clipped off went sent into the microcontroller's analog input pin. I explain in the main video if interested.
  2. Direct AUX input from phone into microcontroller (that way people talking does not interfere with the song playing... aka, I want the lights to illuminate to the song and not me talking). In this case, I had to give more thought to how the signal would go from my phones headphone jack to microcontroller's analog input pin. The output of the phone is about maybe 2V AC audiowave (+/- 1V). So it wont overpower the microcontroller analog input as it can take 0-5V... but the analog input will only take positive inputs, so we have to shift up the signal to be in the positive range. To offset, I used a combo of capacitor (to read in the AC audio waveform) and voltage divider (to offset by 2.5V). I was gonna use an Op Amp for the amplification and offset... but turns out the capacitor / voltage divider combo worked perfectly for my needs (and apparently, its a technique used by many when you dont have an OpAmp). Was interesting to learn about.

2

u/feldoneq2wire Nov 04 '26

When I first looked into a sound-reactive circuit, my fear was that a signal swinging pole-to-pole would damage the MCU by sending up to -1V to it. Perhaps a completely unfounded fear. So I switched to an OpAmp setup so that I'm measuring 0-5V. However it does not have automatic gain control so I have to recalibrate occasionally in the MCU.

Using a MAX9814 combined with capacitor and voltage divider to pull up the signal sounds so much simpler.

2

u/ALMA_x11 Nov 04 '26

It worked really well. I demo both the MAX4466 and the MAX9814.

At first I said "wow, the 9814 is the best". And my brain was done with that. But then I thought, okay, the 9814 auto-gain worked really well... BUT, the sensor is hunting for any sound... and normalizing it so a whisper or a yell will either turn up or turn down the gain in a split second.

If you had a microphone though that you wanted to talk into... and not have it pick up another person, this wouldn't work well. The 4466 would as it has a manual gain. You could turn the gain down in that setup so it only picks up your voice really close to the mic... and not hunt for the sound from you moving your chair lol

Was fun to test both. They both have their places for sure.

0

u/ALMA_x11 Nov 04 '26

Above is an overview of Microphone Input.

2

u/ALMA_x11 Nov 04 '26

And above here is an overview of AUX input.

2

u/feldoneq2wire Nov 04 '26

So simple and elegant. Thank you.

2

u/ALMA_x11 Nov 04 '26

It is best to test by digital multimeter what the output voltage is of the cicuit (Microcontroller Analog to GND) before using the signal. Just to verify its in a range that wouldn't mess up the thing its plugged into.