Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16571
Available for Design & Build services
|
 |
« Reply #15 on: February 09, 2013, 04:29:58 pm » |
When the NPN emitter is grounded Vbe is ~0.7V and base resistor is easy to calculate: (5V - 0.7V)/20ma = Rbase 20mA should put the C-E junction into saturation and let the transistor act like a switch, with the current limited by the resister in series with the LED.
When the emitter is connected to the load, then Vb becomes Vf + (I-load x Rload) + Vbe + (Ib (from the Arduino) * Rload) Just messy.
You can look up "Collector follower" vs "Emitter follower" for more info.
Ideally, you would have NPN for sinking current, and PNP for sourcing current.
|
|
|
|
|
Logged
|
|
|
|
|
Dallas, TX
Offline
Sr. Member
Karma: 10
Posts: 315
|
 |
« Reply #16 on: February 09, 2013, 04:45:36 pm » |
When the NPN emitter is grounded Vbe is ~0.7V and base resistor is easy to calculate: (5V - 0.7V)/20ma = Rbase I would think that if you were going to drive the base with 20mA, you might as well leave out the 2N2222. 
|
|
|
|
|
Logged
|
|
|
|
|
Dallas, TX
Offline
Sr. Member
Karma: 10
Posts: 315
|
 |
« Reply #17 on: February 09, 2013, 05:10:36 pm » |
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 think the "round" part of the PN2222 body and the "curved" part of the 2N2222 pin arrangement point in opposite directions, so if your pcb layout looks as follows, you're up the creek [of course, I may be upside down over here], http://jeelabs.org/wp-content/uploads/2011/01/screen_shot_2011_01_03_at_120850.pngThe silkscreen may be misleading. All goes to reinforce the fact that you need to look at the data sheet.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16571
Available for Design & Build services
|
 |
« Reply #18 on: February 09, 2013, 05:12:34 pm » |
I did not leave out hFE/beta, I was discussing driving the base hard so the device goes deep into saturation. You want the current to be limited by the load resister and not the gain of the device
|
|
|
|
|
Logged
|
|
|
|
|
Dallas, TX
Offline
Sr. Member
Karma: 10
Posts: 315
|
 |
« Reply #19 on: February 09, 2013, 05:19:56 pm » |
I did not leave out hFE/beta, I was discussing driving the base hard so the device goes deep into saturation. You want the current to be limited by the load resister and not the gain of the device
It is not necessary to drive a 2N2222 that hard to get it to saturate with a load of, say, 20mA. It saturates with 150mA of collector current with just 15mA of base current. Again, why use a transistor driver at all if you are going to use that much current from the Arduino?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16571
Available for Design & Build services
|
 |
« Reply #20 on: February 09, 2013, 05:26:50 pm » |
Yes, transistor a little silly for 1 LED, but the same design carries right over into 2-3-4 LEDs in series from 12V source.
|
|
|
|
|
Logged
|
|
|
|
|
Dallas, TX
Offline
Sr. Member
Karma: 10
Posts: 315
|
 |
« Reply #21 on: February 09, 2013, 05:27:15 pm » |
OP, you notice how analog design is really still an "art" [meaning 1/2 subjective and based upon personal experience, :-)]. While there can be some "art" associated with design of analog circuits, we're talking primarily about a digital switch here and the design procedure is not that mysterious.
|
|
|
|
|
Logged
|
|
|
|
|
Dallas, TX
Offline
Sr. Member
Karma: 10
Posts: 315
|
 |
« Reply #22 on: February 09, 2013, 05:32:46 pm » |
Yes, transistor a little silly for 1 LED, but the same design carries right over into 2-3-4 LEDs in series from 12V source.
Well, I'm not going to argue with you about your "Hail Mary" design approach.
|
|
|
|
|
Logged
|
|
|
|
|
Dallas, TX
Offline
Sr. Member
Karma: 10
Posts: 315
|
 |
« Reply #23 on: February 09, 2013, 05:43:51 pm » |
OP, you notice how analog design is really still an "art" [meaning 1/2 subjective and based upon personal experience, :-)]. While there can be some "art" associated with design of analog circuits, we're talking primarily about a digital switch here and the design procedure is not that mysterious. Unfortunately, although we're only building a digital switch, we're using an analog component to do it, so we need to pay attention to the analog characteristics. That's what all those resistors are for. Well, my first job out of university was with Texas Instruments on their 7400 logic family team and I can assure you that all those ICs have transistors and resistors inside and the same design criteria that you use with discrete components apply. Technically speaking, a transistor in saturation is not an analog component. I get your point, I just don't rely on magic when science will do the job.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 7
|
 |
« Reply #24 on: February 09, 2013, 06:21:50 pm » |
A newer version of the schematic then, incorporating some of the feedback. The simulator reports 13.5 mA at the LED and 430 μA at the base for an hFE of 32. I didn't change the 10kOhm resistor of the base to 4.7kOhm as that would give an hFE of 16. It is still not entirely clear what the hFE should be and since it is a loose value anyway and the datasheet does not give the value of hFE for 5V i guess an approximate value of 30-70 should suffice. https://www.circuitlab.com/circuit/gmmqaq/2n2222-led/
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16571
Available for Design & Build services
|
 |
« Reply #25 on: February 09, 2013, 07:09:10 pm » |
http://www.onsemi.com/pub_link/Collateral/P2N2222A-D.PDFLook at the On Characterics on sheet 2. With Ib of 15mA, the base-emitter voltage will be ~0.6V and the collector-emitter voltage will be ~0.3V. Use those numbers to work the resister values. (5V - 0.6V)/15mA = Base resistor (5V - Vf - 0.3V)/20mA = LED resistor.
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5454
Strongly opinionated, but not official!
|
 |
« Reply #26 on: February 10, 2013, 02:26:00 am » |
The simulator reports 13.5 mA at the LED and 430 μA at the base for an hFE of 32. No, no. h FE is a characteristic of the transistor, not the overall circuit. You're looking at the current gain of the circuit. A major point of designing a transistor circuit is that you minimize the effects of variations in the characteristics of the transistors, since they can vary quite a bit. So R base is chosen to limit the current in the base/emitter circuit, and R led is chosen to limit the current in the LED through the Collector/Emitter circuit, and everything will work just swell as long as h FE is "much larger" than I c/I b
|
|
|
|
|
Logged
|
|
|
|
|
the land of sun+snow
Offline
Edison Member
Karma: 81
Posts: 2137
|
 |
« Reply #27 on: February 10, 2013, 02:23:35 pm » |
The simulator reports 13.5 mA at the LED and 430 μA at the base for an hFE of 32. No, no. h FE is a characteristic of the transistor, not the overall circuit. You're looking at the current gain of the circuit. A major point of designing a transistor circuit is that you minimize the effects of variations in the characteristics of the transistors, since they can vary quite a bit. So R base is chosen to limit the current in the base/emitter circuit, and R led is chosen to limit the current in the LED through the Collector/Emitter circuit, and everything will work just swell as long as h FE is "much larger" than I c/I bExcellent description of the situation.
|
|
|
|
|
Logged
|
|
|
|
|
South Texas
Offline
God Member
Karma: 8
Posts: 976
|
 |
« Reply #28 on: February 11, 2013, 10:48:26 am » |
I already did  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. Gee - I remember those days... And then I moved to South Texas... Been a little chilly down here in the mornings of late. Temps around 70....
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16571
Available for Design & Build services
|
 |
« Reply #29 on: February 11, 2013, 04:17:40 pm » |
Temps in the 70s... but it reaches the 'teens' in the summer, right? 115, 117? Little warm for me  Can always dress a little warmer in the winter, but in the summer, its hard to dress cooler once you're naked!
|
|
|
|
|
Logged
|
|
|
|
|
|