Vary LED brightness based on sound level

Thread Starter

Renlid

Joined Jun 11, 2021
5
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
@Ian0 it is just for a home project, the exact same thunder sounds will be played each time, we just need to show a dim light when no sound, and a bright light when sound (current schematics will be provided as soon as I receive them).

So in your opinion there is no way to have a simpler circuit (based on the one I provided, for example), that would not need a manual intervention?

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. 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.
@Tonyr1084 thank you for the explanation and example! Still, the way I understand transistors (please correct me) is that if the base is not powered, then the current does not flow (which means zero light); whereas if the base receives enough power, the current can flow (which means full light). In other terms: it seems to be a simple on/off switch, right? If so, how could this provide a small current when the microphone does not detect (enough) sound, if no current flows through?

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.
You can safely consider that everything is [insert difficult language here] to me :) I did some reading earlier today and saw "mosfet" but they said it was mainly used for storing data (which would not help me much).
 

bertus

Joined Apr 5, 2008
21,764
Hello,

You might want to try the following circuit for a sound to light conversion:
sound_to_light_with_envelope_detector_small.png
For driving leds, a single mosfet will do.
You will need to add the current limiting resistor for the led too.

Bertus
 

Ian0

Joined Aug 7, 2020
4,122
Hello,

You might want to try the following circuit for a sound to light conversion:
View attachment 241175
For driving leds, a single mosfet will do.
You will need to add the current limiting resistor for the led too.

Bertus
He complained that my circuit had too many parts in it, and mine has autolevel and yours doesn't.Untitled 1.png

Your schmitt trigger doesn't have any hyestersis! R22 should be about ten times R24.
 

ElectricSpidey

Joined Dec 2, 2017
2,027
I'm confused...I thought the sound activated section of the TS's project was already built, and only needed a small modification to keep the LED dimly lit when there was no thunder.
 

Ian0

Joined Aug 7, 2020
4,122
Here's my circuit with a few adaption. Optically isolated input - handy to avoid hum loops but rather limits the range of the auto-level. Reversed polarity, so it can drive a big MOSFET to switch lots of LEDs.
And R17/R18 bleed resistors to keep the LEDs lit to a low level when there is no sound.Untitled 1.png
 

MisterBill2

Joined Jan 23, 2018
10,551
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 :) :)
The original request was to "illuminate the sky a bit." That would be simple enough to do by adding a single LED and a resistor to provide a bit of light. But then we have this:

"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 rather doubt that a microphone would generate enough current to light an LED. So that circuit must be a bit more complex, and include at least one active device. The circuit in post #11 is a functional block diagram, it can not work as a circuit.

But now, given that the part that lights the existing blue LED at the sound of thunder already exists and apparently is satisfactory, the addition of a dimly lit white LED so that the sky is not dark the rest of the time is all that is required .

"Feature Bloat" is a terrible happening that ruins nany consumer products and expands a lot of software into a user-hostile chunk of junk. Why keep proposing sound driven circuits when that part is already working????
 

Tonyr1084

Joined Sep 24, 2015
6,612
@Tonyr1084 thank you for the explanation and example! Still, the way I understand transistors (please correct me) is that if the base is not powered, then the current does not flow (which means zero light); whereas if the base receives enough power, the current can flow (which means full light). In other terms: it seems to be a simple on/off switch, right? If so, how could this provide a small current when the microphone does not detect (enough) sound, if no current flows through?
Just to clarify - a transistor can be used as a switch. Saturate the base and the transistor goes into full conduction. But operate it less than saturation and it becomes a dimmer (in your case). However, a simple microphone does not generate enough current (transistors work on current) to bring the transistor above its "Bias" voltage. So you would have to provide additional circuitry to bias the transistor to around 0.7V (depending on the specific transistor used). THEN the minute voltages generated by a simple microphone will turn the transistor on at various levels depending on the voltage produced by the microphone. Yes, I said voltage. But you can't have current without a voltage to begin with. So the base and bias acts as a current draw for the microphone (and I'm CLEARLY not the expert on this) and activates the transistor to work in a linear fashion. But if that's still not enough to light the LED then you'd need a second stage transistor to boost that voltage (yes, I said voltage again) to light the LED in a linear fashion. Certainly not an elegant solution, but one that will function for what you're asking for.

MOSFET's are Voltage switched devices. They can act like a switch or behave in a linear fashion as well. Transistors can typically switch faster than MOSFET's can. So low rumbling sounds will likely work well with either BJT's or MOSFET's.

Ian0's circuits show two possibilities, the top circuit uses BJT's. The lower circuit uses both BJT's and MOSFET's. But something I am missing in Ian0's diagram is the microphone. ANOTHER key piece of information missing is what kind of microphone are you (going to use or) using? Electret's are different from traditional diaphragm mic's.
 

AnalogKid

Joined Aug 1, 2013
9,631
Question: is it possible to extend his current project so that the LEDs emit a dim light when there is no thunder?
Yes.

Please post your friend's schematic. Simply put, this might be as simple as simply adding one simple resistor. Paraphrasing Rear Admiral Joshua Painter,

"Engineers don't take a dump, son, without a schematic."


ak
 

MisterBill2

Joined Jan 23, 2018
10,551
I think that I also suggested that single resistor option quite a while back. But it seems that most want to tell them how to do what has already been done. So please do not ridicule all engineers.
 

Thread Starter

Renlid

Joined Jun 11, 2021
5
Hello everyone!

Sorry for my absence, a bit in a rush these days (moving to another country and all)

I got an answer from my friend, and please don't get mad, please please please, as I am really really ashamed... My friend told me that he was in fact using a pre-made device that he bought online, with led strips and everything (I don't understand why he was so proud to show it to us, then....)

Here is the link FWIW (sorry it's in French) https://www.amazon.fr/dp/B08CB7212S

I am so really sorry, I genuinely thought he made it from scratch, and I was so excited to put it to the next level! That's why I could not understand why he wasn't able to send me a schema of his circuit...

I am still hesitating to post this reply, fearing the (well deserved) wrath of all of you, but I have to give you that information.

That being said, I still would like to get to the bottom of it. I think my friend would like the challenge, and so would I!

Do you reckon he could salvage the LED strip and the microphone, even maybe the power source, and just replace the "brains" with something fully home-made? Or would it be better to go entirely from scratch so that he could do some comparing with the pre-made box?

I did 6 years of electronics (wow, that seems a lot!) but it goes way back, and I have almost no memory of it (maybe I have a small brain and everything got quickly replaced by web dev because there was not enough space for both ^^).

Regarding @Ian0 's circuit, @Tonyr1084 you seem to think there is one part missing? If the symbol I used in my example circuit to represent a microphone is correct, then I did not see it in Ian0's schematics.

I have questions (noob questions of course):
- Is the optocoupler really necessary? Can't we just put a DC battery, nothing more? @Ian0 I understand why you may want to suggest a state-of-the-art schematics, but would I be able to strip some parts to "KISS"? ==> is the "ground loop" issue that bad?
- I assume "LED1" represents all the LEDs that are going to be lit? (e.g. the LED strip) I also assume that the resistors would need to be picked accordingly with respect to the amount of LEDs used?
- How does the microphone fit in either circuit?
- @bertus and @Tonyr1084 , you seem to think that a mosfet would be a better fit. Would a BJT be that bad? It seems to draw more current, but I also read somewhere that it might be better when the load is known in advance (but the article also said that on battery-powered circuits it was a bad idea... so confusing ^^)
- Do you all understand (and "simulate" in your mind) how a circuit works just by looking at the schematics? Isn't a regular physical testing needed?
- Would it be too much if I asked what all the components are used for, in ian0's circuit? It seems rather complicated (maybe not to you all, but at least to me), compared to what I had in mind at first. I thought it would be way easier than that, I am beginning to fear it would require mass knowledge in order to know what I would be doing (I don't like to do something without understanding it, sorry for asking...)

To answer @MisterBill2 , yes there is indeed a power source :) The idea would be to build an autonomous system, which would require something like... a 6LR61 battery maybe? I think so!

Again, I am really sorry that I got confused about what my friend did at home. However it does not change the goal of my request. It's just that, actually, providing a complete circuit was not a bad idea that you all had! It will just require more understanding from my part...

Thank you all again for everything!
 

MisterBill2

Joined Jan 23, 2018
10,551
Certainly no wrath from me! The function is simple enough to duplicate, the challenge would be making the system small. It seems that there are both simple and complex ways of making the same thing happen. The hard part would be creating instructions that would noy be a snow storm getting you lost.
 
Top