Notifications
Clear all

Which Wifi modules/shields etc do I need for a multi Arduino-Wifi setup?

6 Posts
2 Users
3 Likes
1,386 Views
Macoofer
(@macoofer)
Member
Joined: 4 years ago
Posts: 27
Topic starter  

I'm pondering on a new project that will spread over the rest of the year most likely.

 

In short: As a demo set and test- and playground, I want to make a "control room-type dashboard" that communicates and controls various other Arduino sub projects in my house.

I'm quite new to all this and noticed there are endless type of wifi modules available.

From the tutorial Bill made on communication between 2 Arduino's (Wireless Joystick for Arduino Robot Car with nRF24L01+) I noticed there, that using this module and the SPI bus, only 2 slaves can be hooked up to a Master, using and Arduino Uno.

The idea for now is to use an Arduino Mega for the control center and several Arduino Uno's And Nano's (or similar) for all the sub projects (slaves)

So my question is:

How many slaves or Arduino's can I control and communicate with total with one Arduino Mega and what would be the best modules for that? (if there are other modules or methods, other then the SPI, i'll take those into consideration too)

 

Thanks in advance!

 

Macoofer


   
Quote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

@macoofer

Theres a plethora of ways to communicate from a control centre to arduino nodes.  I suggest the starting point is probably

1. do the 'slaves' need to run off batteries or can they have a mains connection.  

2. Does your wifi signal extend (or could easily be extended) to your slaves.  

3. Do your nodes have to be an arduino or will another board do just as well such as an ESP32 based board.

Depending on your communications method it is possible for you control centre to command an unlimited number of slaves, but this will depend on what your are proposing.

As an example I have a control centre with other 'nodes' running a mix of raspberry pi, arduino and esp8266 boards.  They communicate through wifi via mqtt.  The command centre can send commands and the nodes (e.g turn on the greenhouse heater) and receive data (e.g. the greenhouse temperature)   

Another small project was to command some electric sockets through the Zwave comms method.

But all examples of how to suggest you proceed really needs a more detailed description of just what your slaves will be up to.  I suspect my examples may be way off the mark at you allude to some direct hook up from slave to control through a serial (SPI) connection.

 

This post was modified 4 years ago by byron

   
Macoofer reacted
ReplyQuote
Macoofer
(@macoofer)
Member
Joined: 4 years ago
Posts: 27
Topic starter  

@byron Thank you so far for this info, at least it has made clear that I can in fact have a lot of them hooked up together.

 

To possibly answer to your question on more detail, here's a shot at that:

(I might need to add before doing that, that so far my only experience in this all is with an Arduino Uno and Mega, hence my question regarding the use of those 2)

The slaves, devices or nodes, or however we want to call or define them, will and can be a large variety of things, anywhere from:

- A simple remote temperature / rainfall / humidity / wind speed / etc sensor that only sends back to data to the control center

- A similar device as mentioned above, but with potential interactions, attached to them, that can drive another module if a certain value or condition is reached. (if my strawberries flowerpot on the balcony is too dry, switch on the waterpump to water it)

- A similar device as mentioned above, but with a possible override option from the command center. So the remote sensor setup detects my strawberries are thirsty, tells my command center that, which will in some way display that on the control center, allowing me to see that and act upon accordingly.

- A control for my auto-folding whiteboard arm: https://forum.dronebotworkshop.com/postid/11077/

- An outdoor UV-meter, that has different operating states: 

   - Send the data to the control center, which displays it in some form, but do nothing more

  - Send the data to the control center, which displays it in some form, but based on a switch and a threshold,      set by the control center, either roll down a sunscreen on the balcony, or automatically open one of the few      electric drawers, next to the balcony door, holding different sunglasses for the various UV intensity levels, if      I trigger the light-gate sensor at the balcony door. (this is a bit of an übernerd example, but it makes the          levels of interaction a bit more clear..  although I might actually build something like that 😋 )

- And yet to be determined, much higher levels of intelligence, sensing and interaction gizmos.

 

Some of the things I want to achieve can easily be achieved by wiring, like turning on some lights, however, most of the gizmos will probably suffer from voltage and power loss, as well as interference, when dealing with signals, I2c, servo-jitter etc. Hence me wanting to have the intelligence inside the gizmos, all reporting back to the control center, which in terms I can operate, or can decide by itself what it is going to do and tell the gizmos. 

 

Some of these gizmos would be so simple that they could run on batteries, or would in fact be something small that i can carry around when walking in the garden) where others are stationary and can have their own power supply from the wall, using an adapter.

Due to the simplicity of some of the gizmos, I could probably also use different micro controllers for those, but as mentioned, I do not yet have any knowledge or experience with those (by all means open to suggestions!)

 

Since this is all going to be in and around my house the wifi range could be extended in some form, quite easily in terms of equipment and location, although I have no clue what I need for that (perhaps even external antenna's on the gizmos and command center to enhance the range?)

 

Hoping that clears it up a bit and gives you a better insight of the variety of things I want to achieve 😊 

 

Mac


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

@macoofer

Hi Mac, that going to be a really good project to get your teeth into, with lots of interesting challenges to enjoy for sure.

From your description I would certainly start with the wifi comms as the easiest to get going with.

The main reason to be concerned about whether the board is battery powered or not is that wifi has a relatively high power consumption, but for those nodes an alternative method of comms such as RF (radio frequency) can be used. Also, depending on what they are doing, the battery powered board could be set to only wake themselves up periodically to do whatever, before slumbering again to save battery power.

I think that you should carefully consider what computer/board you use for your control centre. With all the things you want to control and the information you wish to gather and old computer or a SBC such as the Raspberry Pi may be a good bet. The reason for this to control your nodes to send commands and to receive data to probably display on a screen then a computer with a screen and keyboard and possibly a touch screen would be a good way to go.

For the nodes then either an Arduino with a wifi shield, or probably better an ESP32 board that has build in wifi are for consideration. And also other boards such as another Rpi, possibly and Rpi Zero that have build in wifi are contenders. Theres a lot of choice for this.

As weather sensors are part of you vision I give a link to a Rpi based weather station project so you can see if its the sort of thing you have in mind.

https://projects.raspberrypi.org/en/projects/build-your-own-weather-station

From my own home control project I can give an example of using an rpi Zero (a very low cost board that has wifi) periodically sending temperature data over wifi using MQTT to publish its data that the control computer subscribes to and receives this info. This data is then logged into a mysql database for later analysis, and also displayed on the control computers screen. The Rpi Zero also controls a mains on of switch though its GPIO pins. Another example could be my GPS receiver linked to an esp8266 board (like the ESP32 board but an earlier development) that sends GPS data, again through wifi and MQTT to a control computer, that will end up in a wheeled robot under development.

Here is another link that shows and example of an ESP8266 connected via wifi and MQTT to a raspberry Pi as a home security project from Adafruit which could be of interest.

https://learn.adafruit.com/diy-esp8266-home-security-with-lua-and-mqtt/configuring-mqtt-on-the-raspberry-pi

I suggest a starting place for your consideration is your control computer or board and what it will be required to undertake. How you envision receiving and issuing commands, whether data is to be displayed and possibly stored. This could be the largest part of the project you envision, and other decisions may flow from choices made for this aspect of your project. Maybe then look at your bank account to see what you may have to pay for what you may then desire to obtain. 😳 


   
Macoofer reacted
ReplyQuote
Macoofer
(@macoofer)
Member
Joined: 4 years ago
Posts: 27
Topic starter  

@byron

 

Looks like its going to be a long and busy summer for me... 

 

As you were writing this reply up, I was already watching and reading more on potential solutions and got a rough idea on how to approach this.

I guess my control box main brain will be a newer model raspberry Pi, to be the brains of it all, used to do most of the software and monitoring part.

Alongside this pi in the same control box ill put 1 or more arduino mega's, as they are much easier to hook up to all the gizmos and have those do all the tech stuff.

I can then shrink down along the path in terms of micro controllers for all the gizmos themselves, depending on what they are going to do.

And this is pretty much what you suggested in your last reply.

So in short I guess it indeed will depend highly on the specs and choice of the control center box, which in terms, will determine the flexibility and possibilities of the rest of the things hooked to that.

I'll start saving up for a Pi 4 with 4gb and 64gb sd card, that should give me a good startpoint 😊 


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

A long and busy summer it could well be 😀 .  I don't know your starting point and the following is just thoughts to bear in mind if you commence down this path with the Rpi 4 (imho a very good choice) and are not recommendations.

You will probably choose to learn python to write programs for the Rpi, not least because of the many example code snippets in existence plus its a very good language to learn on.

There are so many good tutorials for python and, assuming you don't already know python, I point you to my favourite youtube videos on this

I find it just as easy to hook up all the gizmos to the Rpi as to the arduino type boards so this may not be a consideration for you down the road.  In fact you may wish your Arduino was running python so as to make your coding life easier.   Several microcontroller boards these days can run micropython such as the TinyPico which may be worth thinking about later. (having said that I still mainly use arduino type nodes programmed in C for my microprocessor nodes)

If you haven't already then check out all the freely downloadable books and mags on the Rpi at 

https://magpi.raspberrypi.org/issues

Whatever path you take it will be of interest to see what you come up with so do keep us posted and enjoy the summer. 


   
Macoofer reacted
ReplyQuote