Project involving lots of i/o ports and central processor

Hi everyone,

I am beginning an art project that needs to involve 150 buttons switching 150 LEDs on and off (that means 300 ports in total!). They also all need to be connected to a central or master computer somehow that can know the state of each button or LED (on or off) and also send a signal to switch the LEDs on (overriding the physical button). The central computer is needed because I'd like to create some level of gamification or interactivity with the set of LEDs.

I have done a number of Arduino projects before but not of this scale - I know it is ambitious but would be great to get any suggestions on where to begin. The main challenges I have firstly are the number of LEDs and sensors, but perhaps more so the need for a central computer of sorts.

I have thought of the following options as potential starting points, but haven’t looked deep into any of them yet so I don't know if any of them are feasible...

  • Using multiple Arduinos controlling a number of LEDs / buttons that are plugged into a web server via ethernet cable, and doing the processing through a web app of sorts.
  • Chaining a bunch of Arduinos together with i2c or the RS485 (similar to the option above, but without the server)
  • Using lots of shift registers for both the LEDs and the inputs, and doing the processing inside a single Arduino.
  • Something that doesn’t use Arduino at all, that has at least 300 i/o ports?

Any suggestions or comments on my proposed method would be super helpful!

Both the buttons and LEDs can be placed in a matrix, then you need 25 pins for both (in a 10x15 matrix) or 50 pins total, so a single Arduino Mega will do just fine - it has 54 digital and 16 analog pins.
By flashing the LEDs very fast you can make it appear to have many on at the same time. This is going to be your main challenge.

wvmarle:
Both the buttons and LEDs can be placed in a matrix, then you need 25 pins for both (in a 10x15 matrix) or 50 pins total, so a single Arduino Mega will do just fine - it has 54 digital and 16 analog pins.
By flashing the LEDs very fast you can make it appear to have many on at the same time. This is going to be your main challenge.

Thank you for this, I will look into this avenue for a start, however I also hoped that I would eventually be able to scale up the project and swap the LEDs for RGB LEDs or addressable LEDs, and also add more LEDs / sensors to the array so a matrix option with a single Arduino wouldn't be an option if I were to do that.

Say for instance I needed 200 LEDs / 200 sensors instead, what would be the logical next solution granted I can't create one on a single Mega?

Thanks again!

Look at how LED cubes are done.

They use even more LEDs, in colour, on a single Arduino (or compatible) but with a lot of port expanders. You're doing a simple version of that as it's just 2D, not 3D.

I do understand the desire to have more LEDs (more and more and more and more and then a third dimension and then a few more) but what's the practical use of 150 or even more buttons?

wvmarle:
Look at how LED cubes are done.

They use even more LEDs, in colour, on a single Arduino (or compatible) but with a lot of port expanders. You're doing a simple version of that as it's just 2D, not 3D.

I do understand the desire to have more LEDs (more and more and more and more and then a third dimension and then a few more) but what's the practical use of 150 or even more buttons?

Thanks for this, I definitely see what you mean. I will start by looking into the matrix option. It then may not be too much of a far cry to look into port expanders using i2c, (if I am not totally exhausted by then). Thanks so much!

Look at my project Hexome which is basically a 8 by 8 array of buttons and RGB LEDs. Also look at the design of other "monomes" as they do the same thing as you want.

Grumpy_Mike:
Look at my project http://www.thebox.myzen.co.uk/Hardware/Hexome.html which is basically a 8 by 8 array of buttons and RGB LEDs. Also look at the design of other "monomes" as they do the same thing as you want.

Thank you so much Mike, this is is an amazing project!!!

You might also consider 5mm neopixils. They look just like a normal led but can be any color and only requires the one pin regardless of how many you use.

You could also use a resistor ladder for the buttons

Qdeathstar:
You might also consider 5mm neopixils. They look just like a normal led but can be any color and only requires the one pin regardless of how many you use.

You could also use a resistor ladder for the buttons

Thank you for this suggestion, I have thought of Neopixels however am not sure if they are reasonable enough in terms of cost and have found them a little unreliable in the past.

I had another question regarding all of these solutions if anyone could help: If I were to scale up, for instance if I wanted to swap 'an RGB LED' for a strip of RGB LEDs instead (say around 5-10 LEDs on a strip), and controlled them through a MOSFET Transistor or something similar, would any of these method still be appropriate or would this change things?

Thank you

I'm afraid each MOSFET would need it's dedicated pin, don't see how you could do that in a matrix.

wvmarle:
I'm afraid each MOSFET would need it's dedicated pin, don't see how you could do that in a matrix.

You could high speed opto-couple the MOSFET to the array instead of the LED.
Thanks.. Tom.. :slight_smile: