# I have a PIXAXE-20X2 and want to connect 65 LEDs as outputs! Is it possible?

I have to make a traffic light for a school project and I decided to use a PICAXE-20X2 microcontroller which has 8 output pins. I have 10 LEDs for the red, amber & green lights, 10 also for the red and green man, 10 for the walk and the same for the wait sign. I have connected the 10 for each pin in parallel and a maximum of 20 LEDs will be on at a time. I want to know if this will work?

• The maximum current from an output pin is 20 mA, so you probably require transistors between the chip output pins and your groups of LEDs. Commented Dec 23, 2015 at 20:31
• Thanks! That is a very helpful idea. Could you explain this a bit further? Commented Dec 23, 2015 at 21:07
• Is it essentially a relay Commented Dec 23, 2015 at 21:16
• Peter's idea would use a transistor as a power switch to connect the LEDs to an appropriately robust power source - this way, you can control almost any arbitrarily large amount of power provided the transistor can withstand the current and is biased properly. To get more immediate feedback, ping users with the "@" symbol - in this case, @PeterBennett alerts his account that you are writing to him directly.
– user39962
Commented Dec 23, 2015 at 21:23
• @SeanBoddy Would i have to use a darlington pair? Commented Dec 23, 2015 at 21:35

Since the maximum output current for a PICAXE pin is 20 mA, you will need a driver transistor between the PICAXE and each group of 10 LEDs.

Something like this:

simulate this circuit – Schematic created using CircuitLab

The value of the resistors in series with the LEDs should be selected to produce the desired current in the LEDs (not too close to the Absolute Maximum rating!)

The transistor can be any NPN type that can handle the total current of the 10 LEDs.

If you use a separate power supply for the LEDs, its ground must be connected to the transistor's emitter, and to the PICAXE ground.

• rapidonline.com/pdf/82-0668e.pdf Commented Dec 23, 2015 at 22:44
• Would that be a suitable componenet Commented Dec 23, 2015 at 22:44
• Also, would it just be a single driver per output pin Commented Dec 23, 2015 at 22:47
• The ULN2803A would be a good choice - it can handle 500 mA maximum, per output (but I'd try to keep under ~450 mA). If you need more than 450 mA for a group of LEDs, then you should use two (or more, as needed) channels of the ULN2803A. The ULN2803A includes a base resistor on each input, so R4 in my drawing is not needed. Commented Dec 23, 2015 at 22:52
• With the ULN2803A would i just connect the picaxe output to a pin on the left hand side and the right hand side to the LEDs Commented Dec 23, 2015 at 23:31