I am trying to learn a simple LED circuit here.
First, I am trying to light the LED with 3V and 20mA. Based on what I've learned, R1 should be 100ohm. (5-3)/0.02 = 100ohm.
simulate this circuit – Schematic created using CircuitLab
I think I get it right so far (I hope.)
Now I am trying to turn on/off the LED using a 2N2222A NPN transistor:
I looked it up online and find most people referring to the hFE as 100, therefore I plug in the 100 to the current gain formula hFE=Ice/Ibe => Ibe = 0.02/100 = 0.0002A. I then use the Ohm's law again to get the value of R2 for the transistor based on the Ibe I found early. (5-0.7)/0.0002 = 21500ohm => 22kOhm.
I am able to light up the LED but can an expert here validate if I am doing it correctly. In addition, can someone clarify below confusions for me?
- I am not sure if I am using the correct current gain (hFE) value for the Ibe.
- Am I using the correct formula hFE=Ice/Ibe to calculate the resistor R2 for the transistor base?