Go Down

Topic: Intermittent power from NPN transistor (Read 400 times) previous topic - next topic

nexflatline

I need to deliver a constant 5V to some LEDs (while using PWM to move vibration motors).

For that I use a power supply connected to PN2222 transistors as illustrated in the image attached.

When measuring the voltage with a multimeter, I get a stable 5V output when I turn on the digital pins, and 0 when off. But as soon as I connect the LED, I can't get a stable output anymore, the LED lights intermittently at the same time the multimeter can't get any voltage beyond 2 volts.

I'm sure the power supply I'm using is enough. Also sometimes, after slowly blinking for a while, the led will stay on, but the voltage stabilized at less than 2V.

Have I made a mistake with the circuit?


groundFungus

#1
Jul 12, 2019, 04:21 am Last Edit: Jul 12, 2019, 04:24 am by groundFungus
Where are the  current limit resistors for the LEDs?  Where are the transistor base resistors?  Both are required.  How is the Uno powered?

jremington

#2
Jul 12, 2019, 05:15 am Last Edit: Jul 12, 2019, 05:18 am by jremington
Quote
I need to deliver a constant 5V to some LEDs
Not if they are standard LEDs, that will destroy them.

You need a 220 Ohm current limiting resistor for a red LED and a 1K to 10K Ohm base resistor for each of the transistors.

You may already have damaged one or more of the LEDs, the transistors or the port pins.

nexflatline

Thank you very much for the help. For testing the circuit I skipped the current limiting resistors and was actually using a higher power LED I found lying around. I tested the circuit now with the current limiting resistors and a lower power LED and it seems to be working as intended. Was the previous LED drawing too much current and somehow affecting the transistor performance?

I have also added the 10K base resistor to the transistor, but haven't noticed any difference in voltage or switching precision. Is it really necessary? I found conflicting information about it on this same forum.

MarkT

You exceeded the maximum ratings for every device, Arduino, transistor and LED.  You are lucky anything is still working (and may be somewhat degraded even so).  Perhaps your power source gave out and saved the components from total burn out?
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

wvmarle

Thank you very much for the help. For testing the circuit I skipped the current limiting resistors and was actually using a higher power LED I found lying around.
That's probably what saved you from total disaster: that LED must have current limiting built in (probably in the form of a resistor). Otherwise stuff would have burnt out.

An NPN transistor acts very much like two diodes - this are the BE and BC junctions. if you connect the base to +5V (the pin set to OUTPUT, HIGH) and the emitter to GND you're basically shorting out the pin through the BE junction. Do this for too long and it will burn out. That's why you need a current limiting resistor there. Aim to provide about 1/10-1/20 of the collector current to saturate the transistor.

Quote
I tested the circuit now with the current limiting resistors and a lower power LED and it seems to be working as intended. Was the previous LED drawing too much current and somehow affecting the transistor performance?
More likely it's the output pin of the Arduino that got overloaded and started to misbehave.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

surepic

Nothing much to add but its better to change pn2222 transistor with something more suitable for your circuit with less max collector current.
Pn2222 has 600ma max continuous current flow capability with low current gain at LED currents(~20ma in your case).

MarkT

All (bipolar) switching transistors have low gain, they work in the saturation region where transistor action doesn't apply, and carrier diffusion is the main mode of current flow.  In saturation the base-collector junction is
forward biased and there's no electric field to pull charges from base region to the collector terminal, they have
to randomly find it.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

surepic

I meant using with gain ib=ic*hfe instead of switching. Its just for leds.
Most low collector current(50-150ma) bjts that ive used have good gain so for bunch of leds driving from arduino pins is better. At least i would do like that.

Paul__B

For multiple LEDs, you should start thinking of a TPIC6B595 or another in that series.  Replaces the transistors and base resistors, only three port pins to operate.

Go Up