Putting sensors together

Moderator: leecollings

Post Reply
janvier123
Posts: 36
Joined: Saturday 17 September 2016 22:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Putting sensors together

Post 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
User avatar
gizmocuz
Posts: 2551
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Putting sensors together

Post 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
Quality outlives Quantity!
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: Putting sensors together

Post 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
MikeF
Posts: 350
Joined: Sunday 19 April 2015 0:36
Target OS: Raspberry Pi / ODroid
Domoticz version: V2022.2
Location: UK
Contact:

Re: Putting sensors together

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest