A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
Using a PIC 16F688, the maximum current for an I/O pin is 20 mA. Is it ok to exceed this if the drain has a duty cycle as follows: I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of tolerance). The resistor is part of a 6 bit binary ladder generating audio direct feed to headphones (6 resistors to six I/O pins, then tied together - this pin has the lowest value resistor, so I am concerned). The ladder has a 10 uf series cap (dc block) and then to a 10K pot to ground. Center of pot to headphones. 3 volt circuit with 2N5819 schotky barrier diode, so new batteries give (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. 2.76 volts / 114 ohms = 24.2 mA ! But in generating the audio sine wave the pin has a duty cycle. And, the headphones add some resistance, maybe 16 ohms. At 300 Hz, with approx 40 points for each sine wave, this pin is on for approx .002 second, then off .001 sec, then on again .002 sec then off .001 sec, etc. So, about 67% duty cycle. Is there some risk that the PIC will fail? Ransom Peek Fort Collins CO |
|
|
|
This is not answering your question but pointing something out that you probably didn't realise... Remember that sources have internal impedance too. (And in this case it is likely dynamic and changes with the amount of current being drawn by the sink.) Thus, I wouldn't expect the PIC to source the max rated current at the supply voltage. I would expect that as the load increases the actual voltage you see at the IO pin will drop. In other words, you might find that your current calculations are wrong because you won't be seeing 2.76V across the load resistor. --Scott --- In , "ransom peek" <ransom.peek@c...> wrote: > Using a PIC 16F688, the maximum current for an I/O pin is 20 mA. Is it > ok to exceed this if the drain has a duty cycle as follows: > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of tolerance). > The resistor is part of a 6 bit binary ladder generating audio direct > feed to headphones (6 resistors to six I/O pins, then tied together - > this pin has the lowest value resistor, so I am concerned). The ladder > has a 10 uf series cap (dc block) and then to a 10K pot to ground. > Center of pot to headphones. > > 3 volt circuit with 2N5819 schotky barrier diode, so new batteries give > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > 2.76 volts / 114 ohms = 24.2 mA ! > > But in generating the audio sine wave the pin has a duty cycle. And, > the headphones add some resistance, maybe 16 ohms. > > At 300 Hz, with approx 40 points for each sine wave, this pin is on for > approx .002 second, then off .001 sec, then on again .002 sec then off > .001 sec, etc. So, about 67% duty cycle. > > Is there some risk that the PIC will fail? > > Ransom Peek > Fort Collins CO |
|
|
|
I agree with scott and have seen this with 3.2V battery powered PICs. I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 voltage drop from the PIC, I should have gotten 2.5V, full current and brightness from the LED with no dropping resistor. yes, I was somewhat over voltage but was PWMing the LED, same theory as you. I was actually seeing, iirc, something less than 2V and the entire PIC circuit pulled around 18 mA. Whether this is enough for your circuit to work is hard to say. I wound up using a driver transistor for the LED and it worked quite well. My guess is that you'll probably be ok - current-wise. since the chip is pretty cheap, why dont you just try it? set up a stress test and see if the chip overheats or burns out. I believe the 20mA limit is because of heating and thus a duty cycle that brings the average below 20mA will probably be ok. Obviously, we aren't talking about huge current spikes. --- In , "Scott Lee" <midl_man@y...> wrote: > This is not answering your question but pointing something out that > you probably didn't realise... > > Remember that sources have internal impedance too. (And in this case > it is likely dynamic and changes with the amount of current being > drawn by the sink.) > > Thus, I wouldn't expect the PIC to source the max rated current at > the supply voltage. I would expect that as the load increases the > actual voltage you see at the IO pin will drop. > > In other words, you might find that your current calculations are > wrong because you won't be seeing 2.76V across the load resistor. > > --Scott > > --- In , "ransom peek" <ransom.peek@c...> > wrote: > > Using a PIC 16F688, the maximum current for an I/O pin is 20 mA. > Is it > > ok to exceed this if the drain has a duty cycle as follows: > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > tolerance). > > The resistor is part of a 6 bit binary ladder generating audio > direct > > feed to headphones (6 resistors to six I/O pins, then tied > together - > > this pin has the lowest value resistor, so I am concerned). The > ladder > > has a 10 uf series cap (dc block) and then to a 10K pot to ground. > > Center of pot to headphones. > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new batteries > give > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > But in generating the audio sine wave the pin has a duty cycle. > And, > > the headphones add some resistance, maybe 16 ohms. > > > > At 300 Hz, with approx 40 points for each sine wave, this pin is on > for > > approx .002 second, then off .001 sec, then on again .002 sec then > off > > .001 sec, etc. So, about 67% duty cycle. > > > > Is there some risk that the PIC will fail? > > > > > > > > Ransom Peek > > Fort Collins CO |
|
|
|
Phil – your experience of needing to use a transistor to drive the LEDs is key. Since I have 0.3V diode drop and battery voltage varies from 1.53V(new) to 1.30V(old), I also will need a transistor to drive each LED.
Voltage could be:
(1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V or (1.30V x 2) - 0.3V - 0.7V = 1.6V
Should I use a SO2222A or MMBT3904 (surface mount) NPN transistor? Is this how to do it?
Collector---- +1.6V - 2.06V | PIC---/\/\/\/\/\---Base R1 | Emitter----/\/\/\/\/----LED-----GND
What is value for R1? I’ll need three transistors but can’t find any quad smt transistor packs in the mouser catalog. Do they exist?
Ransom
-----Original Message-----
I agree with scott and
have seen this with 3.2V
battery powered PICs. |
|
|
|
I used an mmbt3904 but have used 2n2222 and 2n4401. they will all work just fine. You dont need R1. I posted a snippet of the schematic to the photos section. I show a 12 ohm dropping resistor but eliminated it from the final design. Total draw is slightly more than 20 mA at full power but I'm using an 80% PWM duty cycle for full brightness and it pulls around 18mA. well within limits. --- In , "ransom peek" <ransom.peek@c...> wrote: > Phil - your experience of needing to use a transistor to drive the LEDs > is key. Since I have 0.3V diode drop and battery voltage varies from > 1.53V(new) to 1.30V(old), I also will need a transistor to drive each > LED. > Voltage could be: > > (1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V > > or (1.30V x 2) - 0.3V - 0.7V = 1.6V > Should I use a SO2222A or MMBT3904 (surface mount) NPN transistor? > > Is this how to do it? > > Collector---- +1.6V - 2.06V > > | > > PIC---/\/\/\/\/\---Base > > R1 | > > Emitter----/\/\/\/\/----LED-----GND > > What is value for R1? > > I'll need three transistors but can't find any quad smt transistor packs > in the mouser catalog. Do they exist? > Ransom > > -----Original Message----- > From: Phil [mailto:phil1960us@y...] > Sent: Thursday, May 06, 2004 3:40 PM > To: > Subject: [piclist] Re: Is 24 mA too much for PIC I/O pin if it has a > duty cyle? > > I agree with scott and have seen this with 3.2V battery powered PICs. > I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 voltage > drop from the PIC, I should have gotten 2.5V, full current and > brightness from the LED with no dropping resistor. yes, I was > somewhat over voltage but was PWMing the LED, same theory as you. I > was actually seeing, iirc, something less than 2V and the entire PIC > circuit pulled around 18 mA. Whether this is enough for your circuit > to work is hard to say. I wound up using a driver transistor for the > LED and it worked quite well. > > My guess is that you'll probably be ok - current-wise. since the > chip is pretty cheap, why dont you just try it? set up a stress test > and see if the chip overheats or burns out. I believe the 20mA limit > is because of heating and thus a duty cycle that brings the average > below 20mA will probably be ok. Obviously, we aren't talking about > huge current spikes. > --- In , "Scott Lee" <midl_man@y...> wrote: > > This is not answering your question but pointing something out that > > you probably didn't realise... > > > > Remember that sources have internal impedance too. (And in this > case > > it is likely dynamic and changes with the amount of current being > > drawn by the sink.) > > > > Thus, I wouldn't expect the PIC to source the max rated current at > > the supply voltage. I would expect that as the load increases the > > actual voltage you see at the IO pin will drop. > > > > In other words, you might find that your current calculations are > > wrong because you won't be seeing 2.76V across the load resistor. > > > > --Scott > > > > --- In , "ransom peek" <ransom.peek@c...> > > wrote: > > > Using a PIC 16F688, the maximum current for an I/O pin is 20 mA. > > Is it > > > ok to exceed this if the drain has a duty cycle as follows: > > > > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > > tolerance). > > > The resistor is part of a 6 bit binary ladder generating audio > > direct > > > feed to headphones (6 resistors to six I/O pins, then tied > > together - > > > this pin has the lowest value resistor, so I am concerned). The > > ladder > > > has a 10 uf series cap (dc block) and then to a 10K pot to ground. > > > Center of pot to headphones. > > > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new > batteries > > give > > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > > > But in generating the audio sine wave the pin has a duty cycle. > > And, > > > the headphones add some resistance, maybe 16 ohms. > > > > > > At 300 Hz, with approx 40 points for each sine wave, this pin is > on > > for > > > approx .002 second, then off .001 sec, then on again .002 sec > then > > off > > > .001 sec, etc. So, about 67% duty cycle. > > > > > > Is there some risk that the PIC will fail? > > > > > > > > > > > > Ransom Peek > > > Fort Collins CO > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > Yahoo! Groups Sponsor > > ADVERTISEMENT <http://rd.yahoo.com/SIG=129our7br/M=295196.4901138.6071305.3001176/D= gr > oups/S=1706554205:HM/EXP=1083966028/A=2128215/R=0/SIG=10se96mf6/*http: /c > ompanion.yahoo.com> click here > > <http://us.adserver.yahoo.com/l? M=295196.4901138.6071305.3001176/D=group > s/S=:HM/A=2128215/rand=407049941 > > _____ > > > Service. |
|
sorry, I forgot your last question. I've look for bipolar arrays but haven't found them. You could use a darlington array but i think they are pretty power inefficient. |
|
I wouldn't put the resistor and LED in the emitter. They normally get install between Vcc and the collector and the emitter is grounded. Otherwise the emitter voltage rises and the base voltage has to keep rising and it can never get to Vcc - Vce (sat) + Vbe (sat) - in other words the collector voltage minus the drop across the transistor (collector to emitter) when saturated plus the voltage across the base emitter junction at saturation. You can get an estimate of R1 if you assume an emitter current of say 20 mA and a DC current gain of say 100 (pick your own values). You need base current of 200 uA (20 mA / 100). So, figure the voltage across the resistor when the PIC output is logic 1 (Voh = ?) and the transistor is saturated (Vbe = 0.7). Given that voltage and a current of 200 uA you can determine the resistor. Now, you might want to lower the value by half just in case the transistor doesn't quite get to saturation. Or you could just try 10K which is where I would start. --- In , "ransom peek" <ransom.peek@c...> wrote: > Phil - your experience of needing to use a transistor to drive the LEDs > is key. Since I have 0.3V diode drop and battery voltage varies from > 1.53V(new) to 1.30V(old), I also will need a transistor to drive each > LED. > Voltage could be: > > (1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V > > or (1.30V x 2) - 0.3V - 0.7V = 1.6V > Should I use a SO2222A or MMBT3904 (surface mount) NPN transistor? > > Is this how to do it? > > Collector---- +1.6V - 2.06V > > | > > PIC---/\/\/\/\/\---Base > > R1 | > > Emitter----/\/\/\/\/----LED-----GND > > What is value for R1? > > I'll need three transistors but can't find any quad smt transistor packs > in the mouser catalog. Do they exist? > Ransom > > -----Original Message----- > From: Phil [mailto:phil1960us@y...] > Sent: Thursday, May 06, 2004 3:40 PM > To: > Subject: [piclist] Re: Is 24 mA too much for PIC I/O pin if it has a > duty cyle? > > I agree with scott and have seen this with 3.2V battery powered PICs. > I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 voltage > drop from the PIC, I should have gotten 2.5V, full current and > brightness from the LED with no dropping resistor. yes, I was > somewhat over voltage but was PWMing the LED, same theory as you. I > was actually seeing, iirc, something less than 2V and the entire PIC > circuit pulled around 18 mA. Whether this is enough for your circuit > to work is hard to say. I wound up using a driver transistor for the > LED and it worked quite well. > > My guess is that you'll probably be ok - current-wise. since the > chip is pretty cheap, why dont you just try it? set up a stress test > and see if the chip overheats or burns out. I believe the 20mA limit > is because of heating and thus a duty cycle that brings the average > below 20mA will probably be ok. Obviously, we aren't talking about > huge current spikes. > --- In , "Scott Lee" <midl_man@y...> wrote: > > This is not answering your question but pointing something out that > > you probably didn't realise... > > > > Remember that sources have internal impedance too. (And in this > case > > it is likely dynamic and changes with the amount of current being > > drawn by the sink.) > > > > Thus, I wouldn't expect the PIC to source the max rated current at > > the supply voltage. I would expect that as the load increases the > > actual voltage you see at the IO pin will drop. > > > > In other words, you might find that your current calculations are > > wrong because you won't be seeing 2.76V across the load resistor. > > > > --Scott > > > > --- In , "ransom peek" <ransom.peek@c...> > > wrote: > > > Using a PIC 16F688, the maximum current for an I/O pin is 20 mA. > > Is it > > > ok to exceed this if the drain has a duty cycle as follows: > > > > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > > tolerance). > > > The resistor is part of a 6 bit binary ladder generating audio > > direct > > > feed to headphones (6 resistors to six I/O pins, then tied > > together - > > > this pin has the lowest value resistor, so I am concerned). The > > ladder > > > has a 10 uf series cap (dc block) and then to a 10K pot to ground. > > > Center of pot to headphones. > > > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new > batteries > > give > > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > > > But in generating the audio sine wave the pin has a duty cycle. > > And, > > > the headphones add some resistance, maybe 16 ohms. > > > > > > At 300 Hz, with approx 40 points for each sine wave, this pin is > on > > for > > > approx .002 second, then off .001 sec, then on again .002 sec > then > > off > > > .001 sec, etc. So, about 67% duty cycle. > > > > > > Is there some risk that the PIC will fail? > > > > > > > > > > > > Ransom Peek > > > Fort Collins CO > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > Yahoo! Groups Sponsor > > ADVERTISEMENT <http://rd.yahoo.com/SIG=129our7br/M=295196.4901138.6071305.3001176/D =gr > oups/S=1706554205:HM/EXP=1083966028/A=2128215/R=0/SIG=10se96mf6/*http :/c > ompanion.yahoo.com> click here > > <http://us.adserver.yahoo.com/l? M=295196.4901138.6071305.3001176/D=group > s/S=:HM/A=2128215/rand=407049941 > > _____ > > > Service. |
|
|
|
I dunno, seems to work well for me. I have no trouble getting a couple 100 mV over the LED's Vf. Your approach will, of course, also work. --- In , "rtstofer" <rstofer@p...> wrote: > > I wouldn't put the resistor and LED in the emitter. They normally > get install between Vcc and the collector and the emitter is > grounded. Otherwise the emitter voltage rises and the base voltage > has to keep rising and it can never get to Vcc - Vce (sat) + Vbe > (sat) - in other words the collector voltage minus the drop across > the transistor (collector to emitter) when saturated plus the > voltage across the base emitter junction at saturation. > > You can get an estimate of R1 if you assume an emitter current of > say 20 mA and a DC current gain of say 100 (pick your own values). > You need base current of 200 uA (20 mA / 100). So, figure the > voltage across the resistor when the PIC output is logic 1 (Voh = ?) > and the transistor is saturated (Vbe = 0.7). Given that voltage and > a current of 200 uA you can determine the resistor. > > Now, you might want to lower the value by half just in case the > transistor doesn't quite get to saturation. > > Or you could just try 10K which is where I would start. > > --- In , "ransom peek" <ransom.peek@c...> > wrote: > > Phil - your experience of needing to use a transistor to drive the > LEDs > > is key. Since I have 0.3V diode drop and battery voltage varies > from > > 1.53V(new) to 1.30V(old), I also will need a transistor to drive > each > > LED. > > > > > > > > > > > > Voltage could be: > > > > > > > > (1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V > > > > or (1.30V x 2) - 0.3V - 0.7V = 1.6V > > > > > > > > > > > > Should I use a SO2222A or MMBT3904 (surface mount) NPN > transistor? > > > > Is this how to do it? > > > > > > > > Collector---- +1.6V - 2.06V > > > > | > > > > PIC---/\/\/\/\/\---Base > > > > R1 | > > > > Emitter----/\/\/\/\/----LED-----GND > > > > > > > > What is value for R1? > > > > I'll need three transistors but can't find any quad smt transistor > packs > > in the mouser catalog. Do they exist? > > > > > > > > > > > > Ransom > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > From: Phil [mailto:phil1960us@y...] > > Sent: Thursday, May 06, 2004 3:40 PM > > To: > > Subject: [piclist] Re: Is 24 mA too much for PIC I/O pin if it has > a > > duty cyle? > > > > > > > > I agree with scott and have seen this with 3.2V battery powered > PICs. > > I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 > voltage > > drop from the PIC, I should have gotten 2.5V, full current and > > brightness from the LED with no dropping resistor. yes, I was > > somewhat over voltage but was PWMing the LED, same theory as you. > I > > was actually seeing, iirc, something less than 2V and the entire > PIC > > circuit pulled around 18 mA. Whether this is enough for your > circuit > > to work is hard to say. I wound up using a driver transistor for > the > > LED and it worked quite well. > > > > My guess is that you'll probably be ok - current-wise. since the > > chip is pretty cheap, why dont you just try it? set up a stress > test > > and see if the chip overheats or burns out. I believe the 20mA > limit > > is because of heating and thus a duty cycle that brings the > average > > below 20mA will probably be ok. Obviously, we aren't talking > about > > huge current spikes. > > > > > > --- In , "Scott Lee" <midl_man@y...> wrote: > > > This is not answering your question but pointing something out > that > > > you probably didn't realise... > > > > > > Remember that sources have internal impedance too. (And in this > > case > > > it is likely dynamic and changes with the amount of current > being > > > drawn by the sink.) > > > > > > Thus, I wouldn't expect the PIC to source the max rated current > at > > > the supply voltage. I would expect that as the load increases > the > > > actual voltage you see at the IO pin will drop. > > > > > > In other words, you might find that your current calculations > are > > > wrong because you won't be seeing 2.76V across the load resistor. > > > > > > --Scott > > > > > > --- In , "ransom peek" <ransom.peek@c...> > > > wrote: > > > > Using a PIC 16F688, the maximum current for an I/O pin is 20 > mA. > > > Is it > > > > ok to exceed this if the drain has a duty cycle as follows: > > > > > > > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > > > tolerance). > > > > The resistor is part of a 6 bit binary ladder generating audio > > > direct > > > > feed to headphones (6 resistors to six I/O pins, then tied > > > together - > > > > this pin has the lowest value resistor, so I am concerned). > The > > > ladder > > > > has a 10 uf series cap (dc block) and then to a 10K pot to > ground. > > > > Center of pot to headphones. > > > > > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new > > batteries > > > give > > > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > > > > > But in generating the audio sine wave the pin has a duty > cycle. > > > And, > > > > the headphones add some resistance, maybe 16 ohms. > > > > > > > > At 300 Hz, with approx 40 points for each sine wave, this pin > is > > on > > > for > > > > approx .002 second, then off .001 sec, then on again .002 sec > > then > > > off > > > > .001 sec, etc. So, about 67% duty cycle. > > > > > > > > Is there some risk that the PIC will fail? > > > > > > > > > > > > > > > > Ransom Peek > > > > Fort Collins CO > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > > instructions > > > > > > > > > > > > > > Yahoo! Groups Sponsor > > > > > > > > ADVERTISEMENT > > > > > <http://rd.yahoo.com/SIG=129our7br/M=295196.4901138.6071305.3001176/D > =gr > > > oups/S=1706554205:HM/EXP=1083966028/A=2128215/R=0/SIG=10se96mf6/*http > :/c > > ompanion.yahoo.com> click here > > > > > > > > <http://us.adserver.yahoo.com/l? > M=295196.4901138.6071305.3001176/D=group > > s/S=:HM/A=2128215/rand=407049941> > > > > > > > > _____ > > > > > Service. |
|
|
|
Your suggestion of 10K series resistor to drive npn transistor fo rlighting LED (VDD to LED, to resistor to collector, and emitter to ground is the perfect solution for the single LED. But also have a dual LED with common ground, so need another way. Would a PNP resistor work for this?
Ransom
-----Original Message-----
|
|
|
|
Yes, if you have a common ground you need to use PNP transistors. Connect the collector to Vdd and the resistor and one side of LED to the emitter. Now your problem for base current and R1 calculations are the same. What is the PIC output at logic 0 and what is the voltage drop across the base-emitter junction at saturation? Combined these are probably 0.9V. So, Vdd - 0.9 dropped across the resistor at say 200 uA. Again, perhaps half this much resistance will be appropriate - still headed toward 10k. This will connect between the base and the PIC output port. The problem with this design is keeping the transistor turned off. With the NPN design the logic 0 output would never forward bias the transistor. With the PNP design the logic 1 voltage may not be high enough to keep the transistor turned off. An ugly solution is to run another 10k resistor from the base to Vdd. This will keep the transistor off at logic 1 but it changes the current flow through R1 at logic 0. So, you need to recalculate R1 with more current ( (Vdd - Vol) / 10k) from the pull-up resistor. This pull-up resistor could also be much larger - perhaps 100k and this will have less effect on R1. Another way to do the pull-up is to add the 10k resistor at the PIC port. This won't influence the calculation of R1 and the PIC output is looking at a 5k ohm load. About 1 mA if Vdd is 5V so no real concern about loading. You just need to be sure the transistor is not conducting when the PIC output bit is logic 1. So, the voltage at the emitter wants to be 0. You also should be certain the transistor is saturated at logic 0. The voltage across the collector and emitter should be close to 0.2V but check the Vce(sat) spec for your transistor. --- In , "ransom peek" <ransom.peek@c...> wrote: > Your suggestion of 10K series resistor to drive npn transistor fo > rlighting LED (VDD to LED, to resistor to collector, and emitter to > ground is the perfect solution for the single LED. But also have a dual > LED with common ground, so need another way. Would a PNP resistor work > for this? > > Ransom > > -----Original Message----- > From: rtstofer [mailto:rstofer@p...] > Sent: Friday, May 07, 2004 12:28 PM > To: > Subject: [piclist] Re: Phil's Driving Transistor - Is 24 mA too much for > PIC I/O pin if it has a duty cyle? > > > I wouldn't put the resistor and LED in the emitter. They normally > get install between Vcc and the collector and the emitter is > grounded. Otherwise the emitter voltage rises and the base voltage > has to keep rising and it can never get to Vcc - Vce (sat) + Vbe > (sat) - in other words the collector voltage minus the drop across > the transistor (collector to emitter) when saturated plus the > voltage across the base emitter junction at saturation. > > You can get an estimate of R1 if you assume an emitter current of > say 20 mA and a DC current gain of say 100 (pick your own values). > You need base current of 200 uA (20 mA / 100). So, figure the > voltage across the resistor when the PIC output is logic 1 (Voh = ?) > and the transistor is saturated (Vbe = 0.7). Given that voltage and > a current of 200 uA you can determine the resistor. > > Now, you might want to lower the value by half just in case the > transistor doesn't quite get to saturation. > > Or you could just try 10K which is where I would start. > > --- In , "ransom peek" <ransom.peek@c...> > wrote: > > Phil - your experience of needing to use a transistor to drive the > LEDs > > is key. Since I have 0.3V diode drop and battery voltage varies > from > > 1.53V(new) to 1.30V(old), I also will need a transistor to drive > each > > LED. > > > > > > > > > > > > Voltage could be: > > > > > > > > (1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V > > > > or (1.30V x 2) - 0.3V - 0.7V = 1.6V > > > > > > > > > > > > Should I use a SO2222A or MMBT3904 (surface mount) NPN > transistor? > > > > Is this how to do it? > > > > > > > > Collector---- +1.6V - 2.06V > > > > | > > > > PIC---/\/\/\/\/\---Base > > > > R1 | > > > > Emitter----/\/\/\/\/----LED-----GND > > > > > > > > What is value for R1? > > > > I'll need three transistors but can't find any quad smt transistor > packs > > in the mouser catalog. Do they exist? > > > > > > > > > > > > Ransom > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > From: Phil [mailto:phil1960us@y...] > > Sent: Thursday, May 06, 2004 3:40 PM > > To: > > Subject: [piclist] Re: Is 24 mA too much for PIC I/O pin if it has > a > > duty cyle? > > > > > > > > I agree with scott and have seen this with 3.2V battery powered > PICs. > > I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 > voltage > > drop from the PIC, I should have gotten 2.5V, full current and > > brightness from the LED with no dropping resistor. yes, I was > > somewhat over voltage but was PWMing the LED, same theory as you. > I > > was actually seeing, iirc, something less than 2V and the entire > PIC > > circuit pulled around 18 mA. Whether this is enough for your > circuit > > to work is hard to say. I wound up using a driver transistor for > the > > LED and it worked quite well. > > > > My guess is that you'll probably be ok - current-wise. since the > > chip is pretty cheap, why dont you just try it? set up a stress > test > > and see if the chip overheats or burns out. I believe the 20mA > limit > > is because of heating and thus a duty cycle that brings the > average > > below 20mA will probably be ok. Obviously, we aren't talking > about > > huge current spikes. > > > > > > --- In , "Scott Lee" <midl_man@y...> wrote: > > > This is not answering your question but pointing something out > that > > > you probably didn't realise... > > > > > > Remember that sources have internal impedance too. (And in this > > case > > > it is likely dynamic and changes with the amount of current > being > > > drawn by the sink.) > > > > > > Thus, I wouldn't expect the PIC to source the max rated current > at > > > the supply voltage. I would expect that as the load increases > the > > > actual voltage you see at the IO pin will drop. > > > > > > In other words, you might find that your current calculations > are > > > wrong because you won't be seeing 2.76V across the load resistor. > > > > > > --Scott > > > > > > --- In , "ransom peek" <ransom.peek@c...> > > > wrote: > > > > Using a PIC 16F688, the maximum current for an I/O pin is 20 > mA. > > > Is it > > > > ok to exceed this if the drain has a duty cycle as follows: > > > > > > > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > > > tolerance). > > > > The resistor is part of a 6 bit binary ladder generating audio > > > direct > > > > feed to headphones (6 resistors to six I/O pins, then tied > > > together - > > > > this pin has the lowest value resistor, so I am concerned). > The > > > ladder > > > > has a 10 uf series cap (dc block) and then to a 10K pot to > ground. > > > > Center of pot to headphones. > > > > > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new > > batteries > > > give > > > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > > > > > But in generating the audio sine wave the pin has a duty > cycle. > > > And, > > > > the headphones add some resistance, maybe 16 ohms. > > > > > > > > At 300 Hz, with approx 40 points for each sine wave, this pin > is > > on > > > for > > > > approx .002 second, then off .001 sec, then on again .002 sec > > then > > > off > > > > .001 sec, etc. So, about 67% duty cycle. > > > > > > > > Is there some risk that the PIC will fail? > > > > > > > > > > > > > > > > Ransom Peek > > > > Fort Collins CO > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > > instructions > > > > > > > > > > > > > > Yahoo! Groups Sponsor > > > > > > > > ADVERTISEMENT > > > > > <http://rd.yahoo.com/SIG=129our7br/M=295196.4901138.6071305.3001176/D > =gr > > > oups/S=1706554205:HM/EXP=1083966028/A=2128215/R=0/SIG=10se96mf6/*http > :/c > > ompanion.yahoo.com> click here > > > > > > > > <http://us.adserver.yahoo.com/l? > M=295196.4901138.6071305.3001176/D=group > > s/S=:HM/A=2128215/rand=407049941> > > > > > > > > _____ > > > > > Service. > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > Yahoo! Groups Sponsor > > ADVERTISEMENT <http://rd.yahoo.com/SIG=1297p4f5k/M=295196.4901138.6071305.3001176/D =gr > oups/S=1706554205:HM/EXP=1084040957/A=2128215/R=0/SIG=10se96mf6/*http :/c > ompanion.yahoo.com> click here > > <http://us.adserver.yahoo.com/l? M=295196.4901138.6071305.3001176/D=group > s/S=:HM/A=2128215/rand=248010147 > > _____ > > > Service. |
|
Phil, maybe you should read first a LED datasheet... :) Or understand better how can be driven a NPN transistor. Not always when is working it means that is ok. BTW, which LED have a dropout of 100mV at 20mA ? I need 100K of those... best regards, Vasile http://surducan.netfirms.com On Fri, 7 May 2004, Phil wrote: > I dunno, seems to work well for me. I have no trouble getting a > couple 100 mV over the LED's Vf. Your approach will, of course, also > work. > > --- In , "rtstofer" <rstofer@p...> wrote: > > > > I wouldn't put the resistor and LED in the emitter. They normally > > get install between Vcc and the collector and the emitter is > > grounded. Otherwise the emitter voltage rises and the base voltage > > has to keep rising and it can never get to Vcc - Vce (sat) + Vbe > > (sat) - in other words the collector voltage minus the drop across > > the transistor (collector to emitter) when saturated plus the > > voltage across the base emitter junction at saturation. > > > > You can get an estimate of R1 if you assume an emitter current of > > say 20 mA and a DC current gain of say 100 (pick your own values). > > You need base current of 200 uA (20 mA / 100). So, figure the > > voltage across the resistor when the PIC output is logic 1 (Voh > = ?) > > and the transistor is saturated (Vbe = 0.7). Given that voltage > and > > a current of 200 uA you can determine the resistor. > > > > Now, you might want to lower the value by half just in case the > > transistor doesn't quite get to saturation. > > > > Or you could just try 10K which is where I would start. > > > > --- In , "ransom peek" <ransom.peek@c...> > > wrote: > > > Phil - your experience of needing to use a transistor to drive > the > > LEDs > > > is key. Since I have 0.3V diode drop and battery voltage varies > > from > > > 1.53V(new) to 1.30V(old), I also will need a transistor to drive > > each > > > LED. > > > > > > > > > > > > > > > > > > Voltage could be: > > > > > > > > > > > > (1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V > > > > > > or (1.30V x 2) - 0.3V - 0.7V = 1.6V > > > > > > > > > > > > > > > > > > Should I use a SO2222A or MMBT3904 (surface mount) NPN > > transistor? > > > > > > Is this how to do it? > > > > > > > > > > > > Collector---- +1.6V - 2.06V > > > > > > | > > > > > > PIC---/\/\/\/\/\---Base > > > > > > R1 | > > > > > > Emitter----/\/\/\/\/----LED-----GND > > > > > > > > > > > > What is value for R1? > > > > > > I'll need three transistors but can't find any quad smt > transistor > > packs > > > in the mouser catalog. Do they exist? > > > > > > > > > > > > > > > > > > Ransom > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > From: Phil [mailto:phil1960us@y...] > > > Sent: Thursday, May 06, 2004 3:40 PM > > > To: > > > Subject: [piclist] Re: Is 24 mA too much for PIC I/O pin if it > has > > a > > > duty cyle? > > > > > > > > > > > > I agree with scott and have seen this with 3.2V battery powered > > PICs. > > > I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 > > voltage > > > drop from the PIC, I should have gotten 2.5V, full current and > > > brightness from the LED with no dropping resistor. yes, I was > > > somewhat over voltage but was PWMing the LED, same theory as you. > > I > > > was actually seeing, iirc, something less than 2V and the entire > > PIC > > > circuit pulled around 18 mA. Whether this is enough for your > > circuit > > > to work is hard to say. I wound up using a driver transistor for > > the > > > LED and it worked quite well. > > > > > > My guess is that you'll probably be ok - current-wise. since the > > > chip is pretty cheap, why dont you just try it? set up a stress > > test > > > and see if the chip overheats or burns out. I believe the 20mA > > limit > > > is because of heating and thus a duty cycle that brings the > > average > > > below 20mA will probably be ok. Obviously, we aren't talking > > about > > > huge current spikes. > > > > > > > > > --- In , "Scott Lee" <midl_man@y...> wrote: > > > > This is not answering your question but pointing something out > > that > > > > you probably didn't realise... > > > > > > > > Remember that sources have internal impedance too. (And in > this > > > case > > > > it is likely dynamic and changes with the amount of current > > being > > > > drawn by the sink.) > > > > > > > > Thus, I wouldn't expect the PIC to source the max rated current > > at > > > > the supply voltage. I would expect that as the load increases > > the > > > > actual voltage you see at the IO pin will drop. > > > > > > > > In other words, you might find that your current calculations > > are > > > > wrong because you won't be seeing 2.76V across the load > resistor. > > > > > > > > --Scott > > > > > > > > --- In , "ransom peek" > <ransom.peek@c...> > > > > wrote: > > > > > Using a PIC 16F688, the maximum current for an I/O pin is 20 > > mA. > > > > Is it > > > > > ok to exceed this if the drain has a duty cycle as follows: > > > > > > > > > > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > > > > tolerance). > > > > > The resistor is part of a 6 bit binary ladder generating > audio > > > > direct > > > > > feed to headphones (6 resistors to six I/O pins, then tied > > > > together - > > > > > this pin has the lowest value resistor, so I am concerned). > > The > > > > ladder > > > > > has a 10 uf series cap (dc block) and then to a 10K pot to > > ground. > > > > > Center of pot to headphones. > > > > > > > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new > > > batteries > > > > give > > > > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > > > > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > > > > > > > But in generating the audio sine wave the pin has a duty > > cycle. > > > > And, > > > > > the headphones add some resistance, maybe 16 ohms. > > > > > > > > > > At 300 Hz, with approx 40 points for each sine wave, this pin > > is > > > on > > > > for > > > > > approx .002 second, then off .001 sec, then on again .002 sec > > > then > > > > off > > > > > .001 sec, etc. So, about 67% duty cycle. > > > > > > > > > > Is there some risk that the PIC will fail? > > > > > > > > > > > > > > > > > > > > Ransom Peek > > > > > Fort Collins CO > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > > > instructions > > > > > > > > > > > > > > > > > > > > > Yahoo! Groups Sponsor > > > > > > > > > > > > ADVERTISEMENT > > > > > > > > > <http://rd.yahoo.com/SIG=129our7br/M=295196.4901138.6071305.3001176/D > > =gr > > > > > > oups/S=1706554205:HM/EXP=1083966028/A=2128215/R=0/SIG=10se96mf6/*http > > :/c > > > ompanion.yahoo.com> click here > > > > > > > > > > > > <http://us.adserver.yahoo.com/l? > > M=295196.4901138.6071305.3001176/D=group > > > s/S=:HM/A=2128215/rand=407049941> > > > > > > > > > > > > _____ > > > > > > > Service. > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links |
|
|
|
Well, I'm using a classic emitter follower. Check out horowitz/hill chapter 2. The LED I was using has a 2.3V Vf (from the data sheet you think I didn't read), the transistor has about 0.7 V drop. Running with 2 fresh akaline cells I get 3.2 - (2.3+.7) = 0.3. i.e. a couple hundred mV OVER the LED's Vf as I specifically said in my post (which I dont think you read carefully). --- In , Vasile Surducan <vasile@s...> wrote: > Phil, > maybe you should read first a LED datasheet... :) > Or understand better how can be driven a NPN transistor. > Not always when is working it means that is ok. > BTW, which LED have a dropout of 100mV at 20mA ? I need 100K of those... > best regards, > Vasile > http://surducan.netfirms.com > On Fri, 7 May 2004, Phil wrote: > > > I dunno, seems to work well for me. I have no trouble getting a > > couple 100 mV over the LED's Vf. Your approach will, of course, also > > work. > > > > --- In , "rtstofer" <rstofer@p...> wrote: > > > > > > I wouldn't put the resistor and LED in the emitter. They normally > > > get install between Vcc and the collector and the emitter is > > > grounded. Otherwise the emitter voltage rises and the base voltage > > > has to keep rising and it can never get to Vcc - Vce (sat) + Vbe > > > (sat) - in other words the collector voltage minus the drop across > > > the transistor (collector to emitter) when saturated plus the > > > voltage across the base emitter junction at saturation. > > > > > > You can get an estimate of R1 if you assume an emitter current of > > > say 20 mA and a DC current gain of say 100 (pick your own values). > > > You need base current of 200 uA (20 mA / 100). So, figure the > > > voltage across the resistor when the PIC output is logic 1 (Voh > > = ?) > > > and the transistor is saturated (Vbe = 0.7). Given that voltage > > and > > > a current of 200 uA you can determine the resistor. > > > > > > Now, you might want to lower the value by half just in case the > > > transistor doesn't quite get to saturation. > > > > > > Or you could just try 10K which is where I would start. > > > > > > --- In , "ransom peek" <ransom.peek@c...> > > > wrote: > > > > Phil - your experience of needing to use a transistor to drive > > the > > > LEDs > > > > is key. Since I have 0.3V diode drop and battery voltage varies > > > from > > > > 1.53V(new) to 1.30V(old), I also will need a transistor to drive > > > each > > > > LED. > > > > > > > > > > > > > > > > > > > > > > > > Voltage could be: > > > > > > > > > > > > > > > > (1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V > > > > > > > > or (1.30V x 2) - 0.3V - 0.7V = 1.6V > > > > > > > > > > > > > > > > > > > > > > > > Should I use a SO2222A or MMBT3904 (surface mount) NPN > > > transistor? > > > > > > > > Is this how to do it? > > > > > > > > > > > > > > > > Collector---- +1.6V - 2.06V > > > > > > > > | > > > > > > > > PIC---/\/\/\/\/\---Base > > > > > > > > R1 | > > > > > > > > Emitter----/\/\/\/\/----LED----- GND > > > > > > > > > > > > > > > > What is value for R1? > > > > > > > > I'll need three transistors but can't find any quad smt > > transistor > > > packs > > > > in the mouser catalog. Do they exist? > > > > > > > > > > > > > > > > > > > > > > > > Ransom > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Phil [mailto:phil1960us@y...] > > > > Sent: Thursday, May 06, 2004 3:40 PM > > > > To: > > > > Subject: [piclist] Re: Is 24 mA too much for PIC I/O pin if it > > has > > > a > > > > duty cyle? > > > > > > > > > > > > > > > > I agree with scott and have seen this with 3.2V battery powered > > > PICs. > > > > I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 > > > voltage > > > > drop from the PIC, I should have gotten 2.5V, full current and > > > > brightness from the LED with no dropping resistor. yes, I was > > > > somewhat over voltage but was PWMing the LED, same theory as you. > > > I > > > > was actually seeing, iirc, something less than 2V and the entire > > > PIC > > > > circuit pulled around 18 mA. Whether this is enough for your > > > circuit > > > > to work is hard to say. I wound up using a driver transistor for > > > the > > > > LED and it worked quite well. > > > > > > > > My guess is that you'll probably be ok - current-wise. since the > > > > chip is pretty cheap, why dont you just try it? set up a stress > > > test > > > > and see if the chip overheats or burns out. I believe the 20mA > > > limit > > > > is because of heating and thus a duty cycle that brings the > > > average > > > > below 20mA will probably be ok. Obviously, we aren't talking > > > about > > > > huge current spikes. > > > > > > > > > > > > --- In , "Scott Lee" <midl_man@y...> wrote: > > > > > This is not answering your question but pointing something out > > > that > > > > > you probably didn't realise... > > > > > > > > > > Remember that sources have internal impedance too. (And in > > this > > > > case > > > > > it is likely dynamic and changes with the amount of current > > > being > > > > > drawn by the sink.) > > > > > > > > > > Thus, I wouldn't expect the PIC to source the max rated current > > > at > > > > > the supply voltage. I would expect that as the load increases > > > the > > > > > actual voltage you see at the IO pin will drop. > > > > > > > > > > In other words, you might find that your current calculations > > > are > > > > > wrong because you won't be seeing 2.76V across the load > > resistor. > > > > > > > > > > --Scott > > > > > > > > > > --- In , "ransom peek" > > <ransom.peek@c...> > > > > > wrote: > > > > > > Using a PIC 16F688, the maximum current for an I/O pin is 20 > > > mA. > > > > > Is it > > > > > > ok to exceed this if the drain has a duty cycle as follows: > > > > > > > > > > > > > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > > > > > tolerance). > > > > > > The resistor is part of a 6 bit binary ladder generating > > audio > > > > > direct > > > > > > feed to headphones (6 resistors to six I/O pins, then tied > > > > > together - > > > > > > this pin has the lowest value resistor, so I am concerned). > > > The > > > > > ladder > > > > > > has a 10 uf series cap (dc block) and then to a 10K pot to > > > ground. > > > > > > Center of pot to headphones. > > > > > > > > > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new > > > > batteries > > > > > give > > > > > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > > > > > > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > > > > > > > > > But in generating the audio sine wave the pin has a duty > > > cycle. > > > > > And, > > > > > > the headphones add some resistance, maybe 16 ohms. > > > > > > > > > > > > At 300 Hz, with approx 40 points for each sine wave, this pin > > > is > > > > on > > > > > for > > > > > > approx .002 second, then off .001 sec, then on again .002 sec > > > > then > > > > > off > > > > > > .001 sec, etc. So, about 67% duty cycle. > > > > > > > > > > > > Is there some risk that the PIC will fail? > > > > > > > > > > > > > > > > > > > > > > > > Ransom Peek > > > > > > Fort Collins CO > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > > > > instructions > > > > > > > > > > > > > > > > > > > > > > > > > > > > Yahoo! Groups Sponsor > > > > > > > > > > > > > > > > ADVERTISEMENT > > > > > > > > > > > > > <http://rd.yahoo.com/SIG=129our7br/M=295196.4901138.6071305.3001176/D > > > =gr > > > > > > > > > oups/S=1706554205:HM/EXP=1083966028/A=2128215/R=0/SIG=10se96mf6/*http > > > :/c > > > > ompanion.yahoo.com> click here > > > > > > > > > > > > > > > > <http://us.adserver.yahoo.com/l? > > > M=295196.4901138.6071305.3001176/D=group > > > > s/S=:HM/A=2128215/rand=407049941> > > > > > > > > > > > > > > > > _____ > > > > > > > > > Service. > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > > Yahoo! Groups Links > > > > > > > > > |
|
|
|
Yaap, you've right I didn't :) However driving leds with emiter followers should be the last valid option. Just because of the transistor Vbe voltage drop, Vce saturation and the variable load voltage which is changing the transistor driving caracteristic. Else is ok. best, Vasile On Sat, 8 May 2004, Phil wrote: > Well, I'm using a classic emitter follower. Check out horowitz/hill > chapter 2. The LED I was using has a 2.3V Vf (from the data sheet > you think I didn't read), the transistor has about 0.7 V drop. > Running with 2 fresh akaline cells I get 3.2 - (2.3+.7) = 0.3. i.e. > a couple hundred mV OVER the LED's Vf as I specifically said in my > post (which I dont think you read carefully). > > --- In , Vasile Surducan <vasile@s...> wrote: > > > > > > Phil, > > maybe you should read first a LED datasheet... :) > > Or understand better how can be driven a NPN transistor. > > Not always when is working it means that is ok. > > BTW, which LED have a dropout of 100mV at 20mA ? I need 100K of > those... > > > > > > best regards, > > Vasile > > http://surducan.netfirms.com > > > > > > On Fri, 7 May 2004, Phil wrote: > > > > > I dunno, seems to work well for me. I have no trouble getting a > > > couple 100 mV over the LED's Vf. Your approach will, of course, > also > > > work. > > > > > > --- In , "rtstofer" <rstofer@p...> wrote: > > > > > > > > I wouldn't put the resistor and LED in the emitter. They > normally > > > > get install between Vcc and the collector and the emitter is > > > > grounded. Otherwise the emitter voltage rises and the base > voltage > > > > has to keep rising and it can never get to Vcc - Vce (sat) + Vbe > > > > (sat) - in other words the collector voltage minus the drop > across > > > > the transistor (collector to emitter) when saturated plus the > > > > voltage across the base emitter junction at saturation. > > > > > > > > You can get an estimate of R1 if you assume an emitter current > of > > > > say 20 mA and a DC current gain of say 100 (pick your own > values). > > > > You need base current of 200 uA (20 mA / 100). So, figure the > > > > voltage across the resistor when the PIC output is logic 1 (Voh > > > = ?) > > > > and the transistor is saturated (Vbe = 0.7). Given that voltage > > > and > > > > a current of 200 uA you can determine the resistor. > > > > > > > > Now, you might want to lower the value by half just in case the > > > > transistor doesn't quite get to saturation. > > > > > > > > Or you could just try 10K which is where I would start. > > > > > > > > --- In , "ransom peek" <ransom.peek@c...> > > > > wrote: > > > > > Phil - your experience of needing to use a transistor to drive > > > the > > > > LEDs > > > > > is key. Since I have 0.3V diode drop and battery voltage > varies > > > > from > > > > > 1.53V(new) to 1.30V(old), I also will need a transistor to > drive > > > > each > > > > > LED. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Voltage could be: > > > > > > > > > > > > > > > > > > > > (1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V > > > > > > > > > > or (1.30V x 2) - 0.3V - 0.7V = 1.6V > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Should I use a SO2222A or MMBT3904 (surface mount) NPN > > > > transistor? > > > > > > > > > > Is this how to do it? > > > > > > > > > > > > > > > > > > > > Collector---- +1.6V - 2.06V > > > > > > > > > > | > > > > > > > > > > PIC---/\/\/\/\/\---Base > > > > > > > > > > R1 | > > > > > > > > > > Emitter----/\/\/\/\/----LED----- > GND > > > > > > > > > > > > > > > > > > > > What is value for R1? > > > > > > > > > > I'll need three transistors but can't find any quad smt > > > transistor > > > > packs > > > > > in the mouser catalog. Do they exist? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Ransom > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > From: Phil [mailto:phil1960us@y...] > > > > > Sent: Thursday, May 06, 2004 3:40 PM > > > > > To: > > > > > Subject: [piclist] Re: Is 24 mA too much for PIC I/O pin if it > > > has > > > > a > > > > > duty cyle? > > > > > > > > > > > > > > > > > > > > I agree with scott and have seen this with 3.2V battery > powered > > > > PICs. > > > > > I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 > > > > voltage > > > > > drop from the PIC, I should have gotten 2.5V, full current and > > > > > brightness from the LED with no dropping resistor. yes, I was > > > > > somewhat over voltage but was PWMing the LED, same theory as > you. > > > > I > > > > > was actually seeing, iirc, something less than 2V and the > entire > > > > PIC > > > > > circuit pulled around 18 mA. Whether this is enough for your > > > > circuit > > > > > to work is hard to say. I wound up using a driver transistor > for > > > > the > > > > > LED and it worked quite well. > > > > > > > > > > My guess is that you'll probably be ok - current-wise. since > the > > > > > chip is pretty cheap, why dont you just try it? set up a > stress > > > > test > > > > > and see if the chip overheats or burns out. I believe the > 20mA > > > > limit > > > > > is because of heating and thus a duty cycle that brings the > > > > average > > > > > below 20mA will probably be ok. Obviously, we aren't talking > > > > about > > > > > huge current spikes. > > > > > > > > > > > > > > > --- In , "Scott Lee" <midl_man@y...> > wrote: > > > > > > This is not answering your question but pointing something > out > > > > that > > > > > > you probably didn't realise... > > > > > > > > > > > > Remember that sources have internal impedance too. (And in > > > this > > > > > case > > > > > > it is likely dynamic and changes with the amount of current > > > > being > > > > > > drawn by the sink.) > > > > > > > > > > > > Thus, I wouldn't expect the PIC to source the max rated > current > > > > at > > > > > > the supply voltage. I would expect that as the load > increases > > > > the > > > > > > actual voltage you see at the IO pin will drop. > > > > > > > > > > > > In other words, you might find that your current > calculations > > > > are > > > > > > wrong because you won't be seeing 2.76V across the load > > > resistor. > > > > > > > > > > > > --Scott > > > > > > > > > > > > --- In , "ransom peek" > > > <ransom.peek@c...> > > > > > > wrote: > > > > > > > Using a PIC 16F688, the maximum current for an I/O pin is > 20 > > > > mA. > > > > > > Is it > > > > > > > ok to exceed this if the drain has a duty cycle as > follows: > > > > > > > > > > > > > > > > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > > > > > > tolerance). > > > > > > > The resistor is part of a 6 bit binary ladder generating > > > audio > > > > > > direct > > > > > > > feed to headphones (6 resistors to six I/O pins, then tied > > > > > > together - > > > > > > > this pin has the lowest value resistor, so I am > concerned). > > > > The > > > > > > ladder > > > > > > > has a 10 uf series cap (dc block) and then to a 10K pot to > > > > ground. > > > > > > > Center of pot to headphones. > > > > > > > > > > > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new > > > > > batteries > > > > > > give > > > > > > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > > > > > > > > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > > > > > > > > > > > But in generating the audio sine wave the pin has a duty > > > > cycle. > > > > > > And, > > > > > > > the headphones add some resistance, maybe 16 ohms. > > > > > > > > > > > > > > At 300 Hz, with approx 40 points for each sine wave, this > pin > > > > is > > > > > on > > > > > > for > > > > > > > approx .002 second, then off .001 sec, then on again .002 > sec > > > > > then > > > > > > off > > > > > > > .001 sec, etc. So, about 67% duty cycle. > > > > > > > > > > > > > > Is there some risk that the PIC will fail? > > > > > > > > > > > > > > > > > > > > > > > > > > > > Ransom Peek > > > > > > > Fort Collins CO > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow > the > > > > > instructions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Yahoo! Groups Sponsor > > > > > > > > > > > > > > > > > > > > ADVERTISEMENT > > > > > > > > > > > > > > > > > > <http://rd.yahoo.com/SIG=129our7br/M=295196.4901138.6071305.3001176/D > > > > =gr > > > > > > > > > > > > > oups/S=1706554205:HM/EXP=1083966028/A=2128215/R=0/SIG=10se96mf6/*http > > > > :/c > > > > > ompanion.yahoo.com> click here > > > > > > > > > > > > > > > > > > > > <http://us.adserver.yahoo.com/l? > > > > M=295196.4901138.6071305.3001176/D=group > > > > > s/S=:HM/A=2128215/rand=407049941> > > > > > > > > > > > > > > > > > > > > _____ > > > > > > > > > > > Service. > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > Yahoo! Groups Links |
|
|
|
ok, what bad effects will I see with this? shorter battery life? shorter component life? I've drained several batteries with this and get pretty much the lifespan you would expect. --- In , Vasile Surducan <vasile@s...> wrote: > > Yaap, you've right I didn't :) > However driving leds with emiter followers should be the last valid > option. > Just because of the transistor Vbe voltage drop, Vce saturation and the > variable load voltage which is changing the transistor driving > caracteristic. Else is ok. > > best, > Vasile > > On Sat, 8 May 2004, Phil wrote: > > > Well, I'm using a classic emitter follower. Check out horowitz/hill > > chapter 2. The LED I was using has a 2.3V Vf (from the data sheet > > you think I didn't read), the transistor has about 0.7 V drop. > > Running with 2 fresh akaline cells I get 3.2 - (2.3+.7) = 0.3. i.e. > > a couple hundred mV OVER the LED's Vf as I specifically said in my > > post (which I dont think you read carefully). > > > > --- In , Vasile Surducan <vasile@s...> wrote: > > > > > > > > > Phil, > > > maybe you should read first a LED datasheet... :) > > > Or understand better how can be driven a NPN transistor. > > > Not always when is working it means that is ok. > > > BTW, which LED have a dropout of 100mV at 20mA ? I need 100K of > > those... > > > > > > > > > best regards, > > > Vasile > > > http://surducan.netfirms.com > > > > > > > > > On Fri, 7 May 2004, Phil wrote: > > > > > > > I dunno, seems to work well for me. I have no trouble getting a > > > > couple 100 mV over the LED's Vf. Your approach will, of course, > > also > > > > work. > > > > > > > > --- In , "rtstofer" <rstofer@p...> wrote: > > > > > > > > > > I wouldn't put the resistor and LED in the emitter. They > > normally > > > > > get install between Vcc and the collector and the emitter is > > > > > grounded. Otherwise the emitter voltage rises and the base > > voltage > > > > > has to keep rising and it can never get to Vcc - Vce (sat) + Vbe > > > > > (sat) - in other words the collector voltage minus the drop > > across > > > > > the transistor (collector to emitter) when saturated plus the > > > > > voltage across the base emitter junction at saturation. > > > > > > > > > > You can get an estimate of R1 if you assume an emitter current > > of > > > > > say 20 mA and a DC current gain of say 100 (pick your own > > values). > > > > > You need base current of 200 uA (20 mA / 100). So, figure the > > > > > voltage across the resistor when the PIC output is logic 1 (Voh > > > > = ?) > > > > > and the transistor is saturated (Vbe = 0.7). Given that voltage > > > > and > > > > > a current of 200 uA you can determine the resistor. > > > > > > > > > > Now, you might want to lower the value by half just in case the > > > > > transistor doesn't quite get to saturation. > > > > > > > > > > Or you could just try 10K which is where I would start. > > > > > > > > > > --- In , "ransom peek" <ransom.peek@c...> > > > > > wrote: > > > > > > Phil - your experience of needing to use a transistor to drive > > > > the > > > > > LEDs > > > > > > is key. Since I have 0.3V diode drop and battery voltage > > varies > > > > > from > > > > > > 1.53V(new) to 1.30V(old), I also will need a transistor to > > drive > > > > > each > > > > > > LED. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Voltage could be: > > > > > > > > > > > > > > > > > > > > > > > > (1.53V x 2) - 0.3V (diode) - 0.7V (PIC I/O drop) = 2.06V > > > > > > > > > > > > or (1.30V x 2) - 0.3V - 0.7V = 1.6V > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Should I use a SO2222A or MMBT3904 (surface mount) NPN > > > > > transistor? > > > > > > > > > > > > Is this how to do it? > > > > > > > > > > > > > > > > > > > > > > > > Collector---- +1.6V - 2.06V > > > > > > > > > > > > | > > > > > > > > > > > > PIC---/\/\/\/\/\---Base > > > > > > > > > > > > R1 | > > > > > > > > > > > > Emitter----/\/\/\/\/----LED--- -- > > GND > > > > > > > > > > > > > > > > > > > > > > > > What is value for R1? > > > > > > > > > > > > I'll need three transistors but can't find any quad smt > > > > transistor > > > > > packs > > > > > > in the mouser catalog. Do they exist? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Ransom > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: Phil [mailto:phil1960us@y...] > > > > > > Sent: Thursday, May 06, 2004 3:40 PM > > > > > > To: > > > > > > Subject: [piclist] Re: Is 24 mA too much for PIC I/O pin if it > > > > has > > > > > a > > > > > > duty cyle? > > > > > > > > > > > > > > > > > > > > > > > > I agree with scott and have seen this with 3.2V battery > > powered > > > > > PICs. > > > > > > I was trying to power a 2.3V LED from a PIC pin. Given a 0.7 > > > > > voltage > > > > > > drop from the PIC, I should have gotten 2.5V, full current and > > > > > > brightness from the LED with no dropping resistor. yes, I was > > > > > > somewhat over voltage but was PWMing the LED, same theory as > > you. > > > > > I > > > > > > was actually seeing, iirc, something less than 2V and the > > entire > > > > > PIC > > > > > > circuit pulled around 18 mA. Whether this is enough for your > > > > > circuit > > > > > > to work is hard to say. I wound up using a driver transistor > > for > > > > > the > > > > > > LED and it worked quite well. > > > > > > > > > > > > My guess is that you'll probably be ok - current-wise. since > > the > > > > > > chip is pretty cheap, why dont you just try it? set up a > > stress > > > > > test > > > > > > and see if the chip overheats or burns out. I believe the > > 20mA > > > > > limit > > > > > > is because of heating and thus a duty cycle that brings the > > > > > average > > > > > > below 20mA will probably be ok. Obviously, we aren't talking > > > > > about > > > > > > huge current spikes. > > > > > > > > > > > > > > > > > > --- In , "Scott Lee" <midl_man@y...> > > wrote: > > > > > > > This is not answering your question but pointing something > > out > > > > > that > > > > > > > you probably didn't realise... > > > > > > > > > > > > > > Remember that sources have internal impedance too. (And in > > > > this > > > > > > case > > > > > > > it is likely dynamic and changes with the amount of current > > > > > being > > > > > > > drawn by the sink.) > > > > > > > > > > > > > > Thus, I wouldn't expect the PIC to source the max rated > > current > > > > > at > > > > > > > the supply voltage. I would expect that as the load > > increases > > > > > the > > > > > > > actual voltage you see at the IO pin will drop. > > > > > > > > > > > > > > In other words, you might find that your current > > calculations > > > > > are > > > > > > > wrong because you won't be seeing 2.76V across the load > > > > resistor. > > > > > > > > > > > > > > --Scott > > > > > > > > > > > > > > --- In , "ransom peek" > > > > <ransom.peek@c...> > > > > > > > wrote: > > > > > > > > Using a PIC 16F688, the maximum current for an I/O pin is > > 20 > > > > > mA. > > > > > > > Is it > > > > > > > > ok to exceed this if the drain has a duty cycle as > > follows: > > > > > > > > > > > > > > > > > > > > > > > > I/O pin feeds 120 ohm 5% resistor (114 ohms at low end of > > > > > > > tolerance). > > > > > > > > The resistor is part of a 6 bit binary ladder generating > > > > audio > > > > > > > direct > > > > > > > > feed to headphones (6 resistors to six I/O pins, then tied > > > > > > > together - > > > > > > > > this pin has the lowest value resistor, so I am > > concerned). > > > > > The > > > > > > > ladder > > > > > > > > has a 10 uf series cap (dc block) and then to a 10K pot to > > > > > ground. > > > > > > > > Center of pot to headphones. > > > > > > > > > > > > > > > > 3 volt circuit with 2N5819 schotky barrier diode, so new > > > > > > batteries > > > > > > > give > > > > > > > > (1.53 volts x 2) - 0.3 volt drop = 2.76 volts max. > > > > > > > > > > > > > > > > 2.76 volts / 114 ohms = 24.2 mA ! > > > > > > > > > > > > > > > > But in generating the audio sine wave the pin has a duty > > > > > cycle. > > > > > > > And, > > > > > > > > the headphones add some resistance, maybe 16 ohms. > > > > > > > > > > > > > > > > At 300 Hz, with approx 40 points for each sine wave, this > > pin > > > > > is > > > > > > on > > > > > > > for > > > > > > > > approx .002 second, then off .001 sec, then on again .002 > > sec > > > > > > then > > > > > > > off > > > > > > > > .001 sec, etc. So, about 67% duty cycle. > > > > > > > > > > > > > > > > Is there some risk that the PIC will fail? > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Ransom Peek > > > > > > > > Fort Collins CO > > > > > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow > > the > > > > > > instructions > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Yahoo! Groups Sponsor > > > > > > > > > > > > > > > > > > > > > > > > ADVERTISEMENT > > > > > > > > > > > > > > > > > > > > > > > <http://rd.yahoo.com/SIG=129our7br/M=295196.4901138.6071305.3001176/D > > > > > =gr > > > > > > > > > > > > > > > > > oups/S=1706554205:HM/EXP=1083966028/A=2128215/R=0/SIG=10se96mf6/*http > > > > > :/c > > > > > > ompanion.yahoo.com> click here > > > > > > > > > > > > > > > > > > > > > > > > <http://us.adserver.yahoo.com/l? > > > > > M=295196.4901138.6071305.3001176/D=group > > > > > > s/S=:HM/A=2128215/rand=407049941> > > > > > > > > > > > > > > > > > > > > > > > > _____ > > > > > > > > > > > > > Service. > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > > instructions > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > > Yahoo! Groups Links > > > > > > > > > |