[NoviceUser] General notions to start a project: components, layout, connections, etc.
first of all I’d like to thank you everyone for the useful posts and tutorial which I’ve spent the last week reading and sorting out.
Also please beg my pardon if the section is not the correct one, I did my best at finding the appropriate one here on the forum.
So… I’m not an expert at all in this “wide new world” of IoT but I have an idea (or well, a dream actually) to create a sensor network for my home and after reading all the tutorials here I came to the conclusion that It might be feasible.
But I have some problems figuring out exactly which components I need!
So far here is what I understood:
I need a controller (basically a software) running on a gateway in order to collect, interpreter and easily access data from my sensors. After reading many tutrials I’ve become partial to OpenHAB which has the features I need.
The gateway needs to receive inputs from the sensors, and here things starts to get blurry for me: as far as I can understand I have two ways to do this.
a. I can wire directly my sensor to the gateway (a raspberry or an Arduino) which is easier but restrictive in terms of distances. I can’t run cables all over my house for the sensors.
b. I can choose to create a radio network in which sensors communicate wireless with the gateway, and then the gateway itself (hence the controller installed on it) is accessible for me via LAN. (for example: I can access OpenHAB to monitor all my sensors data)
If the two options on point 2 are correct, and I do understand correctly the point (b) then I can’t figure out how to “translate” into reality.
Let’s say I have 10 sensors: should each sensor have it’s own power source and radio chip connected? Will this be “simple enough” to let each sensor be accessible to the gateway?
Please beg my pardon If I just wrote a bunch of stupid stuff, I’m trying to learn.
Thank you very much for your help and your patience.
Big welcome to the MySensors community @Neo-Mod !
From your description, it sounds like you've come to the right place And yes, your understanding seems to be about right.
Multiple sensors can be connected to the same node, so you can definitely do that if you want. But I would advice to start simple, with only one sensor per node. Look at all the options at https://www.mysensors.org/build and choose one sensor that does something you like. Get that node running, together with a gateway and your controller.
The you'll be ready to create the next node, and so on. One day you'll probably say something like "what the heck, I'm gonna build a more advanced node" After everything you've learned from building your first sensors, building something more advanced will be easy
One small correction to your assumption in a) above: MySensors supports esp8266-based wifi gateways. So it is possible to create multiple gateway sensors as long as they are within range of your home wifi.
Neo Mod last edited by Neo Mod
Thank you very much @mfalkvidd for the the precious clarification!
Now I have a (slightly) better idea on how to do things
Actually the ESP8266 solution seems pretty sweet and intriguing: starting with just one sensor (you are absolutely right, I have to learn so it’s better to start simple) I could connect the sensor to the ESP8266-based module and then use the integrated WiFI chip to transmit measurements collected form the sensor to the controller, is that right?
If so, I would only need a “radio” component to avoid relaying on the small integrated antenna of the EPS8266-based module since the sensor would be “hard wired” to the gateway.
Theoretically a small test-environment could be composed of:
- An ESP8266 based NomeMCU CP2102 board
- A Dallas DS18B20 temperature sensor
- And eventually a NRF24L01+PA+LNA antenna to stabilize the WiFi performance
Is that right, or I just said a bunch of stupid things?
Once more, thank you for your help and your courtesy.
@Neo-Mod you're welcome. This forum is very friendly and I am happy to see another member interesting in learning
You got it almost right, but the NRF24L01+ is not related to wifi. It can not be used to stabilize wifi performance. It can not be used to communicate with other wifi devices at all.
The NRF24L01 is used for wireless communication between nodes and a gateway. The gateway is then connected to the controller over serial, wifi, mqtt, raspberry pi or ethernet.
NRF24L01+ would not be used at all in your a) option.
The NRF24L01+ (or one of the other supported transports, like RFM69) is used in your b ) option.
The main advantage for option b ) is that NRF24L01+ uses much less power than wifi, which is great for battery-powered nodes.
Ok, so I was almost completely wrong. Sorry about that.
I realized I got the wrong association between nomenclature and hardware, so please bear with me if I ask for some more clarification.
I understand a Node is basically a sensor (or a group of sensors) that must talk to a Gateway in order to transmit their measurements.
A Node can be of two types:
- “Wired” – when sensors are hard-wired to the node
- “Wireless” – when sensors talk to the Gateway via radio interface (which now I know is one of NRF24L01+ or RFM69 )
But a Sensor can be wired directly also to a Gateway, like the error I did before. In that case one would have a sort of Node-Gateway (maybe?).
If a Node is Wireless it consists of two thinks, in its essence: a sensor wired to one of the radio interfaces mentioned above, all powered by an appropriate power source.
A Wireless Node must have a Wireless Gateway to “speak to” in order for us to collect the data we need.
In order to do so, the Wireless Gateway use the same radio interface as the Node and all this “talk back and forward” between a Node and a Gateway is done thanks to the Gateway Software which, once configured accordingly to the sensor connected, starts collecting measurements.
But also a Gateway can be of two types:
- “Wired” – when it’s hard-wired to the Controller
- “Wireless” – when it’s connected through a traditional WiFi Network to the Controller
Exploring the case of a “Wireless” Gateway the best option is the ESP8266-board because it has an on-board WiFi that enables it to communicate with the Controller. (but is uses one of the two radio modules stated previously to receive data from Nodes)
The Gateway Software in this case is also in charge of communicating data from Nodes (and eventually hard-wired sensors to the gateway itself) to the Controller. (and here I still need to read more and learn exactly which is the difference between a wifi connection and mqtt)
Finally, there is a Controller, which can have a variety of “aspects” depending on hardware: I’ll simplify thinking at it as a Raspberry with OpenHab installed. (and I do this only because I know Raspberry so it’s easier for me to visualize).
P.S: If all of this makes sense I hope it could be of any use also for other “newbie” of MySensors, and I’m willing to put in a pdf with some graphics and a better description.
@Neo-Mod yup, I think you got it all right.
Maybe one small thing: in MySensors nomenclature, what you called a "sensor" is called a "sensor node". This is done to differentiate the sensor node (example: Arduino+DS18B20+nrf24l01) from a sensor (example: DS18B20).
A sensor node can have multiple sensors wired to it.
Thank you so much!
Well, I just made the first order for components and I have installed a test enviroment for HomeAssistant on a spare ARMBIAN board I had.
I'll keep reading the forum and try to prepare myself..then I hope to be back with more practical questions
Thank you again for your precious help!