Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC Modifying a sound controlled light

Status
Not open for further replies.

bitem2k

New Member
I have got this light box with 6 lights in it. The lights come on in response to music (loudness?). In the middle of the device, there are 3 variable resistor knobs; each knob controls the sensitivity of a pair of lights.

It is my understanding that these resistors set how high the mic input level needs to be before turning on the appropriate pair of lights.

The resistors ideally need to be adjusted for each music track, because one track might be louder than another.

In my opinion, this light box is just gagging to loose the variable resistors and have a microcontroller ‘brain’.

Could someone please advise the best way of going about this?

My first idea of how to implement this (without thinking about hardware considerations;)) is as follows:

Assign each of the pairs of lights a port.
Poll mic level continuously


Have a variable to store the highest input level encountered so far (TempHighest Level).

Have another variable to store the last measured Highest input (i.e. HighestLevel).

Every x seconds, move the TempHighest variable into HighestLevel variable, and start measuring again, storing the new measurements in the TempHighest variable.


Don’t flash lights for x seconds when first turned on, just measure the highest level and store in TempHighest.

Assign each pair of lights a percentage of the HighestLevel variable, at which to turn on.

When mic level reaches each pairs specified percentage level, turn pair on.



I’m guessing I should use the comparator, but id like to know if the above is possible before I start coding.

Does anyone have any thoughts on the matter?

Many thanks:)
 
You usually have double AGC (automatic gain control) on such units. The first level is on the input signal, to give a consistant level to drive the unit. It's then filtered three ways, low, mid and high. Then each individual channel has it's own AGC - this ensures maximum usage of each channel.

What you're describing is a kind of software AGC.
 
I don't see how a microcontroller will help in this case.

These units normally have three filters, one for treble mid-range and base and the firing point in the TRIAC's cycle is varier depending on the volume of the music. As Nigel has said the AGC takes control of the volume so there isn't normally a need to adjust it.

I've seen one of these units working at a party and it seemed to work well regardless of the music volume or base trebble and mid-range content. Therefore I have reason to believe that this unit might have even had separate AGCs for treble mid-range and bass.

I suppose the only reason why I would consider a micro-controller was if I wanted to program it to flash the lights in a particular sequence.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top