PDA

View Full Version : 8 Leds



leonel
- 23rd June 2005, 09:33
Hello.
I'm using PIC16F872 to turn on 8 led's at the same time. There are any problems in having the 8 ledīs on at the same time? I'll have the same brightness in all ledīs?
What do you think using Shift and store bus registers?
I'll have 10 outputīs (8 ledīs+1relay+1buzzer) and 4 inputīs (3sensors+1switch).
Regards

BobK
- 23rd June 2005, 14:32
Hello Leonel,

The data cheet for the 16F872 says the max current sink OR source for BOTH ports A & B is 200ma. So depending on the current draw of your LEDs I think you are safe to put all of them on at the same time. I don't like stressing a circuit so I use transistors or driver packages like a ULN2003 or similar types to drive external devices. The boards I just made for a project have transistor drivers for the LEDs and I used ULN2003s to drive remote LED display boards just to keep my project compatable with the existing wiring and circuits.

As for shift and store registers, I guess it depends on the overall project requirements. I'm working on some add-ons to my project and am looking at using the I2C PCF8574's for I/O ports. Nav Micro has posted some of his projects on this Forum in the past along with photos of his boards using 8574's for I/O.

If you're working on an alarm project, that's my area of interest. I have been in the alarm business for over 30 years now and have made numerous devices that have kept my operation ahead of the other alarm companies in my area. My current project is a 160 zone annunciator system for 2 apartment buildings. I am replacing and old system that has no replacement parts available. It's nearing completion in the next few weeks.

Have fun with your project. If I can help in the future let me know.

BobK

leonel
- 23rd June 2005, 15:24
Today I decided to use PIC16F57 because itīs cheaper than PIC16F872. PIC16F57 has a max. output current sourced/sunk by a single I/O port (PORTA, B or C) of 50 mA. If i use a 270R resistance from 5V, iīll have 18mA thatīs quite enough for my led brightness.
I wonder if ULN2003A or other component make my project "cleaner". If i only use the PIC16F57 i can trust in my project? In normal conditions Iīll not have problems? :)
My project itīs making a cooling machine, that has ledīs to advise in what point of the machine goes.
Regards

Bruce
- 23rd June 2005, 21:10
You'll have <18mA for each LED with a 270-ohm series limiting resistor at 5V.

LED current = Vcc - Vled/R. Vled is the voltage drop of the LED. R is the series limiting resistor.

With Vcc = 5V, Vled = 1.2V and R=270, then (5V-1.2V)/270 = ~14mA.

8 x 14mA = ~112mA total for 8 LED's. Should be fine. Most LED's will glow pretty good with just 8-10mA.

BigWumpus
- 24th June 2005, 22:15
You know, there are LEDs burning with 3mA ?
I think they will be better to connect directly to a PIC.