12V LED Sound to Light or Color Organ

I made a couple of sound to light units at school and university many years ago.

1977 - around the time when I started making my first sound to light
1977 – around the time when I started making my first sound to light

Not much has changed about the technology, but on the display side LEDs are made for these – not only do we now have the chance of running the system at 12 or 24 V but we can avoid all the fun and games with mains triacs and pulse transformers – I got several mains shocks in those days, because while I optoisolated the main circuit from the triacs using MOC3020 opto-triacs the metal tabs on the triacs were live via the lamps, and on the same circuit board…

Now the Chinese make these things to drive LEDs by the millions on ebay and Amazon, and the sound to light is usually an add-on to a box designed to set moodlighting by colour with a remote control. And the sound to light function is crap on the two I’ve tested – I sent one back to Amazon because it was so dreadful it wasn’t worth the £12, although the cheaper Chinese device I have the light chase mode is acceptable.

Lancaster's original article
Lancaster’s original article showing the filter design

There’s not much that has changed about the filtering from Don Lancaster’s 1970s article – sure we can use opamps or DSP but the essentials are still the same half a century later. I want to use proportional PWM control with the LEDs. There are many designs of sound to light on the internet – the simplicity of this one is appealing but won’t scale to higher power, and a plus in the 1970s was the slow response of filament lamps – without some sort of smoothing LEDs can easily get a flickery irritating mess. Some flicker is part of the territory with a sound to light unit, but it is worse with LED displays.

Analogue or digital?

It’s possible to do PWM in the analogue domain using a ramp sliced by comparators, but an Arduino or a PIC would do this well, and allow me to do some AGC. Modern music is much more compressed than it used to be due to the loudness wars so AGC isn’t as necessary now than it was in the 1970s and 80s. However, using a microcontroller lets me consider per-channel AGC which would be clumsy in the analogue domain.

Conversely, the active filtering is easiest and best done analogue – it would still thrash a microcontroller to do the audio filtering, and it’s just not that demanding. Going all digital requires heroics of coding or DSP – it’s hard to beat a quad opamp IC and handful of cheap parts. This then goes into a half-wave rectifier/peak detector.

the MSG7 frequency response isn't exactly what I want
the MSG7 frequency response isn’t exactly what I want

I did consider using an MSGEQ7 seven band spectrum analyser chip which uses switched capacitor filters, and has the peak detectors already, but the response isn’t really right although I’d probably get away with it. For instance using just the 160Hz, the 400 and the 2200Hz bands would be close.

a well-used copy of Don Lancaster's Active Filter Cookbook
a well-used copy of Don Lancaster’s Active Filter Cookbook

I have Don Lancaster’s Active Filter Cookbook from 1979 and he cites the filter he used if fig 7.15. It contains some bizarre values like 56nF, I’ve never seen a 56nF capacitor in Europe, we go either 47n or 68n.

Lancaster's mid-frequency example, with some rum oddball values for the resistors and capacitors
Lancaster’s mid-frequency example, with some rum oddball values for the resistors and capacitors

However this isn’t a challenging application, so I scaled his filters to use more common values – the simulated frequency response is

LTSpice simulation
LTSpice simulation

The schematic is simple enough. In past sound to light units I had used simple low-pass and high-pass filters for the red and green channels, however I had spotted that the HF channel in particular tended to go off excessively. At the low end we don’t have turntable rumble to contend with any more, but due to the way the ear’s sensitivity falls with low frequencies and the fact I have no subwoofer on the PA losing ultra low frequency sensitivity is no bad thing. I used a quad opamp to buffer the input signal via a master gain control and then three linear pots into the remaining three opamps to buffer the pots and give a low impedance source into the filters as opposed ot having the pot position (and hence resistance) vary the filter shape.

filter bank schematic
filter bank schematic

500Hz is a nice breakpoint to shift from analogue to digital

After the envelope detecotrs  variations in the peak detected signal are slow enough to hand off to the microcontroller using three A/D channels. The LF channel is also about right to feed a bass beat detector, which is an attractive thing to do digitally because of the lower frequencies – analogue active filters get unwieldy below about 50Hz, and I can use ideas like this easily, sampling at a much lower rate to my Arduino has time to do other stuff.

Analogue design is a lot faster than coding for me

I am reasonably experienced with both, but analogue design speed beats coding hands down in this simple application. I had the active filter designed and constructed on Veroboard in half a day, but I also need this project in service in a few days. So although I could break out the Arduino or a PIC I was so close to getting an output without any coding. I used a sawtooth ramp, sliced with the rectified output of the filters. In practice the display looks better if low signals don’t cause any light output, so I put 0.6V of lift on the sawtooth to give a 1.2V dead band since the signal also has to overcome the 0.6V forward drop of the rectifier diodes. So I now have a proportional control sound to light suited to 12V running.

the rectifier-slicer. One oscillator and ramp generator serves three rectifier-slicers - the bottom part ofthe circuit is replicated for each channel
the rectifier-slicer. One oscillator and ramp generator serves three rectifier-slicers – the bottom part of the circuit is replicated for each channel. A common anode lighting rig is used

It worked well – one thing I discovered is much of the effect of a sound to light is from the physical displacement of the lamps, as the different colours, so it works better with clusters of coloured 3W LEDs on a bar rather than one of those Chinese RGB light strips. Conversely the light strips work well for a colour chaser, better than discrete LED lamps IMO.

Pretty much all RGB LED lamps and strips I have come across are common anode switched against ground so I could use NMOSFETs to ground. I used 1W star LEDs in series with 12Ω ballast resistors for the main display – three each for green and blue and four red due to their lower Vf. I would say 3W of LEDs is not enough – these things are dirt cheap from China via Ebay so I may get about 30 of each colour to pump it up a bit.

Leave a Reply

Your email address will not be published. Required fields are marked *