simple transistor switch problem

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hello!

i have a simple question. i need a led as an indicator that power is connected to ULN2003A. the power supply varies, +5V, +12,... and max is +24V. can i use a transistor for that? please help me pick something that is common and generally available. the only task it has to do is switch on a led that has a separate power supply of +5V.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use a diode to clamp the input to +5V, and include a series resistor in the base connection.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks leon_heller but i'm a total newbie. the actual question is which transistor can i use for this circuit?

the entire board is on +5V supply. the led should turn on when i attach a seperate supply on ULN2003(JP1). VCC1 varies depending on the motor i want to attach to ULN2003. it can be from 5V to 24V. you meant i should use VCC1 regulated using a zener diode instead of +5V on the transistor input (is this the same as collector)?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would suggest using a PNP transistor rather than the NPN you have shown. With the NPN the LED current will vary with base current/voltage. Using a PNP put LED1 and R1 between the +5v and Q1-emitter and connect Q1-collector to ground. Any common PNP transistor will work (e.g. 2N3905). R1 = 200 for approx 15ma LED current, R2 = 4.7K for approx 1ma base current at VCC1 = 5V.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd highly recommend taking a close look at this:

http://www.allaboutcircuits.com/vol_3/chpt_2/8.html

And perhaps a slightly more cursory look at the whole chapter:

http://www.allaboutcircuits.com/vol_3/chpt_2/index.html

Transistors are not simply switches. There is a lot of reading on those two pages, but it will give you a much better idea how transistors actually work, which should give you some insight into this circuit.

Michael

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Leon's ideia is just to clamp the voltage on the Zenner on the base of the transistor.

How you said that you just want to indicate that there is power, you could just use a Zenner with a series resistor to the LED.
Supose:
Vmax = 24V
LED current = 20mA
P = 24V x 20mA = 0,48W

Use a Zenner to clamp on 5.1V and 0.5W Zenner diode.
But on this schem you dissipate power on Zenner.

Brunomusw

Regards,

Bruno Muswieck

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

if power is dissipatet on the zenner, won't it get hot? i guess it would work well for the selected case, but what if vcc1 is 5V? as far as i know a zener should be used with a resistor and supply voltage must be higher than the output. how about this for the regulation and i drop +5v and the transistor completely because i need it only for the led and it was a stupid idea anyway: http://www.reuk.co.uk/Zener-Diode-Voltage-Regulator.htm

For the case Vin = Vmax = 24V
Vmax = 24V
Imax = 22mA (20mA+10%)
Vout = 3.6V
Zener diode power rating: 79 mW (Z 3.6V, 0.4W)
Resistor value: 927 Ohms, Resistor power rating: 449 mW, (1K, 0.5W metal)

and then i connect the led in series with a 82 Ohm resistor to the ground. can that work?
will the led work if Vin is 5 or 12V?
i don't care if the led isn't as bright as in the 24V case.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I actually meant an ordinary diode 5V clamp, not a zener.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why can't the led work directly from the 5-24V voltage?
Put a large enough resistor there, so it won't blow at 24V and would still light up at 5V.

At least you can't put 24V on transistor base when you have resistor and led on the emitter and 5V on collector - in essence the transistor is then a diode from 24V to resistor and led, and would smoke up if base voltage is too much compared to collector.

Another solution is to build a constant current source for the led from 24V somehow. No 5V needed there, but it may help.

Or you could just ground the emitter, put a led from 5V via resistor (470 ohm?) to collector, and drive base via big resistor like 10kohm from 5-24V. You may need to put 100kohm from base to ground too, so it keeps the base from floating if there is no 5-24V.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
For the case Vin = Vmax = 24V
Vmax = 24V
Imax = 22mA (20mA+10%)
Vout = 3.6V
Zener diode power rating: 79 mW (Z 3.6V, 0.4W)
Resistor value: 927 Ohms, Resistor power rating: 449 mW, (1K, 0.5W metal)

and then i connect the led in series with a 82 Ohm resistor to the ground. can that work?
will the led work if Vin is 5 or 12V?
i don't care if the led isn't as bright as in the 24V case.


Yes will work.
Actually you don't need the 82Ohm resistor, because you already put the a resistor before the zenner. Using the resistor before zenner will protect zenner and the led.

If the voltage is 5V the led will be bright as 24V because the zenner will not clamp on 5V.

Quote:
Or you could just ground the emitter, put a led from 5V via resistor (470 ohm?) to collector, and drive base via big resistor like 10kohm from 5-24V. You may need to put 100kohm from base to ground too, so it keeps the base from floating if there is no 5-24V.

This is other option.

Now it's up to you decide what is best... :wink:

Brunomusw

Regards,

Bruno Muswieck

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thanks to all! i'l buy some leds, resistors and diodes and try it out tomorrow. the simplest solution comes first. i'l try tke led with a resistor for 24v. if it isn't bright enough at 5v i'l try the zener.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

why not run this in common emitter mode instead?

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Personally, I'd try a constant current solution for this. You may want to check
http://www.4qdtec.com/csm.html
for more information.

Andreas