Electronic – arduino – Using Arduino-UNO to control LED pins Greater than the Number of I/O Pins

arduinoled

Our class have been given a project to create a miniature of our department building. It will have 11 laboratory rooms, 1 server room, 1 faculty room. Each laboratory room will contain 18 pc's, each one represented by an LED. Server and faculty room will each have 3 LED.

Now each group of 3 LED's must be controlled individually using a computer program. So that's 68 groups of LED that needs individual control.

We are planning to use an Arduino UNO which have only 13 I/O pins. Is there any way to use those 13 I/O pins for 68 separate controls?

The deadline is near and we're in quite a pinch. Any answer will be tremendously appreciated, thank you in advance.

Best Answer

There are basicaly two approaches, which might be combined: I/O extension, and multiplexing.

There are chips that are connected to your Arduino using a few pins (2 or 3), and that can provide more IO pins. Examples are 74HC595 shift register (requires 3 pins, provides 8 output pins, can be chained) and the MCP23017 I/O expander (requires 2 pins, provides 16 I/O pins, 8 such chips can share these two pins).

Multiplexing means that your split your I/O pins in rows and columns, let's say 6 rows and 7 columns, and you put a LED on each row/column crosspoint. By manipulating the row and column piuns, you can selectively light up one LED (or a row of LEDs, or a column of LEDs). Do this fast, and the human eye will get the impression that all LEDs are on. This will give you control over up to 42 LEds.

There is an advanced trick called Charlieplexing which allows you to control N * (N - 1 ) LEDs with N pins. I have used this for 12 LEDs (4 pins0, but I am not sure it works well enough for larger N.

What you choose is up to you. Personally I would consider either freeing up more Arduino pins and using the pins directly in a matrix, or using MCP23017's.