Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on Driving LED with NPN transistor from I/O pin

Post

Driving LED with NPN transistor from I/O pin

+4
−0

I'm trying to understand a circuit for driving a LED found on a board I purchased.

Below is the circuit driven by an I/O pin (HS2) of a small 3.3V processor.

led driver schematic

The HS2 pin is driven by the I/O with these specs:

V(high) = 0.8 · Vsupply = 2.64 V

V(low) = 0.1 · Vsupply = 0.33 V

The I/O pin can be set to drive up to 28 mA, but I am guessing the design of the circuit would rather pull the current from Vsupply rather than the I/O controlling pin (HS2), and that is the reason for using the NPN transistor (S8050) to drive the LED.

The LED is a SMD 3528 white LED for which I do not have specs, but testing shows it lights up nicely at 40 mA, and does fine at 11 mA, with 3.24 V across.

I am wondering if the reason for this design is because this bright white LED is typically looking for a 3 V drop, and if they used a current limiting resistor in series with the LED, then maybe the resistor would drop too much and bring the voltage across the LED to less than 3 V.

How is the 1k/10k voltage divider working to set the current through the flash?

Does this circuit seem like a good one to duplicate if I wanted to create additional LEDs driven by other pins on the processor?

When the transistor is on, is it setting the current, or will the current vary per the gain of the transistor?

I see how this circuit is acting as a switch, but is it also fixing the current through the LED? Or is the current through the LED dependent on the gain of the transistor?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

General comments (4 comments)
General comments

Skipping 3 deleted comments.

Lundin‭ wrote over 4 years ago

Almost all LEDs are specified @ 20mA nominal and you shouldn't give them more than that unless the datasheet says otherwise. As for forward voltage, it depends on if the white LED is a "blue LED in disguise" or a "yellow LED in disguise" - that is, based on different chemistries. "Blue:ish" white LEDs are most common and indeed have too high forward voltage to be reliably driven from 3V3. "Yellow:ish" alternatives exist though, giving a warmer light and slightly less forward voltage.

Andy aka‭ wrote almost 4 years ago

It's either a poor design or it's fine. That debate depends entirely on the LED data sheet for which there is none.

Nick Alexeev‭ wrote almost 4 years ago · edited almost 4 years ago

@eric regarding the R12. If you were using a MOSFET, then indeed you would been a resistor from gate to ground. It would keep the MOSFET gate at a known state when the control signal is disconnected. Current in a BJT base will disappear by itself when the control signal is disconnected. So, the R12 at the BJT base looks redundant.

Elleanor Lopez‭ wrote about 1 year ago

I believe the only circuit I have seen where LED had no series resistance added was with a flat cell battery, which in itself has a high output impedance, and therefore the LED gets to live another day.