Matrx007
Matrx007

Reputation: 25

Raspberry Pi - More GPIO pins or/and more leds

Like the title said, I need more GPIO pins or just a way to control a lot leds

So I need to control more than 40 leds, or even more, anyway more than raspberry pi has GPIO pins. So I know that there is extension board for Raspberry Pi that extends the GPIO, that's one way to solve it. If anyone ever had one can recommend it to me.

Another idea that I got was to use led matrix but instead use the same idea, I mean for example led row 1 and column 4 or so, but the leds won't be in Grid, instead, they will be separated with wires. But the problem, if we want to do like that:

X O X
O X O
X O X

where X is on and O is off, it's not possible. All leds will be lit up, not like in the pattern. If anyone has the solution to one of the ideas then please share it with me, thank you for your time!

Upvotes: 0

Views: 760

Answers (1)

Devdatt
Devdatt

Reputation: 82

You want to control lots of LEDs using as few GPIO pins as possible.

Solution

The way to do this is to use a technique called Charlieplexing. The name comes from the inventor, Charlie Allen of the company Maxim, and the technique takes advantage of the feature of GPIO pins that allows them to be changed from outputs to inputs while a program is running. When a pin is changed to be an input, not enough current will flow through it to light an LED or influence other pins connected to the LED that are set as outputs.enter image description here

use breadboard

enter image description here

for more information go to this link

http://razzpisampler.oreilly.com/ch04.html

Upvotes: 1

Related Questions