EveryCircuit
Contact
Reviews
Home
anglerfish27
modified 3 years ago

Raspberry Pico 2N222 NPN BJT LED Example.

0
2
187
02:00:30
Raspberry Pico 2N22A2 NPN BJT LED Example. Where the Base is really just a GPIO pin set high (1) which passes 3.3V to the base. This is to allow lighting an LED to approximately 20mA with only using .4mA from the GPIO line. Individual GPIO lines on the Pico are recommended not to exceed 12mA. The voltage source on the collector is the "true" 3.3out connected to + on your breadboard power rail most likely. Assumes a 1.6 forward voltage drop on the LED. You can try to fine tune using different resistor values and LED's with different voltage drops. Of course like all NPNs values are never exact due to heat ect... Most 20mA LED achieve no noticeable difference in brightness from 16mA to 20 mA.
published 3 years ago
Grunt21
3 years ago
Explain your circuit
anglerfish27
3 years ago
This is how to pull a full 20mA from a Raspberry Pico Microcontroller using one of its GPIO lines (which shouldn't go above 12mA ideally). Its based off using an NPN 2N222A BJT Transistor. If you don't have a pico I suppose you could just do the same with any voltage source to get the current increase you need. In my case the gain or "beta" or hfe (terms are intermixed depending on the datasheet) for my BJT was anywhere from 30 to 300. I settled on 50 as my hfe (gain). That is how I ended getting .4mA going into the base. (here its in microamps at 371 = approx .4mA). I took what I knew 20mA for the LED and hfe 50 and divided the two giving .4mA then I used ohms law to find an appropriate resister in this case 6.7Kohm to get me to my desired current (.4ma) the pico GPIO lines when "high" aka digital logic 1 or "on" provide 3.3 Volts. Since this program doesnt have a Pico I just used a voltage source to represent one of the GPIO pins. GPIO is set to output and set to "1".

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy