Pins on an Arduino

arduinopins

If I'm running out of pins on an Arduino, short of buying a second one or getting a Mega board, is there a way to get more connected to the one board? Do I need to worry about overloading it?

Best Answer

Have you used up all your analog pins as well? They can also be used as digital input/output by just referring to them as digital pins pins 14 to 19.

After you used all of them as well you might consider using a shift register IC. These chips will convert serial data into parallel data. The 8 bit versions will take serial data on three pins and output parallel data on 8 pins, giving you 5 extra pins. A very nice explanation is done by Dave Clausen at NYC Resistor.

There is actually a possibility of overloading your arduino. Not by using too much pins, but by drawing too much current from the pins, by hooking up too much stuff to your pins. The Atmega168 datasheet says that the pins have an absolute maximum current of 40mA. This would be equivalent to two LED's in parallel. Anything more than one LED (20mA) should be switched through a transistor or transistor array. This is also explained in the video mentioned above and by Tom Igoe.