Sound responsive fire stick Having obtained a meter of 144-led-per-meter strip,

Sound responsive fire stick

Having obtained a meter of 144-led-per-meter strip, I wanted to knock up some sort of ambient light based on @Mark_Kriegsman 's fire2012 code. The twist is to add sound (and motion) reactivity in the sense that it would be broadly responsive to activity such as playing music, watching movies, talking, whatever.

I had a serious go at it yesterday. No video since y’all know what the fire anim basically looks like and I’d have to upload a long vid to get some sense of the dynamics wrt sound. In a hardware sense I now have more experience of microphone amplifiers in a mcu context. For anyone trying this out, don’t even think of using an op amp on an mcu’s 5v supply. Either linear regulate a separate 5v supply or the 3.3v out out of an arduino will do at a pinch. In particular you can’t have a strip of ws2812s anywhere near the power rails of an op amp running 100x gain. I needed a filtered/slower sound pressure level rather than a fast moving analog in. I copied this circuit for an electret microphone module from Freetronics in Oz:

With the benefit of experience, I seem to have made a better microphone input than the Funky Plank, so I added an MSGEQ7 to it as well, in case I fancy adding some spectrum effects.

Anyway, software wise, this is how I made fire2012 responsive. The analog read values of the SPL input is often 0 when it’s quiet and peaks up to 200 or so in loud music. I’m a big fan of the Arduino RunningAverage library. For this you specify your window, do a variable.addValue(value) and then get the running average with variable.getAverage(). After some playing I ended up modifying Mark’s COOLING and SPARKING based on the SPL average, every second:

if (splTest > 1000)
{
    int curav = soundlevel.getAverage();
    curav = constrain(curav,0,200);
    COOLING = map(curav,0,200,250,20);
    Serial.println(curav);
    splTest=0;
    SPARKING = curav;
    
}   

It turns out than a 0 to 200 value is perfect for SPARKING as well. This means at low sound levels you get a very low sputtering flame. Changing the values of cooling and sparking more quickly results in an interesting added layer of randomness too. Incidentally, 1m of LEDS operating at a FastLED.setBrightness(40) or so will easily run off the 5V on USB.

Next hardware thing to add, some sort of FET to switch on/off the LED strip completely since they draw a bit of power just sitting there.

Sounds like a great adaptation!

I keep wanting to play with sound reactivity, but keep getting distracted with something or other… This summer, I hope!

Thanks for sharing your notes and links.

Great write up!