Turning lights on based on a number

Thread Starter

MCrowe

Joined May 29, 2011
69
So, The lights works, but I think I might be connecting too many LED's to the one PIC. I know it can handle them at the moment but its a lot of current to be sinking. If I light up 6 LED's at once, minimum 20mA each, Im already up to, and probably over, 120mA, which doesn't seem sensible considering im connecting a bunch of other circuits to the PIC.

What happens if you overload the PIC. Max sink current is 200mA. Does it get hot?? Or pop, or just stop working?

And , is there a better way to connect LED's? I dont want a lot of peripheral circuitry? Analogue electronics is not my strong point, and I dont have any easy way of making good circuit boards. So whats the best way to power that many LED's.

I suppose I could use somehting as simple as AND gates, if the can sink enough current. At least that would isolate the LED's from the PIC. But surely there is a better approach. Maybe an IC designed just for this purpose? I would have though there would be something but I just keep finding 7 segment LED displays. All I want is an IC that will except 16 inputs with direct control over 16 outputs, and will handle higher currents than my PIC. Could anyone suggest something??? Thanks?
 

Thread Starter

MCrowe

Joined May 29, 2011
69
I was just looking at something similar, the ULN2003N... Thanks for the advice though guys. What the difference between the two recommended ones? I.e. What's a Pre-biased transistor, and why would it be better?
 

Thread Starter

MCrowe

Joined May 29, 2011
69
Wait I think I get it. Are the Pre-biased transistors ready to go within some set limit? As in no external parts or something?

Do the IC packaged transistors need resistors or external parts?
 

ErnieM

Joined Apr 24, 2011
8,377
Wait I think I get it. Are the Pre-biased transistors ready to go within some set limit? As in no external parts or something?

Do the IC packaged transistors need resistors or external parts?
Both devices need a series resistor with the LED to set the LED current.

With the IC you buy a package and get 6 or 8 devices in a shot.

With the transistor you buy N devices to light N LEDs and can drop them where you wish. These type of transistors come with a base resistor built into the package so you can just wire base to micro, emitter to ground, and collector to LED/Resistor to Vdd for each light.

Now another alternative if you need a "high side switch" to provide a positive voltage (and not just switch to ground) is to use a low dropout regulator with an enable input. These things are so cheap now they cost about the same as a single transistor.
 
Top