Is the Arduino right for this project?

It's basically a button-based game with lights and a text display to provide feedback. I have expereice with programming and electronics, but not the Arduino and I'm not sure if it can handle the entirety of the project.

Here's what I would need:

  1. About 100 buttons linked with a double voltage divider. This would give me a linear range of voltage about 10 Arduino units apart on the Analog input pin (1024 analog range / 100). (I do not need to worry about multiple button presses).

  2. About 100 RGB individually addressable LEDs. Maybe WS2812. These would provide visual feedback for the player and some visual effects. I would need to look for a button press during these effects.

  3. A 4-line 20 character LED module. This would display text like game score and play instructions. It would not need to update during any RGB lighting effects with the exception of updating a player timer.

  4. Background music and effects music. For simplicity, I would likely get 2 simple wav modules with 8 or so sounds each. I'd use one for background music, and the other for sound effects. I would not use the Arduino for sound mixing, but rather, use a hardware mixer/amp before the speakers.

  5. A few switches to act as interrupts (like a game reset switch, for example).

  6. I would also need it to control about 5 additional SSRs based on the game logic (3 of them PWM)

The game logic is not sophisticated, but control over the hardware might require multiple timers (or calls to Millis) and communication (perhaps serial) to the RGB lights, display module, and the two sound effects boards.

I know this is a lot, so you can appreciate my desire to know if this is likely to be impossible before I get too deep in the project and find out it won't work.

Lastly, If it looks like it might be too much for one processor to handle, I could consider offloading something onto a second Arduino and then call those features through simple input/output pins.

I sincerely appreciate your thoughts and help with this.

#1 is going to be unreliable. Switches are not perfect (over time).
Better to use (digital) port expanders with a 10*10 button matrix.

Interrupts for human operated switches :o
PWM for SSRs :o

The smart way is to test each item on it's own, before adding the next one.
Leo..

Thank you for the thought. I'll look into the pin expanders. Pwm output pins for an ssr would let me control a large LED backlight and a simple motor.

But I'm not committed to any particular method... Based on your experience, is this level of overall sophistication within the ability of an arduino? Most of the examples I've seen are significantly more simple in scope.

It all seems well within the capabilities of a common Uno.
You won't know until you try, and there are more capable Arduinos in the unlikely case that you run into problems.

Mains power SSRs usually have zero-crossing buildin, so they won't turn off until the next zero-crossing.
Not compatible with (much faster) PWM. An SSR is basically a relay (on/off, not dimming).

Arduino is about experimenting.
Start simple. Make a button matrix, or play with a DFPlayer.
Leo..

Wawa:
Mains power SSRs usually have zero-crossing buildin, so they won't turn off until the next zero-crossing.

Won't turn on. :astonished:

Thanks again for that. 16mhz seems like a lot until you start eating into multiple serial output and timers.

I've used nonzero SSRs for AC control of heating elements before and dimming of christmas light strands. It's always worked for me, but like you said, I'll have to try it. This application will be for DC, so it hopefully will be even easier.

I'm glad to knows this much hardware control isn't setting off any red flags.

Wawa:
#1 is going to be unreliable. Switches are not perfect (over time).

I find this very interesting. Could you provide more detail of how a switch array is likely to fail?

Thank you.

Switch arrays with a ratio output for an analogue pin are usually made with a resistor ladder.
They rely on the switch/button being close to zero ohm, or at least so low that it's not seen as another switch.
Switches without some 'cleaning current' through them will oxidise (get resistance over time).
The MCU could see it as another switch being pressed.
Leo..

Wawa:
Switches without some 'cleaning current' through them will oxidise (get resistance over time).

Or in the case of the "tact" switches which contain a lubricant, become contaminated (with moisture) so that they develop a leakage resistance.

The resistor ladder approach of multiple button sensing has proven very unreliable over time where used in such things as MP3 players and video monitor button panels.

And the control button on my car's odometer - works only when hot! :roll_eyes:

Shameless plug:

For the MP3 player, use one of these DFPlayerMini modules:
To control it, use this library (also found in the Arduino IDE's Libraries Manager - search "DFPlayerMini Fast")

Two of these breakout boards could be ok for the 100 buttons (128 max).
They take no resources away from the Arduino when no buttons are pressed, because of the interrupt output.
Leo..

Wawa:
Two of these breakout boards could be OK for the 100 buttons (128 max).

I was about to mentions something like that. Each one has 16 I/O, as 8 outputs and 8 inputs, they can scan a matrix of 64 switches/ pushbuttons, If you know you will not wish to push more than one button/ close one switch at a time, then you do not need diodes for each button.

Of course, if you used one as 16 outputs and the second as 16 inputs, you could scan 256 switches.

Wawa:
They take no resources away from the Arduino when no buttons are pressed, because of the interrupt output.

Not of course, that you actually use it to interrupt the Arduino, it is merely a convenient point to poll. And this requires some increased complexity, as because you are scanning the switch matrices, you can only notice a single new switch press if you enable all scanning rows together and no other switch was closed at the time.

All in all, this would mean two (I2C) pins for the keyboard and perhaps one for the WS2812s. A Nano will handle it just fine.

hawkmoon77:
3. A 4-line 20 character LED module. This would display text like game score and play instructions. It would not need to update during any RGB lighting effects with the exception of updating a player timer.

Not sure what a "4-line 20 character LED module" is, but if you mean a 2004 LCD, then its backpack would share the same I2C pins.

hawkmoon77:

  1. About 100 buttons linked with a double voltage divider. This would give me a linear range of voltage about 10 Arduino units apart on the Analog input pin (1024 analog range / 100). (I do not need to worry about multiple button presses).

3x PCF8574. Super cheap and on I2C, for a 16x8 matrix (easiest to deal with as complete chips are either outputs or inputs), gives you 128 buttons.

  1. About 100 RGB individually addressable LEDs. Maybe WS2812. These would provide visual feedback for the player and some visual effects. I would need to look for a button press during these effects.

Easy. Make sure you have sufficient power supply, and not just one end of the strip.

  1. A 4-line 20 character LED module. This would display text like game score and play instructions. It would not need to update during any RGB lighting effects with the exception of updating a player timer.

Get one with an I2C backpack (usually based on the PCF8574 - that's OK, it has 3 address selection pins for 8 unique addresses). Saves a lot of wiring.

  1. Background music and effects music. For simplicity, I would likely get 2 simple wav modules with 8 or so sounds each. I'd use one for background music, and the other for sound effects.

The DF Player Mini works great with Arduino, will do wonderful for your background, but be aware that it does NOT always start playing from the beginning of the track, but at a random point between roughly 0-300 ms from the beginning. You will notice this with the sound effects, which tend to be short.

  1. A few switches to act as interrupts (like a game reset switch, for example).

You have 28 spares in your matrix... use them, handle them in your software as you handle the others.
Interrupts (of the Arduino's MCU kind) are not necessary indeed.

  1. I would also need it to control about 5 additional SSRs based on the game logic (3 of them PWM)

What are you trying to switch/control here? SSRs and PWM may not be a good combination. May work fine with DC (but then, why SSR?) but not so much with AC.

wvmarle:
SSRs and PWM may not be a good combination. May work fine with DC (but then, why SSR?) but not so much with AC.

Presume he means phase control, not PWM. :roll_eyes:

Do SSRs offer phase control, then?

As long as they are not zero-crossing ones.