View previous topic :: View next topic |
Author |
Message |
Nick Guest
|
low current (1 ma) LED is draining 25ma |
Posted: Wed Sep 15, 2004 1:09 pm |
|
|
I hooked the LED directly to the pic port and the ground. Did I do something wrong? should there be a resistor inbetween the LED and ground? When is it drawing so much current?
Nick |
|
|
alexbilo
Joined: 01 Jun 2004 Posts: 39 Location: Trois-Rivières
|
|
Posted: Wed Sep 15, 2004 1:17 pm |
|
|
Hi,
You should always use a resistor to limit the LED current. Omitting this resistor can lead the destruction of the pin and/or the LED.
Most of the time 220 ohms is a good resistor value, but you can calculate it more precisely knowing the LED voltage and the current that you want.
Good luck, _________________ Alex |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed Sep 15, 2004 1:30 pm |
|
|
First you need to know the PIC pin voltage at the current you intend to draw. You can get this from the PIC datasheet, but for 1mA and a 5V supply we can guess it will be 4.9V
Next you need the LED voltage at the intended current. This comes from the LED datasheet. For now we will guess 1.8V.
The resistor will drop the remaining voltage: 4.9-1.8 = 3.1V
Ohms law gives us R=E/I = 3.1/.001 = 3100 Ohms
3300 Ohms would give 3.1/3300 = .9mA
2700 Ohms would give 3.1/2700 = 1.1mA
so any value between 2.7K and 3.3K will give very close to 1mA. Even 1K will give only 3.1mA which should be fine unless you are concerned over battery life. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Nick Guest
|
|
Posted: Thu Sep 16, 2004 10:35 am |
|
|
Thank you for that detail! thats exactly what I needed to know to solve this problem
Nick |
|
|
Guest
|
|
Posted: Thu Sep 16, 2004 1:26 pm |
|
|
Could I use this to limit current the powering the pic from my 4.5v source?
Nick |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Thu Sep 16, 2004 2:17 pm |
|
|
Quote: | Could I use this to limit current the powering the pic from my 4.5v source?
|
I wouldn't do that! The voltage would not be very stable. The more current the pic draws, the lower the voltage would get. |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Thu Sep 16, 2004 4:55 pm |
|
|
Never try to limit the current that is supplying VCC to an IC. IC's like to eat whatever power they need. If you do try it the part will most likely act erratic. You can limit the current that is flowing in or out of each individual pin but never VCC or GND. Each transistor junction, inside the part, needs to be biased correctly for the part to work properly and if you start limiting the current then all of those biasing voltages are not ballanced anymore. Try using parts that are designed to be low power parts instead.
Ronald |
|
|
|