Using transistor to switch leds on/off

AI Thread Summary
To increase the voltage across the LED in the circuit, ensure the BJT is saturating and consider adding a current-limiting resistor to protect the LED. For controlling the LED's brightness based on audio input, a non-inverting op-amp configuration can be used, but it requires proper gain settings and current sourcing capabilities. If the output remains low, check the LED and the op-amp's ability to provide sufficient current. The HA11741 should work if it's a general-purpose op-amp, but adjustments to the gain and circuit components may be necessary for optimal performance. Proper testing and component checks are essential to avoid damaging the audio source or LED.
nyxynyx
Messages
34
Reaction score
0
I'm currently using this circuit, but without the rectifying portion,a audio source from mp3 player instead of a mic, and a 4V LED instead of a bulb. My power source is 12v. However, the voltage across the LED is only around 1-1.5V. How can i increase the voltage across the LED?

Here is what i want to do. I'm trying to have the LED light up only when the input voltage from audio source is above a certain voltage. When the input is above a certain voltage, the LED lights up fully, and when the input drops below that certain voltage, the LED switches off completely. The LED is either at its maximum brightness, or not emitting any light at all. Hopefully, I can replace the LED with another load and have the voltage across the load to be either 12V or 0V, or either 4V or 0V. How can i achieve this?
 

Attachments

  • 03081.png
    03081.png
    3.7 KB · Views: 688
Last edited:
Engineering news on Phys.org
Howdy nyxynyx,

The (idealized) circuit you posted assumes a few things:
1) Microphone transduction (i.e. current generated) is high enough to saturate the BJT
2) (Given 1) The BJT saturation current is sufficient to turn on the lamp (often in the range of a few hundred mA)
3) The BJT responds fast enough to the signal (probably few hundred Hz to few kHz) that the lamp actually turns on.

With that in mind, to get a higher voltage across the LED, you should analyze your circuit to ensure that the BJT is, in fact, saturating. Since a LED has only a very low on resistance (few ohms), you probably need to introduce a current-limiting resistor to accomplish this (as well as to ensure that your LED doesn't go ZAP). I also think your circuit (incidentally, this is what's called a Common Emitter Amplifier) needs some biasing on the base to function properly and give you decent swing.

As to the second portion of your question, how to vary the LED intensity with the input voltage, well, if you're talking DC voltage, that's pretty easy. If you're talking audio (again, stuff between 20 Hz and 22.1 kHz--unless you're a fan of pure tones) I think you'd be dealing with the RMS voltage. Again, you just need to use an appropriate resistor value to limit the current, and design your amplifier gain such that you don't have a lot of saturation (i.e. it doesn't "go to the max" at a low volume).

The above is written assuming a pretty good electronics background, so, if you don't have a few years of EE (or, better yet, EE tech) education behind you, it might be easier to build something called a non-inverting amplifier based off of a op-amp. Or you could build the non-inverting type and use it to sink LED current. Your life is made much simpler because you don't need the negative rail. This would make a terrible audio amplifier, but a great LED indicator. If you cheap out (and you probably can) and just use a "plain-jane" op-amp (e.g. a LM741) with the negative rail connected to ground, you can probably get something to work:

http://hyperphysics.phy-astr.gsu.edu/Hbase/Electronic/opampvar.html

WARNING: If you use the inverting amplifier, make sure to use a large value of R1 (> 1k) Your fancy MP3 player might not survive having lots of current drawn out of it! IIRC, the non-inverting amplifier presents the Op-Amp resistance to your input (which is usually in the range of a few megaohm). Also, whatever configuration you use, don't forget to use a current-limiting resistor for your LED (otherwise, it'll just turn on-off until such time that it burns out). On that note, I take no responsibility for burnt-out audio equipment if you try this without testing!
 
Can i use the non-inverting opamp design with only 0v and +12v? I did try using 500K pot as R_f and 1K resistor as R_i but the output seem to be quite steady at 0.7V across the LED. Did i do something wrong?

I can't find a LM741 so i used a HA11741. Will this make a difference? What does it mean by frequency compensated?
 
As I say, you might be able to make it work with some experimentation ;-)

Best bet, use a smaller gain ratio (right now, it's 501 try 5 or 10 or 50 or something). If it does work, you'd be causing it to saturate pretty quickly (so on-off operation). The second thing is: do you have a current limiting resistor (e.g. 470 ohm) in series with the LED? If so, you might want to check to see if your LED is blown (see if it'll turn on with the 12V supply and the current limiting resistor). If this is still okay, your op-amp might not be able to source enough current to turn on the LED (you need 10 mA or so)--this you can check by hooking up the '+' terminal to 12V, the '-' terminal to GND, hooking up a 1 kohm resistor to the output (and GND) and seeing if you get 12V at the output (meaning that 12 mA are flowing through the 1k resistor)

By 'frequency compensated', it means that there should be no unpleasant surprises in operation within the spec'd frequency range. It acts predictably with no spurious poles or zeros (which would cause the aforementioned 'unpleasant surprise'):
http://www.st-andrews.ac.uk/~www_pa/Scots_Guide/datasheets/Opamps/741.html

I can't find a datasheet for a HA11741, but if it's a general purpose op-amp, it should suffice.
 
Hey guys. I have a question related to electricity and alternating current. Say an alien fictional society developed electricity, and settled on a standard like 73V AC current at 46 Hz. How would appliances be designed, and what impact would the lower frequency and voltage have on transformers, wiring, TVs, computers, LEDs, motors, and heating, assuming the laws of physics and technology are the same as on Earth?
While I was rolling out a shielded cable, a though came to my mind - what happens to the current flow in the cable if there came a short between the wire and the shield in both ends of the cable? For simplicity, lets assume a 1-wire copper wire wrapped in an aluminum shield. The wire and the shield has the same cross section area. There are insulating material between them, and in both ends there is a short between them. My first thought, the total resistance of the cable would be reduced...
I used to be an HVAC technician. One time I had a service call in which there was no power to the thermostat. The thermostat did not have power because the fuse in the air handler was blown. The fuse in the air handler was blown because there was a low voltage short. The rubber coating on one of the thermostat wires was chewed off by a rodent. The exposed metal in the thermostat wire was touching the metal cabinet of the air handler. This was a low voltage short. This low voltage...
Back
Top