Controlling 40+ Arduinos!

We have a generally low light level (by design) auditorium style room. We would like to fit each armrest with LEDs, sensors, etc. This would be so that participants could participate in Jeopardy style games where they have to race to "buzz in" and answer. Also, it could be used so that, when a participant has a question, they could press a sensor and then their seat would light up and the facilitator would call on them. Of course there are more possibilities but those are just some examples.

We (my supervisor and I) are currently looking into the best approach to doing this. One idea is to use the Johnny-Five library with the Etherport-Client library running on a central Raspberry Pi, which would control Arduinos running Firmata software.

I like this method as it would consist of a TCP network that all Arduinos and the Raspberry Pi would be in. Common networking hardware and protocols could be used (switches, etc).

My supervisor has concerns regarding this method.

First, he is concerned about the cost of ~40 Arduinos that all require ethernet hardware.

Second, he is concerned by the amount of data that will have to be flowing into the Raspberry Pi. I don't have the experience to know if this is a valid concern. Of course on most networks you have on the order of 10^6 bits of data travelling per second. On the other hand though, let's say we want the "buttons" to be IR sensors. We won't want there to be a large delay at all in a Jeopardy style game, so we'd be sending the analog readings back to the Johnny-Five software very frequently. And again, this would be ~40 Arduinos all sending it simultaneously.

So, my supervisor thinks a better solution might be to use an I2C network. He likes that this will be cheaper (we won't have to equip each Arduino with ethernet hardware). Additionally, as he thinks the ethernet network will not be able to handle all of the data flowing through, he is hoping we will be able to flash each Arduino with C++ software that will only send back a relatively small amount of data through the I2C network when, for example, the Arduino knows that the IR sensor has been pressed. One thing to note is that he says the Arduinos will be built in the the chairs such that they will not be physically accessible to flash. He is hoping there would be a way to flash them over the I2C network. Of course, this strategy brings up the concern of having to flash 40 Arduinos for every change, whereas a Johnny-Five solution would simply be changing out the TypeScript on the Raspberry Pi.

As with most projects, I discover a far superior solution long after I've finished the bulk of the project. I thought I'd pitch this problem to the forums here and see if anybody had any good considerations or solutions. I truly am open to hearing any solution. Eg, we went straight to the solution consisting of one Arduino per chair, but perhaps this is not the best option. Another consideration is that whatever the solution is, we want it to be easily expandable/upgradeable.

Thanks in advance, all.

PureStress:
So, my supervisor thinks a better solution might be to use an I2C network. He likes that this will be cheaper (we won't have to equip each Arduino with ethernet hardware). Additionally, as he thinks the ethernet network will not be able to handle all of the data flowing through, he is hoping we will be able to flash each Arduino with C++ software that will only send back a relatively small amount of data through the I2C network when, for example, the Arduino knows that the IR sensor has been pressed. One thing to note is that he says the Arduinos will be built in the the chairs such that they will not be physically accessible to flash. He is hoping there would be a way to flash them over the I2C network. Of course, this strategy brings up the concern of having to flash 40 Arduinos for every change, whereas a Johnny-Five solution would simply be changing out the TypeScript on the Raspberry Pi.

I2C is not designed for any amount of distance, maybe 10 feet at most.
If you want the arduino to send data over i2c, that means it will be the master and the rPi will be the slave. This means 40 masters on the bus and a ton of contention that you will have to deal with. If the arduinos are the slaves, then the rPi polls them for data. They will all need to have a unique slave address as well.

As for programming them via I2C - not possible. You can use the ISCP pins to do it, but you will still need access to them.

Have you looked into the CAN bus? Very common in cars, etc. which may be a better choice than i2c. Not sure of the cost, shield requirements, etc.

I2C was designed for communications between chips on a single PCB and is completely out of the question for your application.

For large multinode installations like an auditorium or a building, many people use inexpensive, fast RS485 serial communications over twisted pair cables.

You'll need fairly simple interfaces on each Arduino, with RS485 network manager software on the master. Each node could be an Arduino Pro Mini, running simple receiver software.

You might get a couple of wifi boards like the wemos d1 and experiment using them thru a wireless router. Running communications wire might be $$$. Another option just for signaling might be to have a remote style IR transmitter for each chair to a master receiver. I think something like this is already commercially available for classroom use.

What is the budget? What is the winning having the system working? What is the likeliness it will be built?
This topic can easily beome a forever ongoing topic.

For 40 places, a small custom PCB would make sense, but if 40 Arduinos are already out of the budget, I’d start looking at a cheaper way to connect all this stuff (wire is expensive).
You still need to get power to each seat, otherwise an ESP8266 on wifi might be a possibility.

Start with a budget and signed off requirements doc.
You can start planning how after you know what.

This needs thinking through - if you are having lights on arm rests and Arduino on each one , how will you power them ?

I’d guess you have to run cable in which case you could run some form of wired coms connection and make life easier , maybe share processors - one per 6 seats or what ever ?
Whenever I see “ use 40 “ Arduino , then the installation cost and making suitable enclosures etc rapidly makes a project very expensive - I’d think you’d be looking at $1000 per seat by the time you’ve developed it and ripped the floor up to wire it?

You could use smaller arduinos as the micro for such a simple task as reading a sensor and lightning some lights, here's the shopping list for each seat:

-arduino micro 3~5$ if you fetch it from ebay (atmega168)
-rgb controller if actually needed 2~3$ (search for RGB driver arduino)
-some kind of buttonless switch, maybe IR distance sensor, 1$

now for the actual communication, if we are talking about speed, you will need a wired communication, preferably 1 wire per seat, directly connected with the button, otherwise you could use CAN bus for speeds up to 1Mbps, but if you lower your speed you can actually connect devices to up to 1000m away, and you have cheap UART-CAN boards on ebay for like 2$.

Now, if you absolutely want to implement WiFi connection, well you can, ESP8266 board shipped from china are as expensive as a coffee, about 2$.

Shopping cart receipt: 8~10$ per seat, but if you buy in bulk may as well go to 6~8$ per seat.

you must also write a program in the arduinos to send data on when they pressed the button and wait to light the lights until they get the response from the controller saying that you were actually the first to press the button

I note the comment that the seats should ‘light up’ when nominated…
Is that light ‘at’ the seat, or ‘above’ in the ceiling etc, such that it shines down onto the seat area ?

If the latter, you also have a project for addressable LEDs supported overhead, in order to illuminate over a specific seat when commanded.

This whole idea needs to be properly proposed before anyone spends time designing a solution.

At the moment, it seems like we’re sitting around a table discussing what and how it might work. Then, we need to work out what it will cost, and get a budget approved, or shut down.

Oh yeah, if the seat only has the "button", might as well make it directly wired to the main CPU, that will be the fastest way and the cheapest also, no data wires, just a small 0.25 or 0.5mm wire (AWG 20 OR 22).

Same thing with the light, instead of sending data to be processed by the arduino you can use adressable LED light, or you could also use relay boards to light the seats/reflectors.

This way you will only have small wires coming from the seats instead, and if you dont have enough I/O pins there are I2C I/O expansion boards available on ebay.

9 answers and no comment from OP. Is he drowning? Else he has a lot of work evaluating the answers. Or will it be a dream never comming true?

auditorium style room as in fixed seating like a theater ?

if so, then one micro should be able to do more than a few seats.

the first button press is key to this. you would want to make a button press to be short, small data package and as little handshaking as possible.

Network costs, if you can do one micro for 4 seats, then the network gets cheaper.

a NANO and a LAN module would be less than $10 x 40
10 NANO's 10LAN cards, (4 seat version) and a custom shift register board to control 4 seats would be less than 40 individual seats

alternate : the SMT32F103 has CAN bus, good for the distance, slower as the cable gets longer.
but for the reactive button, all you need to send is a short value to represent the seat #

Maybe the OP is asleep, who knows.

Making a couple calculations this project may be a cheap one.

if we have 40 seats, on avarage 10m away from the main central unit, we have that each line requires 400m of cable if we take in consideration my last proposition,

now, how much lines do we need for each seat? Vcc, GND, button, lights.

with only 4 lines we could still use an ethernet cable to do the job, since the cable has 8 wires we could use 2 wires per line, and since it's already shielded we'll have less problems with the signal.

You can find very cheap ethernet cat 5/6/7 cable from china, 200m for 50$ or less, you will only need 2 of these totaling 100$ for the wiring, or you can also find any other cable 4x0.5mm2 (4xAWG 20) or grater for the job.

this is all assuming that your LED's dont absorb more than 2A, and if they do you can still use 3 wires for the LED's and the ground and 1 wire for the Vcc and the button, it's up to you.

regarding the button, I still dont know how and what type of button you had in mind, but 40 IR sensors will total around 40/50$ more

Now the lighting, assuming you want to light only the armrest I would say you'll need 1m of led strip per seat. 40m in total, since 10m of single color LED strip costs around 25$, you'll need 100$ more for the lights.

Adding to that 40 relays, in 5 x 8 relay boards of 7$ each, adds 35$ to your amount.

Now to expand your I/O with external boards, a board with 8 GPIO costs 1$, but with I2C you are limited to having maximum 8 boards with 8 GPIO each (of the same kind, as said on ebay), totaling 64 new GPIO for 8$.

So I would say you'll need about 300$ for the seats setup alone + the micro controller of your choosing and a lot of elbow grease.

Sounds like an application for battery powered ESP8266 (or ESP32) WiFi devices. Give one to each participant as s/he arrives and collect them afterwards.

...R

"Maybe the OP is asleep, who knows."

Most likely the light has come on that "it ain't gonna happen" as originally conceived.

One common thing about these completely plausible ‘ideas’ is the creator rarely considers anything other than the basics.

In my experience, that’s usually about 30% of the final cost and complexity. The rework, unforeseen requirements and fabrication/enclosures account for the other 70%

This catches a lot of beginners, and a few that should know better.

lastchancename:
In my experience, that’s usually about 30% of the final cost and complexity. The rework, unforeseen requirements and fabrication/enclosures account for the other 70%

This catches a lot of beginners, and a few that should know better.

The UK’s HS2 high-speed train project is a good example :slight_smile:

…R

I like the idea of using one Uno (or even a Mega) to control/power a few seats. On Monday I'll be able to get the exact number of seats and rows. It turns out the Uno+Ethernet Shield combination will only cost $6.52 per set and Mega+Ethernet Shield will be $9.51 per set.

I'm concerned about IR sensor and LED power draw. Assuming that's not an issue the number of analog pins will be the bottleneck. The Mega has 16 and the Uno has 6. Another concern is the idea that the analog voltages coming from the IR sensor would get screwy if stretched too far. The solution here though is of course to go with the more Unos solution instead of fewer Megas solution.

Everything will be right in the armrest of the chair.

I don't think my supervisor will be concerned regarding the price of the Ethernet hardware anymore. Then regarding CAN vs Ethernet:

  1. I would really prefer to use TypeScript instead of C++ for this project due to the fact that it I'm more familiar with it, and that it will be easier to roll out updates with it. (Ethernet + Johnny-Five would be TS, CAN would be C++).
  2. Some quick searches brought up that CAN has a maximum throughput of 1 mbps whereas the Raspberry Pi 3 B+ has a 300 mbps throughput via Ethernet.

"I don't think my supervisor will be concerned regarding the price of the Ethernet hardware anymore. "

Have you put the cost of cat5 cable (or maybe cat3 if running 10BaseT), the routers/hubs and their logistics, and the cost of running the cable in the "magic bag" and given it a shake? The devil is always in the details.

PureStress:
Everything will be right in the armrest of the chair.

I don't think my supervisor will be concerned regarding the price of the Ethernet hardware anymore.

Have you considered my wireless suggestion in Reply #13?

@zoomkat has mentioned the cost of cable and its installation. But I suspect by far the biggest cost will be paying someone to make a neat job of installing all the stuff in the arms of the seats. I could easily imagine a cost of $200 per seat - quality woodwork, metalwork and upholstery are not cheap - before you consider the electrical and electronic costs.

...R