I have 64 LEDs connected to one another using a single long wire. I want to control each LED individually to create patterns of lightening. And I am using GPIO pins to achieve that. I search but couldn't a way to control each LED individually. Any suggestions?

  • 1
    Do you have any other information which you think might be useful?
    – joan
    May 8, 2015 at 20:22
  • This cannot be answered without a wiring diagram. connecting 64 LEDs to a single GPIO pin will simply not work, not to mention letting you "control each LED individually". Dec 10, 2020 at 12:27

2 Answers 2


The problem with your current approach is the fact that wire does not have memory. In your current configuration you could use serial connected flip-flops. (http://en.wikipedia.org/wiki/Shift_register)

You can use the following, dedicated circuit or a equivalent one http://www.aliexpress.com/store/product/Raspberry-Pi-Accessories-Infinity-Cascade-BPI-IO-Extend-Board-BPI-A-004-Compatible-with-Banana-Pi/1534002_32237049558.html

What it does? It offers you the possibility of output an infinite? number of components by cascading.

The principle is simple. Serial transmission

You send 100011101....on a single GPIO and the opposite LEDS light up.


I would consider having a look at the MAX7219 IC. This costs less than $1 and can control a 64 LED matrix. The IC contains memory of the state of each LED and also controls the multiplexing to keep them all illuminated as needed. What's more, is it uses SPI and hence only requires 2 GPIO pins to control the whole story. You will have to rewire your LEDs into eight groups of eight common anode or common cathode arrangements.

Although primarily designed for controlling 7 segment LEDs, it has a perfectly fine mode for controlling 8x8 matrix of LEDs. It doesn't care that the matrix has become a single line ... your software will be controlling which LEDs are lit anyway.

Home page for the IC is here:


More available on Google and YouTube.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.