Sound To Light Converter

ChedderCheeser

Senior Member
Hi all. I am trying to use the picaxe to convert sound to light... I know I could just use a transistor, but it never works for me... :/ Anyway... How can I read the sound into the picaxe and tell whether the VOL?UME is HIGH, LOW, or MEDIUM? I have an rbg led and want RED to be HIGH, BLUE to be MEDIUM, and GREEN to be LOW. I am using a Picaxe 08M. THANKS!!!
 

vttom

Senior Member
A technique that's worked well for me is to take a bunch of ADC readings of the analog signal with the readadc command, keeping track of the maximum and minimum values. The amplitude (for an audio signal, this equates to the volume, or loudness) is the difference between the maximum and minimum.

The program to do this would simply be 2 loops (1 nested inside the other). The inner loop would do the above mentioned sampling and min/max tracking. The outer loop would use the value of the difference to decide which LED to turn on and then repeat the whole process over again and again.
 

ChedderCheeser

Senior Member
A technique that's worked well for me is to take a bunch of ADC readings of the analog signal with the readadc command, keeping track of the maximum and minimum values. The amplitude (for an audio signal, this equates to the volume, or loudness) is the difference between the maximum and minimum.

The program to do this would simply be 2 loops (1 nested inside the other). The inner loop would do the above mentioned sampling and min/max tracking. The outer loop would use the value of the difference to decide which LED to turn on and then repeat the whole process over again and again.
I hope this isnt asking too much... but could you give me an example of this? I need to learn this language a bit more before I can make code myself... Thanks for the help!
 

obroni

Member
I made a circuit which first filtered out everything above 150hz and then used two RC circuits fed into a comparator. One of the RC circuits has a larger capacitor/resistor so it acts as a moving average. This allows you to detect peaks in the music whether there's complete silence of loud background bass lines.

It then fed into a picaxe which waited for the pulses from the comparator, on each pulse it sent out 4 bytes via a serial bus to change lots of RGB LED's to different colours on each beat.

I don't know how well using the picaxe to detect peaks/averages worked, but the method I used above was very accurate.
 
Rectify the O/P of the microphone (using a diode) and then smooth with a capacitor, finally use that as the I/P to the ADC (in the PICAXE). I don't know whether the signal would be big enough to detect though (If not you might need to use a TRANSISTOR to provide some amplification).

Maplin here in the UK sell project board/kit wich does this very thing (without microprocessor) made in Belgium by Velleman - called Mk115 pocket sound level meter - they have circuit diagram, perhaps you could look at it for ideas ? You should easily be able to find it using the internet.

AB
28.June.2011
 
Top