2

Note: I have read Controlling many LEDs with few GPIO pins, but I can't buy additional parts (Degree project)

The end result is to make a noughts and crosses grid with 2 LEDs per grid cell. This means I will need to be able to light up 18 LEDs individually. Therefore wiring two LEDs in parallel in each cell means I can light each LED depending on the direction of voltage bias applied.

This means I will need a total of 18 RPi connections, however there are only 17 GPIO pins.

I have looked at Charlie- and Multi-plexing and a couple of other LED matrices, but none of these seem to be suitable.

Any ideas?

  • Why aren't multiplexing and charlieplexing suitable? Works perfectly fine. Only downside is, that if you need to light up multiple leds at the same time, you'd need to have the software switch between leds very fast. (Also limit the amount leds in one row, that light up at the same time, since transistors will probably also be forbidden) – Gerben Mar 13 '14 at 17:17
  • @Gerben, Yeah, I'm writing the program myself and I'm not a skilled enough programmer to write a super-efficient code. – Pingk Mar 20 '14 at 22:50
  • Not a true answer to my own problem, but my lecturer says it's fine to light up 16 LEDs, rather than 18 to show it off as a proof of concept. Unfortunately I haven't found a satisfying solution to the original question. – Pingk Mar 20 '14 at 22:54
  • Here is how to do charlieplexing with some code example. You couldn't find it because its about buttons. – Piotr Kula Mar 21 '14 at 21:07
  • @ppumkin, Thanks, but I don't want to use buttons. I want my Python code to wait for a valid user input before turning on an LED. From what I can tell lighting up multiple LEDs using plexing methods is difficult. For example, if I have a 3x3 grid of LEDs but only want to light up the diagonal top-left to bottom-right, and then top-middle, that seems to require a lot of coding, which I am not (yet) proficient at. – Pingk Mar 21 '14 at 21:34
2

Here is a similar question regarding controlling multiple LEDs with a Raspberry Pi with limited GPIO. As @Fred mentioned there are additional headers, but using an I/O extension such as a multiplexer would further expand your possibilities.

0

If you have a Revision 2 Pi, there's the P5 header, which adds another 4 GPIO pins. This could be an easy way around it.

  • Unfortunately I have a first generation RPi, so I can't do that :( – Pingk Mar 20 '14 at 22:51
  • As Mike suggested, a multiplexer is probably the way to go then. More specifically, a shift and latch register. A chip like the MC74H595 uses three GPIO pins to get eight outputs. They're fairly straight forward to use. – Fred Mar 22 '14 at 17:00
0

if you have a skilled solderer, you could desolder the ok-led from the raspi's face, and wire one to that, since thats a controllable led

  • I might have considered that if this project was something I was sinking a lot of time into, but this is just a small university project and I would like to use it again for other things afterwards – Pingk Mar 20 '14 at 22:52
0

You can use this circuit or an equivalent one.

It's serial based so it only uses 5 pins (VCC, Ground, SERIAL, SERIALCLK, WRITECLK).

If you use only one board you can control 32 outputs

Multiple boards multiplies the possible outputs, but you need to send more bytes and latency will be higher.

  • Your link is no longer valid. – Intervalia Jan 24 '18 at 23:01

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.