Page 1 of 1

Putting sensors together

Posted: Saturday 17 September 2016 22:14
by janvier123
Hi,

Iam just starting with domoticz, but ive been busy with it like over a month now.
Now iam ready to make a "Garden Box", a waterproof box with an arduino and some sensors that will be placed in the garden :D
So i have a question about putting 4 sensors in 1 sketch.

- Soil Sensor (One with a PCB attached and 2 wires)
- Rain Sensor (One with a PCB attached and 2 wires)
- DHT22 (AM2302) (Temp and Hum)
- a simple LRD (may be replaced later with a LUX sensor

-- Running on a NRF24L01+

Where do i start? the code is a mess and all the code is just scattered around.
Do ppl make the scripts for you, if you ask them nicely?

Thanks in advance :)
Janvier

Re: Putting sensors together

Posted: Wednesday 21 September 2016 6:43
by gizmocuz
What do you mean... the code is a mess ?
I surely hope you are not talking about Domoticz or the MySensors code !?

Next, do yourself a favor, look at the examples of MySensors and you find all you need in there, then make yourself a new sketch with the 4 samples combined.

Even better, forget Domoticz, forget MySensors.
First get all these 4 sensors working with only arduino code, this will give you a much better understanding of the arduino workings.
Then make a MySensors sketch, test this (not with domoticz, but with the arduino ide), and if that's working, then... connect it to Domoticz

Re: Putting sensors together

Posted: Wednesday 21 September 2016 7:06
by MikeF
Have a look at my example here: https://forum.mysensors.org/topic/2086/ ... eech-board
- the sketch is in the thread, and I don't think it's a mess! :D

Re: Putting sensors together

Posted: Wednesday 21 September 2016 7:58
by MikeF
The point of this is to show that it is possible to put together an Arduino sketch for multiple sensors quite well, and to link this to Domoticz.

However, it's worth heading over to MySensors https://www.mysensors.org/about, where there are lots of tutorials and examples, and building a simple sketch for one sensor first, understanding that and getting it working; then add your other sensors to it and getting those working too. Unlikely that anyone will build your specific sketch for you, but there are the ready-made examples, and the folks on the MySensors forum https://forum.mysensors.org are always friendly and ready to help if you get stuck.