Hello. My friend and I have a project for school that has to do with security. Our idea is something like have arduinos in some classrooms as a test, the arduino sends a signal from say, a button press, to a computer, which relays it to for example, 5 other arduinos. How can we achieve this? I know it must be simple, it's simple in concept, but I've looked into Firmata/pyFirmata and I've just got myself confused. We're using our personal Unos for the testing but the final will use Micros. I will provide any other information if need be.
I assume the school has WiFi coverage?
assuming that the school will allow you to connect to the WiFi you could use it to communicate between the WiFi enabled Microcontrollers, e.g. ESP32 or ESP8266
- How far will the Arduinos be from each other ?
Yes, thats a good idea. It's just that my friend insists on using wires, at least from what I remember him saying. I'd share his ideas and get opinions if I didn't have the memory of a goldfish and accidental selective hearing
Anyway, for what we DO have, we ordered ethernet shields. Is there some way we could connect 5 or more arduinos at once to one computer with ethernet or usb or something? This has to be pretty long across campus, as we have multiple buildings.
The Arduinos from each other would be wall to wall rooms apart, but from the computer, they'd all be from another building.
Ethernet would certainly work - use TDP/IP running TCP or UDP client/servers
does the school have an Ethernet network which you can connect too?
otherwise could you run ethernet cables and connect to a hub?
- The ESP32 solution is doable.
Reasearch these:
there is also ESP-MESH
I honestly don't know, but I'd assume it has ethernet. My friend is convinced we can just use ethernet cables to send raw signals through the "straight copper wire" as if we were using the normal jumper wires that come with the starter packs and stuff. I've been kind of confused about it and perhaps I explained it wrong, but regardless.
worth asking - they may allow you to connect
what raw signals - TTL serial? RS232 serial? RS485? Ethernet?
if you have ethernet shields and ethernet cables use TCP/IP
Not really sure on what serial, we haven't gotten that far, he actually was against buying ethernet shields but I insisted. He still thinks it was unneeded. To be honest with you, I'm kind of a newbie, so I'm just trying to figure out the best course of action. Is there even a way we could make a system like that if, say, I literally cut the end off an ethernet cable and use the wires directly (no ethernet shield), because that's mostly what he suggested. Sorry if this is like logic spaghetti.
Take a close look at CAN, it is inexpensive, multi master and requires no master. Each node can say hello or whatever when it gets a signal and can say by when it is deactivated. A simple 4 wire cable can connect these. The only hard part is the bus requires a 120 ohm resistor at each physical end. Your wire length limit will probably be in the 4000' range. Check it Out, you simply need to add a MPC2515 or similar CAN module.
TTL serial will have problems over long cables - RS232 would probably be OK but you would require TTL-RS232 modules
what baudrate would be be considering?
if you have ethernet shields use them
I honestly don't know what baudrate affects, I'm sorry. In other words, not sure what it'd be. This may be a stupid question but what is the default serial if for example, I'm transferring a signal between 2 arduinos via tx and rx pin ports?
if you are talking about UNOs using SoftwareSerial or AltSoftSerial maximum is around 38400baud - long cables would be less
So why don't you like your friend's idea of just using wires?
thinking again you could use USB cables to connect the UNOs to a USB hub
Honestly, it just seemed silly to me, especially considering this is supposed to be something for school security. It's more of an extra-curricular project so I'd think it needs a bit better infrastructure. Just my opinion, it could be just as effective, I could be wrong, I haven't done too much with arduino till recently.
To add to that, this could be a project with bigger infrastructure than just 5 arduinos if it goes anywhere, so that's why I figured it'd be better to use an ethernet shield and networking versus just serial stuff with that.
Sound like you decided on ethernet. So now what?