MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › Driving LEDs with a transistor and choosing the resistor
HomeModels
Table of contents

On this page

Electrical & Electronic Basics (600 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

Driving LEDs with a transistor and choosing the resistor

When several LEDs must light at once the IO pin runs out of current, so a transistor expands the drive. This page shows how to calculate the LED current-limiting resistor and where to place it in a transistor driver.

1. How it works

An LED is a current device with a forward drop of about 1.8 to 3.2V and brightness set by current. Without a series resistor the current runs away and the LED dies. The limit resistor is R equals V_CC minus U_F over I. Indicators use 5 to 15mA, bright types up to 20mA. In a transistor driver the resistor still sits in the LED branch and limits LED current, not base current.

2. Numbers and practice

For an NPN driving one LED, put the LED and its resistor in the collector to V_CC, emitter to ground, base through R_B to the IO. At 5V with a 2.0V red LED and 10mA target, R is 300ohm, use 330. R_B follows I_C over beta; at beta 100, I_B is 0.1mA so R_B about 43kohm, use 22kohm for margin. Parallel LEDs each need their own resistor, never one shared.

3. Pitfalls and fixes

Brightness rises with current but from 10mA to 20mA the gain is small while heat doubles. Five to eight milliamps is enough for an indicator. A common fault is sharing one resistor across LEDs whose forward drops differ, so the lowest drop one hogs current and fails first.

4. LED drive resistor quick reference

LED colourU_FResistor at 5V 10mA
Red1.8 to 2.0 V330 ohm
Yellow2.0 to 2.2 V300 ohm
Green2.0 to 2.4 V270 ohm
Blue3.0 to 3.4 V180 ohm
White3.0 to 3.4 V180 ohm
Current5 to 20 mAover 20mA shortens life

5. Notes

LED driving fits panel indicators, status lights and segment drives. Confirm the colour and rated current, pick the standard resistor, and give each LED its own limiter. Blue and white have high drop, so at 5V the margin is thin and a 12V bus with local drop is better.

6. References

The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Device application and symbols per GB/T 4728; safety IEC 60204-1. Always check the device datasheet and the product design file for ratings and derating.

7. Cautions

⚠️ Three common pitfalls:
① Share one resistor across LEDs: the lowest drop one hogs current and fails
② Use R_B as the LED limiter: LED current is capped by base current and stays dark
③ Size white LED like red: too little headroom overheats it

Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL