Using transistor to switch leds on/off

In summary, to increase the voltage across the LED, you may need to add a current-limiting resistor and analyze the circuit to ensure the BJT is saturating. To vary the LED intensity with the input voltage, you can use a non-inverting op-amp amplifier or a non-inverting type to sink LED current. Make sure to use a current-limiting resistor for the LED and experiment with different gain ratios. The op-amp may not be able to source enough current to turn on the LED, so check the output with a 1k resistor connected to ground. The HA11741 should suffice as a general purpose op-amp.
  • #1
nyxynyx
35
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: 634
Last edited:
Engineering news on Phys.org
  • #2
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!
 
  • #3
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?
 
  • #4
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.
 

1. What is a transistor?

A transistor is a semiconductor device that can amplify or switch electronic signals. It is a fundamental building block of modern electronic devices.

2. How does a transistor switch LEDs on and off?

Transistors can be used as electronic switches by controlling the flow of current through them. In the case of LEDs, a small current applied to the transistor's base terminal can control a larger current flowing through the LED, turning it on or off.

3. What type of transistor is best for switching LEDs?

Generally, NPN transistors are used for switching LEDs as they can handle higher currents and are easier to control. However, PNP transistors can also be used with the correct circuit configuration.

4. What is the difference between a transistor switch and a mechanical switch?

A transistor switch uses electronic signals to turn on or off, while a mechanical switch physically opens or closes a circuit. Transistor switches are faster, more reliable, and have a longer lifespan compared to mechanical switches.

5. Can I use a single transistor to switch multiple LEDs?

Yes, you can use a single transistor to switch multiple LEDs by connecting them in parallel. However, you may need to use a transistor with a higher current rating to handle the combined current of all the LEDs.

Similar threads

Replies
15
Views
832
  • Electrical Engineering
Replies
5
Views
2K
Replies
42
Views
2K
Replies
2
Views
1K
  • Electrical Engineering
Replies
27
Views
4K
Replies
4
Views
2K
Replies
18
Views
8K
Replies
2
Views
2K
Replies
21
Views
2K
  • Electrical Engineering
Replies
18
Views
2K
Back
Top