Pages: [1] 2   Go Down
 Author Topic: A couple of questions on the 2N2222 transistor  (Read 991 times) 0 Members and 1 Guest are viewing this topic.
Offline
Newbie
Karma: 0
Posts: 7
 « on: February 09, 2013, 04:52:42 am » Bigger Smaller Reset

Hi, this is my first post!

I recently started in the world of electronics and i am trying to make myself comfortable with various parts before starting to build real projects.

If this image is taken as a basis, i am struggling to calculate the correct values for R1 and R2:

As with the image, the voltage across the collector is 5V and the current through the Led should be 20mA. The datasheet states that the Collector-Emitter saturation voltage is 0.3V when the current at the collector is 150mA and 1V for a current of 500mA so i assume that for 20mA is even less than 0.3V?

Then if i understand right R1 = (5-0.3)/0.02 = 235 Ohm ?

For the base i am completely lost. The datasheet states that the Base-Emitter saturation voltage is 1.2V when the current at the collector is 150mA but what about a current of 20mA at the collector? Furthermore, the DC Current Gain is 75 for Vce = 10V, Ic = 10mA and 100 for Vce = 10V, Ic = 150mA, but i have a Vce of 5V and a Ic of 20mA. What is the correct gain so that i can calculate the correct value of R2?

Thank you!
 Logged

Offline
Edison Member
Karma: 9
Posts: 1001
 « Reply #1 on: February 09, 2013, 06:28:14 am » Bigger Smaller Reset

Try to find a good datasheet, with lots of data. Some datasheets are very short.

The voltage drop over the transistor is perhaps only 0.1 or 0.2 V at 20mA.
But the led has a voltage drop of 1.4 ... 3V. That depends on the color. http://en.wikipedia.org/wiki/Light-emitting_diode#Colors_and_materials

If you want the transistor to be fully on, use about 30% more current through the base than needed.

Suppose the led has a voltage drop of 2V. 3V/20mA = 150 Ohm.
The current gain with Ic at 20mA is about 70. 20mA / 70 = 0.29mA. Add 30% makes 0.37mA.

For safety I assume that the output of the Arduino is 4.5V and the base about 0.7V. 4.5-0.7 = 3.8V
3.8V / 0.37mA = 10k

So 10k would do the job, and 4k7 doubles the base current to be sure. It doesn't hurt the 2N2222.

 Logged

Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2227
 « Reply #2 on: February 09, 2013, 06:34:58 am » Bigger Smaller Reset

The main point of the base resistor is to stop too much current coming out of the Arduino and hurting it.

As such, there's no 'correct' value, anything which lets less than 40mA out of the Arduino pin and more than what the transistor needs to full open will do.

OTOH, 40mA isn't a good design goal for an Arduino pin. You should be able to open the transistor with far less than that.

This page helped me a lot when I started out with transistors: http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/bjt_theory.html

 Logged

Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
 « Reply #3 on: February 09, 2013, 06:45:21 am » Bigger Smaller Reset

Quote
This page helped me a lot when I started out with transistors: http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/bjt_theory.html

Ok, I'm about halfway down the first page of that link and already things are making sense. Things that I first tried to understand about transistors when I was 13 in 1969.

That link ought to be Transistors 101 for everyone.

"I have a question about transistors...."
"Wait, have you read Transistors 101?"
"No, but...."
"Uhuh.... no "buts".... read it then ask if you still need to"

 Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Offline
God Member
Karma: 10
Posts: 862
 « Reply #4 on: February 09, 2013, 06:48:06 am » Bigger Smaller Reset

I generally use a 1k on the base, and around 200 - 250ohms from a 5v supply to power a small 5mm LED.

5/1000

0.005 amps at the base of the transistor (it can handle up to 40ma (0.040amps)

 Logged

Offline
Newbie
Karma: 0
Posts: 7
 « Reply #5 on: February 09, 2013, 10:57:42 am » Bigger Smaller Reset

Thank you all! Just for reference, i eventually used 10kOhm in the base and 100 ohm as a current limiting resistor, for ~100 μΑ base current and ~11 mA through the LED :

https://www.circuitlab.com/circuit/gmmqaq/2n2222-led/
 Logged

Dallas, TX
Offline
Sr. Member
Karma: 8
Posts: 314
 « Reply #6 on: February 09, 2013, 01:21:16 pm » Bigger Smaller Reset

I'm curious why OP chose to switch the high side instead of using the original circuit. With this setup, the transistor is operating in the linear region and will never reach saturation.
 Logged

Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 240
Posts: 16426
Available for Design & Build services
 « Reply #7 on: February 09, 2013, 01:56:39 pm » Bigger Smaller Reset

Yeah, but with that freaking fritzing program you can't tell that - have to go look up the parts and see which pins are B, E, C - which was totally obviouse in the original post.
 Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Dallas, TX
Offline
Sr. Member
Karma: 8
Posts: 314
 « Reply #8 on: February 09, 2013, 02:00:37 pm » Bigger Smaller Reset

Yeah, but with that freaking fritzing program you can't tell that - have to go look up the parts and see which pins are B, E, C - which was totally obviouse in the original post.

The link goes to a CircuitLab page that makes it easier to evaluate.
 Logged

Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15295
Measurement changes behavior
 « Reply #9 on: February 09, 2013, 02:01:46 pm » Bigger Smaller Reset

Yeah, but with that freaking fritzing program you can't tell that - have to go look up the parts and see which pins are B, E, C - which was totally obviouse in the original post.

Hey Bob, why are you not out shoveling snow off your drive way.
 Logged

Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 240
Posts: 16426
Available for Design & Build services
 « Reply #10 on: February 09, 2013, 02:15:02 pm » Bigger Smaller Reset

This is from an upstairs window - can't really tell, but the undrifted snow is 20" deep, and the pile from the city plows at the end of the drive is 4 feet and 8-10' wide.
 Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17

Offline
Newbie
Karma: 0
Posts: 7
 « Reply #11 on: February 09, 2013, 03:54:09 pm » Bigger Smaller Reset

Ok, now i am a little lost. Remember, i am new to electronics...

Quote
The way to deal with this is to calculate the
"nominal" base current required for the app, and then about double it, by using a value
for base resistor R2 of about 1/2 the nominal value.

I am not entirely sure i understand that

Quote
Also, your values above may be wrong. Normally, the hFE value is "lower" for larger
collector currents.

What values are wrong? For the resistors, or the calculated current in the base and the the LED?

Quote
I'm curious why OP chose to switch the high side instead of using the original circuit. With this setup, the transistor is operating in the linear region and will never reach saturation.

So, there is actually a difference if the LED is in the collector side or the emitter side ??
 Logged

Dallas, TX
Offline
Sr. Member
Karma: 8
Posts: 314
 « Reply #12 on: February 09, 2013, 03:59:31 pm » Bigger Smaller Reset

Quote
The link goes to a CircuitLab page that makes it easier to evaluate.
That's even more confusing. If you didn't know any better, you'd thing the 5V supply
on the collector was upside down, ;-). Possibly confusing to a noobee.
I'm not crazy about that schematic capture browser app.
Also, this is not good, pinouts between NP2222 plastic case and 2N2222 metal case
are backwards, oof! Murphy strikes again.
http://www.stanford.edu/class/ee133/datasheets/2n2222.pdf
http://www.jameco.com/Jameco/Products/ProdDS/38237ST.pdf
http://www.fairchildsemi.com/ds/PN/PN2222A.pdf

They look right to me. The base is in the middle where I expect it and the plastic part would fit in the standard TO-18 triangular PCB layout without having to cross the legs.

I congratulate OP for going through the design process. The first circuit is more common though, in my opinion.
 Logged

Dallas, TX
Offline
Sr. Member
Karma: 8
Posts: 314
 « Reply #13 on: February 09, 2013, 04:07:40 pm » Bigger Smaller Reset

Quote
So, there is actually a difference if the LED is in the collector side or the emitter side ??

Absolutely. When using an NPN transistor as a switch, it is more common to place the load on the collector side and drive the transistor into saturation so as to dissipate the least amount of power in the transistor. The way you have it, there is a couple of volts across the CE junction, not a problem really in this case because of the capabilities of the 2N2222 but something to think about.
 Logged

Valencia, Spain
Offline
Edison Member
Karma: 65
Posts: 2227
 « Reply #14 on: February 09, 2013, 04:20:37 pm » Bigger Smaller Reset

So, there is actually a difference if the LED is in the collector side or the emitter side ??

Yes. You only get 5V base->emitter when the emitter is connected to ground. If you put something in between emitter and ground then the emitter isn't at 0V.

 Logged

 Pages: [1] 2   Go Up