Connecting multiple arduino's to a central unit

Hi I'm doing a project where i measure the air quality, temp, press, etc. in multiple rooms of my house. In every room theres an Arduino MEGA and mutiple sensors. So i'm using more than 2 Arduino's. Now i'm looking for a way to read the data from the multiple sensors into a central unit, display it and even automatically and manually give commands to the different Arduino's. For the central unit i want to use an Android tablet. I read a good program to use is the MIT app inventer to create an app. This app would need to display the readings from all the sensors, and give some commands to the Arduino's based on the sensor readings. What is the best way to connect the Arduino's and the central unit. I read that using the HC-05 or HC-06 Bluetooth modules is a good option. But i'm woried about the distance of the connection, and i don't know if you can acces multiple Arduino's with this type of connection. A connection through a cable would also be good. Can anyone help me out. I'm new to connecting multiple Arduino's. Thanks in advance for your help

WiFi or Ethernet shields be my recommendation..
Can't comment on the MIT app inventor, never heard of it..
Start with the network design first, however you want to proceed as it will determine how you need to code it all..

good luck, happy coding.. ~q

1 Like

I use a Raspberry Pi as a MQTT Broker that my 13 ESP32's and 1 BeagleBone Black connect to as a central message point. From there a Python program running on the Pi does the communications message control, FTP server, and image processor.

From there the RPi connects to my web site to allow me to control the temperature in the house for instance.

My wife is working on the Android app so we can use our phones to control the house.

2 Likes

Thanks for the response. How do you get the data from the ethernet connection then on a pc. Like what program can I use for this. And how do i send commands back?

Building something meself..
a bit overkill though..
NARDS
there are many ways to accomplish you final goal..
take some time to evaluate what best suites your needs..
lot's of great peeps here, ask and listen..

have fun.. ~q

i'm trying not to use a raspberry Pi as i its almost impossible to get one right now but thank your for teaching me about MQTT brokers.

You could use a BeagleBone Black or the PC you are using to code on as a MQTT Broker.

I just need like a simple program where i can implement a couple variables from every adruino and give a signal to 1 of the Aruino's to power something on. But it needs to be free. It doesn't need to be connected to the internet. But it does have to be reliable. I want to be able to just upload some code to the Arduino's and get a program running on for example a tablet or PC that reads the data and sends instructions. I might be asking for a lot but i'm new and don't understand alot of really technical stuff

UART serial (e.g. Serial.print()) is a good place to start. You can have relatively long wires (very long if you use RS485 adapters) and can read the data using a USB-serial converter on any computer.

To learn about serial data transmission and reception, this tutorial should help: Serial Input Basics - updated

No it isn't. HC-05 Bluetooth is one-to-one and, no matter how you cut it, it will be cumbersome and messy in software or hardware, or both. Further, while HC-05 Bluetooth is good for 10m line of sight, it isn't so hot at transmitting through walls.

You will probably save a bagful of money by getting off the Arduino bike altogether and using ESP32 instead, which have WiFi built in - and Bluetooth as well.

Really? Now that we are in the 2000s, I don't think anybody would seriously consider that. If you do, it is likely to be the most expensive and difficult part of the job - even if the house is under construction.

I rather wonder why you need to measure air pressure in each room.

I've never done it, but my understanding is that an MQTT Broker can be hosted on ESP-32.

My first thought would be to have a central node (PC, RPi, or ESP-32(?)) with WiFi connection to sensor nodes. The central node would host a web service that is accessed by a tablet or cell phone to display status or control stuff. All easier said than done, but it should be easy enough to find examples with the individual components.

I've used AppInventor for point to point Bluetooth. While it certainly lowers the bar to programming Android Apps, it's probably not the most scalable approach. I don't know that one can have multiple Bluetooth serial channels simultaneously active on Android in any case.

sounds like you're already using my dope..
like the scheduled commands, i'll add it.. :slight_smile:

if not and you're curious about how much work it would be, go look at nards..

~q

Let me know when you are able to load MQTT Broker onto a ESP32.

MQTT Client can be loaded onto a ESP32.

I use CAN, no problems with RF interference. I have a large radio tower close to my home and it interferes with the WiFi and other things. I have it working on Arduino Nano, UNO, and ESP7266. I used Cory Fowler's CAN library and it worked first time. Remember because of the protocol you need at least 2 nodes.

As I say, I've not done it, but there are such projects on github. e.g.

https://github.com/alexCajas/EmbeddedMqttBroker

Oi! Thats a new one.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.