Vary LED brightness based on sound level

Renlid

Joined Jun 11, 2021
5
Hi there!

New here, wondering about some stuff for fun projects at home (my electronics classes go back 18 years ago, please forgive me if I am not very proficient).

A friend of mine made a home-project: playing a sound on his computer, and a microphone detects the sound, and generates a current to light up a LED (he made a "lightning cloud", with blue light inside a white fluffy thingy while the computer is playing thunder sounds).

I suggested him to light the "sky" just a bit when there is no thunder, instead of being either all black/dark/night or all lit up. He loved the idea, but he thought he had to use an arduino.

Question: is it possible to extend his current project so that the LEDs emit a dim light when there is no thunder? I thought of maybe using an OR gate (with two input: the basic resistor allowing a dim light, and the microphone allowing a bright light if sound)? Or maybe something like a "digital potentiometer" commanded by the signal sent by the microphone?

Do you reckon he can do this without an arduino, to keep it as simple as possible?

Sorry if I am noob, I have not touched electronics for ages...

Thank you all

Wolframore

Joined Jan 21, 2019
2,483
There are a number of ways to achieve this, you can also use a transistor in the active region to vary the current based on the strength of the signal.

MisterBill2

Joined Jan 23, 2018
10,510
The simple way to light the sky just a little bit will be to use a suitably colored LED and a series resistor to limit the current. It can use the same power supply as the "lightning" circuit because it will only draw a very few milliamps. But since we do not know the available supply voltage or the specific LED type I can not advise on the exact resistor value.

Renlid

Joined Jun 11, 2021
5
@Wolframore is it identical to using a "digital potentiometer"? The simpler the solution the better

@MisterBill2 I am not looking for specific values but rather a "schema/idea" of a suitable solution, keeping the system as simple as possible I would prefer to avoid duplicating the LEDs (i.e. having two circuits like you seem to advice) as it would double the components (or at least I think so)

KeithWalker

Joined Jul 10, 2017
2,094
It can and has been done for many years without an Arduino. Look "light organ" up on the internet.

ElectricSpidey

Joined Dec 2, 2017
2,018
If the output to the LED is a BJT collector or a MOSFET drain and not a push pull output, you can simply place a resistor across the transistor to provide a second current path.

I have done this in many projects to provide a minimum current thru an LED.

You can also bypass the transistor with another transistor, if you want it to be variable.

MisterBill2

Joined Jan 23, 2018
10,510
If the circuit for the existing system can be shown, it should only take adding one additional resistor to provide a faint glow until the lightning flash signal.
Otherwise, one more LED and one single resistor, in series, across whatever power source is presently being used. I can't get it simpler than that.

Tonyr1084

Joined Sep 24, 2015
6,607
I used to drive an LED directly from the audio output of a small transistor radio. With amplitude of signal the LED would change in intensity. Then, quite by accident, a friend of mine moved the LED while operating. We then realized that the LED was not only reacting to the amplitude, it was also reacting to the frequency. So we started building these things that spun an LED in a circle while powered from the radio. Not only did we get the amplitude effect, we also got the frequency effect. I've equated that to the Z axis. When we started connecting to audio equipment with higher power we started adding resistance.

Try it. Connect a cheap LED to the audio output from a radio. Play some music or tune into a talk show station and you'll clearly see the amplitude thing.

We later went on to incorporate divider networks to sort out the high's from the mid's and low's. And since it was stereo - we doubled the circuit; one for the left channel and one for the right.

MisterBill2

Joined Jan 23, 2018
10,510
I used to drive an LED directly from the audio output of a small transistor radio. With amplitude of signal the LED would change in intensity. Then, quite by accident, a friend of mine moved the LED while operating. We then realized that the LED was not only reacting to the amplitude, it was also reacting to the frequency. So we started building these things that spun an LED in a circle while powered from the radio. Not only did we get the amplitude effect, we also got the frequency effect. I've equated that to the Z axis. When we started connecting to audio equipment with higher power we started adding resistance.

Try it. Connect a cheap LED to the audio output from a radio. Play some music or tune into a talk show station and you'll clearly see the amplitude thing.

We later went on to incorporate divider networks to sort out the high's from the mid's and low's. And since it was stereo - we doubled the circuit; one for the left channel and one for the right.
In post #4 the TS wants something "as simple as possible." Adding one resistor meets that requirement, I hope.
Your creation seems interesting indeed. Back in 1963 I made an audio scope from an older TV that used a separate CRT high voltage supply. Simple audio amps feeding hoz and vert deflection coils. And the beam a bit out of focus to make a bigger spot. It was entertaining, not useful. I also added a neon relaxation oscillator to provide a sort of linear sweep. That was cool also.

Renlid

Joined Jun 11, 2021
5
Hello everyone, thank you all for your kind replies , even if I did not perfectly understood everything

Have a look in this unlikely titled thread and my circuit in post #14.
@Ian0 I read the entire thread, but your circuit looks complicated to me. I'm surprized there can't be something simpler to handle this? See below what I have in mind (beware it is not realistic at all, it is just to picture what I have in mind)

Look "light organ" up on the internet.
@KeithWalker I think the color organ (already mentionned by some people in the thread suggested by iano) is clearly overkill , although I do understand that it might somewhat resemble what I am looking for. I fear that separating the sound frequences will add much complexity to a circuit I'll not be able to grasp, let alone to only extract the "dimmable light" part. At least I think so.

If the output to the LED is a BJT collector or a MOSFET drain and not a push pull output [...]
@ElectricSpidey hahaha sorry that was Chinese to me! I did not understand half of what you said. Please see below a circuit that represents an abstract construct (nice oxymoron!) of what I have in mind.

If the circuit for the existing system can be shown [...]
@MisterBill2 I have asked my friend to provide a circuit of what he already has. I'll post it here when I obtain it. Until then you can have a look below at a naïve idea of what I have in mind

Connect a cheap LED to the audio output from a radio. Play some music or tune into a talk show station and you'll clearly see the amplitude thing.
@Tonyr1084 thank you for the nice idea of having a lighting effect representing the frequency! I myself am not fiddling with electronics atm though. I even bought all the stuff to build a couple Game Boy Zero, and also stuff to build air purifiers, but I don't have the time to do any of it...

In post #4 the TS wants something "as simple as possible." Adding one resistor meets that requirement, I hope. [...] That was cool also.
@MisterBill2 I'm not quite sure of how to add that second resistor , and how I could make it so that the total resistor depends on whether the mic is detecting sound or not

Everyone, please forgive my noobiness, but here is a naïve representation of what I had in mind:

If no sound: the microphone moves the digital potentiometer to a high value, allowing just enough current to pass through so that the LED(s) emit a weak light

If sound: the microphone moves the digital potentiometer to enough resistor so that the current is 20mA (or anything else suitable for the LED(s)), which means the LED(s) will emit a bright light at full intensity.

Please do not hesitate to tell me what's wrong with this schematics. My classes go back to 1999-2003 before I moved on to computer programming, so you can quiiiiite safely assume that I forgot everything

EDIT: all my nice smileys disappeared, is the database encoded in utf8mb4, or is it that they are not allowed? (even though constructing them using punctuation seems to work, e.g. )

Ian0

Joined Aug 7, 2020
4,102
I read the entire thread, but your circuit looks complicated to me. I'm surprized there can't be something simpler to handle this? See below what I have in mind (beware it is not realistic at all, it is just to picture what I have in mind)
Plenty of simpler circuits which don't have an auto-level. i.e. if you don't mind having to adjust something every time the level of the music changes

Tonyr1084

Joined Sep 24, 2015
6,607
This is NOT the complete circuit, but this is basically what you're looking for. Instead of a pot (digital or otherwise) you'll need an amplifier. I'm showing a simple transistor, which will take small currents and apply the higher source voltage to increase current. The resistor mentioned is to prevent the LED from seeing too much current. So you'll need to specify a starting voltage and then determine the final output of the microphone to see IF it provides enough current to turn the transistor on. The transistor will drop the voltage by (typically but not specifically) 0.7 volts. If the microphone does not exceed that then you'll need to build an amplifier stage to get the transistor to switch. MY schooling was back in the 70's. MOSFET's might be a better choice but then they get connected in a different way. If "MOSFET" is "Chinese" to you, it's an acronym for Metal Oxide Silicon Field Effect Transistor. It's not a transistor per se'. Yet, it does the same job. However, it depends on voltages and not currents. Little different approach. @Audioguru again is the genius you seek on this subject.

Last edited:

Ian0

Joined Aug 7, 2020
4,102
Metal Oxide Silicone Field Effect Transistor
Metal Oxide Semiconductor Field Effect Transistor (with apologies for the pedantry!)

Tonyr1084

Joined Sep 24, 2015
6,607
Semiconductor? Sorry. I learned it to be silicon. Perhaps I'm wrong, but I think I learned CMOS as Complementary Metal Oxide Silicone. Perhaps the two are not the same. But I'm "Old" old school. Transistors are a wonder to me.

Tonyr1084

Joined Sep 24, 2015
6,607

Ian0

Joined Aug 7, 2020
4,102
Otherwise, a Gallium Nitride MOSFET would't make sense! (But definitely not Silicone because that's furniture polish)

Tonyr1084

Joined Sep 24, 2015
6,607
Silicone - Silicon - looks like spell check struck again. Have edited previous Spell Check debacle's.

Ian0

Joined Aug 7, 2020
4,102
Silicone - Silicon - looks like spell check struck again. Have edited previous Spell Check debacle's.
In the early days of spellcheck, I had one that like to change "Allen key" to "alien key".

Tonyr1084

Joined Sep 24, 2015
6,607
Think it was on the jokes thread someone posted a joke about a neighbor confessing to using the guy's wife when he was not home. The guy got angry at his wife - don't remember the exact circumstances, but then the neighbor came back and said "I meant WIFI."