EmbeddedRelated.com
Forums
Memfault Beyond the Launch

driving an LED with a 7406 question

Started by panfilero February 13, 2007
On 13 Feb 2007 06:14:15 -0800, "panfilero" <panfilero@gmail.com>
wrote:

>When the 7406 is off, can I treat it as a 0.7 Voltage load with 40 mA >running through it to ground?
--- Depends on what you mean by "off". It might be simpler to look at the 7406 as a single transistor with its base pulled up to Vcc and nothing connected to its collector. (View in Courier) Vcc | [10K] | C | <--O--+-----B | E O S1 | | | GND---+---------------+ Normally open switch S1 is also connected to the base and is used to turn the transistor on and off. In the open position there will be charge flowing from base to emitter and then to ground, and that current will turn the transistor on, making the collector-to-emitter resistance drop to a low value. When the switch is made, the base current will be diverted to ground, through the switch, and the transistor will turn off, causing the base-to-emitter resistance to rise to a very high value. Notice that whether there is current into the base or not, nothing comes _out_ of the collector. Now let's change the circuit a little and see what happens. 30V | |R2 [750] 5V | | +--->OUT [10K] | | C | <--O--+-----B NPN | E O S1 | | | GND---+---------------+ Now, with S1 open the transistor will be on because charge will be flowing through the base-emitter junction to ground. This will then allow charge to flow from Vcc through R2 and through the collector-to-emitter junction of the transistor to ground. If there's enough current into the base to cause the transistor to be saturated, then the maximum voltage dropped across the collector-to-emitter junction will be 0.7 volts with 40 mA of collector current (7406, remember?). So, since we have 0.7V dropped across the transistor and we have a 30V collector supply the collector current must be: E 30V - 0.7V I = --- = ------------ = 39mA R 750R Now let's close the switch and see what happens: 30V | |R2 [750] 5V | | +--->OUT [10K] | | C |<--O--+-----B NPN | E OS1 | | | GND----+--------------+ Since the base current is now diverted to ground the transistor will be turned off and collector current will cease flowing since the path to ground will no longer exist. When that happens, the voltage on the collector will rise to the supply voltage, 30 volts, which is what the 7406 must stand off when it's turned off. So, to get back to your question, "When the 7406 is off, can I treat it as a 0.7 Voltage load with 40 mA running through it to ground?", the answer is "no". When the 7406 is off you should treat it like a reverse biased diode in series with your load, and when it's on you should treat it like a forward biased diode in series with your load. Now, to address your original post (I may be repeating someone else since I haven't read through the whole thing, but anyway... 5V | [Rs] | |A 7406 [LED] | \ | MCU I/O>---| >O---+ | / Assuming that you want to drive a 20 mA LED with a Vf of 2.2V, Looking at the 7406 data sheet shows that when it's sinking 16mA worst case Vol will be 0.4V and when it's sinking 40mA worst case Vol will be 0.7V. If we assume the change is linear, then we have a 24mA change in current causing a 300mV change in voltage, which is 12.5mV/mA. So, for 20mA, worst case Vol would be 0.45V. For Rs, Vcc - (Vled + Vol) 5V - 2.65V R = -------------------- = ------------- = 117.5 ohms Iled 0.02A The closest standard 5% value is 120 ohms, which would be fine, and the power it would need to dissipate with 20mA through it would be: P = IE = 0.02A * 2.35V = 0.047 watts. So since there's a little less than 20 mA through it, a standard 1/4 watt resistor would be fine. So, here's what you need: 5V | [120] | |A 7406 [LED] | \ | MCU I/O>---| >O---+ | / And the LED will light when the MCU I/O goes high or goes high-Z. -- JF
"panfilero" <panfilero@gmail.com> schreef in bericht 
news:1171339256.081298.159170@p10g2000cwp.googlegroups.com...
> Hello, I have a question about driving an LED with a 7406. Basically > I have an MCU going into a 7406 inverter going into an LED going to a > resistor R and that going to a 5 V power supply. All in series, and > I'm trying to find the value for R that would make this thing work.... > here's a sketch of what I'm talking about (this is my first time > skecthing on notepad) > > o 5 Volts > | > | > | > / > \ R > / > \ > | > | > __ > \/ LED MV5353 > --- > ------- | > | | | > | | |\ | > | | | \ | > | MCU |-----------| \-----------------| > | | | / > | | | / > | | |/ > | | > ------- 7406 > > > > This is how I began to tackle this problem: for MCU output = high I > looked on the spec sheet for the LED it said that the LED uses a > continuous forward current of 20 mA at a voltage drop of 3 Volts. > Then I went to the 7406 specs sheetand looked up IOL = 40 mA. So I > think to myself.... great, it can sink 40mA and I only need 20mA. so R > = (5-3)/20mA = 100 Ohms.... now I just have to check R with MCU out = > low.... > > I start to get stuck here, cause I begin to think.... should I include > VOL as a voltage drop when finding R? shold R = (5-3-VOL)/20mA ? Cause > I'm thinking VOL is the voltage drop for the 7406.... but I look on > the spec sheet and there's 2 values for VOL = 0.7....
So far you're on the right way. The value of VOL depends on the current. At 16mA the VOL is 0.4V as a maximum. At 40mA the VOL is 0.7V as a maximum. So it's safe to use VOLmax=0.4V, so R = (5-3-0.4)/20 = 80E use 82E as the nearest standard value. In pratical situations 100E to 470E is used depending on the amount of light required.
> > so R = (5-3-0.7)/20mA = 65 Ohms > > so.... when MCU output = low.... I'm not sure what to do here.... I > look up VOH.... VOH = 30 Volts.... whoa! hmmm..... I look up IOH, IOH > = 0.25 mA....... and then i think, i've got 25mA going towards that > LED, but wait.... it's going the wrong way, the LED will stop it... > but I wonder how much current the LED can stop? >
You're off track now. The specified VOH is the maximum voltage the output can handle without being damaged. You're using only 5V. The specified IOH is the maximum current that will leak into the SN7406 output when VOH=30V. As your VOH is only 5V the IOH will be neglectable.
> at this point I'm totally confused and am not sure if I'm looking at > things the right way anymore, the VOH,IOH,IOL,IOH stuff is confusing > to me..... can anyone tell me if I'm on the right track? > > thank you > Joshua > > > so for MCU = low: I guess I need to find IOH? That's IOH = 0.25 > mA.... I'm not sure what to do next, should I look up VOH >
When MCU low, the SN7406 output will be high. They are inverters remember? When you look at the schematic on the datasheet, it means that the basis of the outputtransistor will be low. So no current will flow from collector to emitter except from the leakage mentioned earlier. This leakage will not be enough the light the LED, so it's off. When the MCU is high, the voltage on the basis of the SN7406 output transistor will rise. The current that flows into the basis now will drive the transistor into saturation. The current through collector and emitter will be maximum, only limited by the load between collector and supply voltage. According to the specifications the output voltage will sink to or below 0.4V. No need to say the LED will be on. petrus bitbyter
On Tue, 13 Feb 2007 10:07:52 -0600, John Fields wrote:
...
> So, here's what you need: > > > 5V > | > [120] > | > |A > 7406 [LED] > | \ | > MCU I/O>---| >O---+ > | / > > And the LED will light when the MCU I/O goes high or goes high-Z.
Um, I think that if you expect the MCU I/O to go hi-Z, you'd want a pullup so that the 7406 doesn't have a floating input. Thanks, Rich
On Tue, 13 Feb 2007 17:12:11 GMT, Rich Grise <rich@example.net>
wrote:

>On Tue, 13 Feb 2007 10:07:52 -0600, John Fields wrote: >... >> So, here's what you need: >> >> >> 5V >> | >> [120] >> | >> |A >> 7406 [LED] >> | \ | >> MCU I/O>---| >O---+ >> | / >> >> And the LED will light when the MCU I/O goes high or goes high-Z. > >Um, I think that if you expect the MCU I/O to go hi-Z, you'd want >a pullup so that the 7406 doesn't have a floating input.
--- Um, It's TTL, not CMOS. The pullup isn't a BFD. Here's a 7406, run it and watch what happens to the output when the input floats: Version 4 SHEET 1 880 680 WIRE -48 48 -464 48 WIRE 256 48 -48 48 WIRE 400 48 256 48 WIRE 512 48 400 48 WIRE -48 80 -48 48 WIRE 256 80 256 48 WIRE 400 112 400 48 WIRE 512 112 512 48 WIRE -48 192 -48 160 WIRE 160 208 128 208 WIRE 256 208 256 160 WIRE 256 208 224 208 WIRE 512 208 512 192 WIRE 592 208 512 208 WIRE 512 224 512 208 WIRE -128 256 -208 256 WIRE -96 256 -128 256 WIRE 64 256 0 256 WIRE 256 256 256 208 WIRE 400 272 400 192 WIRE 448 272 400 272 WIRE 400 304 400 272 WIRE 128 336 128 304 WIRE 256 352 256 336 WIRE 336 352 256 352 WIRE -128 384 -128 256 WIRE 256 384 256 352 WIRE -464 400 -464 48 WIRE 128 432 128 416 WIRE 192 432 128 432 WIRE 128 448 128 432 WIRE -464 560 -464 480 WIRE -128 560 -128 448 WIRE -128 560 -464 560 WIRE 128 560 128 528 WIRE 128 560 -128 560 WIRE 256 560 256 480 WIRE 256 560 128 560 WIRE 400 560 400 400 WIRE 400 560 256 560 WIRE 512 560 512 320 WIRE 512 560 400 560 WIRE -464 592 -464 560 FLAG -464 592 0 SYMBOL res -64 64 R0 SYMATTR InstName R1 SYMATTR Value 6k SYMBOL npn 0 192 R90 WINDOW 0 58 34 Left 0 SYMATTR InstName Q1 SYMATTR Value 2N2222 SYMBOL diode -112 448 R180 WINDOW 0 51 30 Left 0 WINDOW 3 24 0 Left 0 SYMATTR InstName D1 SYMATTR Value 1N4148 SYMBOL npn 64 208 R0 SYMATTR InstName Q2 SYMATTR Value 2N2222 SYMBOL res 112 320 R0 WINDOW 0 -39 44 Left 0 WINDOW 3 -46 76 Left 0 SYMATTR InstName R2 SYMATTR Value 100 SYMBOL res 112 432 R0 WINDOW 0 -47 37 Left 0 WINDOW 3 -60 68 Left 0 SYMATTR InstName R3 SYMATTR Value 1000 SYMBOL npn 192 384 R0 SYMATTR InstName Q3 SYMATTR Value 2N2222 SYMBOL diode 224 192 R90 WINDOW 0 -36 36 VBottom 0 WINDOW 3 -32 36 VTop 0 SYMATTR InstName D2 SYMATTR Value 1N4148 SYMBOL res 240 64 R0 SYMATTR InstName R4 SYMATTR Value 1.4k SYMBOL res 240 240 R0 SYMATTR InstName R5 SYMATTR Value 2k SYMBOL npn 336 304 R0 SYMATTR InstName Q4 SYMATTR Value 2N2222 SYMBOL res 384 96 R0 SYMATTR InstName R6 SYMATTR Value 1.6k SYMBOL npn 448 224 R0 SYMATTR InstName Q5 SYMATTR Value 2N2222 SYMBOL voltage -464 384 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL res 496 96 R0 SYMATTR InstName R7 SYMATTR Value 1,6k TEXT -450 576 Left 0 !.tran .1 uic TEXT -208 288 Left 0 ;IN TEXT 552 232 Left 0 ;OUT -- JF
On Tue, 13 Feb 2007 14:01:40 +0000, Eeyore
<rabbitsfriendsandrelations@hotmail.com> wrote:

> > >John Fields wrote: > >> Eeyore <rabbitsfriendsandrelations@hotmail.com> wrote: >> >John Fields wrote: >> >> Eeyore <rabbitsfriendsandrelations@hotmail.com> wrote: >> >> >panfilero wrote: >> >> > >> >> >> Hello, I have a question about driving an LED with a 7406. >> >> > >> >> >What on earth are you using a 7406 for ? >> >> >> >> --- >> >> Read the fucking thread, why don'tcha? >> > >> >There is nothing in the original post to indicate a reason for its use thank you >> >very much Mr Allegedly Polite ! >> >> --- >> Geez, I thought from his post (which included a diagram, BTW) that >> he was using it as a low side LED driver and wanted some help in >> figuring out the value of the current limiting resistor. > >Well ? So ?
--- Well, So, that's what he's using it for. ---
>> >Does anyone even still make a standard TTL 7406 ? It seems unlikely to me. >> >> --- >> Who cares? It's what _he's_ using. > >Do you never think to offer advice about component selection ?
--- Sure, when it's warranted, but in a discussion like this one all he's trying to do is learn how the thing works, as he's already stated, it isn't. -- JF
On Tue, 13 Feb 2007 13:35:10 -0600, John Fields wrote:
> On Tue, 13 Feb 2007 17:12:11 GMT, Rich Grise <rich@example.net> >>On Tue, 13 Feb 2007 10:07:52 -0600, John Fields wrote: >>... >>> So, here's what you need: >>> >>> >>> 5V >>> | >>> [120] >>> | >>> |A >>> 7406 [LED] >>> | \ | >>> MCU I/O>---| >O---+ >>> | / >>> >>> And the LED will light when the MCU I/O goes high or goes high-Z. >> >>Um, I think that if you expect the MCU I/O to go hi-Z, you'd want >>a pullup so that the 7406 doesn't have a floating input. > > Um, It's TTL, not CMOS. The pullup isn't a BFD. >
Probably not, it's just that I'm chicken to let inputs float at all. :-) Thanks! Rich
On Feb 13, 2:35 pm, John Fields <jfie...@austininstruments.com> wrote:
> --- > Um, It's TTL, not CMOS. The pullup isn't a BFD. > > Here's a 7406, run it and watch what happens to the output when the > input floats: > > Version 4 > SHEET 1 880 680
...snip... Well, let's see... rude, obnoxious and ignorant. What a great combination!!! Dude, chill out a little bit. Simulations are not the real world and unless you are dealing with no-neck, leather clad bikers with chains and drawn knives, you are better off not trying your very best to PO everyone you speak too. BTW, I know this from experience. :^)
On Tue, 13 Feb 2007 23:37:53 GMT, Rich Grise <rich@example.net>
wrote:

>On Tue, 13 Feb 2007 13:35:10 -0600, John Fields wrote: >> On Tue, 13 Feb 2007 17:12:11 GMT, Rich Grise <rich@example.net> >>>On Tue, 13 Feb 2007 10:07:52 -0600, John Fields wrote: >>>... >>>> So, here's what you need: >>>> >>>> >>>> 5V >>>> | >>>> [120] >>>> | >>>> |A >>>> 7406 [LED] >>>> | \ | >>>> MCU I/O>---| >O---+ >>>> | / >>>> >>>> And the LED will light when the MCU I/O goes high or goes high-Z. >>> >>>Um, I think that if you expect the MCU I/O to go hi-Z, you'd want >>>a pullup so that the 7406 doesn't have a floating input. >> >> Um, It's TTL, not CMOS. The pullup isn't a BFD. >> > >Probably not, it's just that I'm chicken to let inputs float at all. >:-)
--- You're right, of course. Good man. -- JF
On 13 Feb 2007 16:10:42 -0800, "rickman" <gnuarm@gmail.com> wrote:

>On Feb 13, 2:35 pm, John Fields <jfie...@austininstruments.com> wrote: >> --- >> Um, It's TTL, not CMOS. The pullup isn't a BFD. >> >> Here's a 7406, run it and watch what happens to the output when the >> input floats: >> >> Version 4 >> SHEET 1 880 680 >...snip... > >Well, let's see... rude, obnoxious and ignorant. What a great >combination!!!
--- Ah, I see that another churl is itching to be dispatched. ---
>>Dude, chill out a little bit. Simulations are not the real world and >unless you are dealing with no-neck, leather clad bikers with chains >and drawn knives, you are better off not trying your very best to PO >everyone you speak too. BTW, I know this from experience. :^)
--- Fuck you, asshole pussy. Just because you said something stupid in real life/time and got buttfucked for it in the environment you chose to embrace doesn't mean that all of the rest of us are in the same boat. Can you understand that? -- JF
On Tue, 13 Feb 2007 16:10:42 -0800, rickman wrote:
> On Feb 13, 2:35 pm, John Fields <jfie...@austininstruments.com> wrote: >> --- >> Um, It's TTL, not CMOS. The pullup isn't a BFD. >> >> Here's a 7406, run it and watch what happens to the output when the >> input floats: >> >> Version 4 >> SHEET 1 880 680 > ...snip... > > Well, let's see... rude, obnoxious and ignorant. > What a great combination!!!
Huh? He was a little bit, um, abrupt, but I don't find his post "rude, obnoxious and ignorant" at all. :-) Cheers! Rich

Memfault Beyond the Launch