GARDEN_NET A distribuited garden control system.

I have a large garden and I have been developing, in the last years, some application to control sprinklers and to get data from temp/humidity sensors with and without web remote control....
This was done on standalone Uno platform with or without Ethernet shield.
I never thougth this could have been of general interest,
but now I am working on putting all those devices togever :

connecting the Unos to create a net to control all different zones in my garden.

Main requirements should be:
-to use distributed controllers located where power is available(max distance up to 100 mt)
-to have all devices connected to an hub connected to ethernet
-to be power failure tolerant
-to be capable of control and acquisition of:
-temp humidity sensors
-position sensors
-power meters
-water flow meters
-solenoid 24V valves
-solenoid bi-stable 9V valves
...................

  • control of areas where power is not available( remote control of bi-stable solenoid valves)
  • to use most cheap HW available on the market

It may seam to much..... but in reality most of those functions have been already implemented or they are on the way...to be implemented!

I want to share all this but I also need suggestions advice and participation!

I will come back soon with detail questions on the best way to implement this regarding:
-how to create the network
-best and cheapest HW solutions
-already available similar devices (e.g. for home automation)

moderatormode: moved thread and cleaned it up a bit.

Hoping to get more interest......... I will post some more.....

I will keep explaining what I am doing:

-hardware available:
i have 2-3 Unos and one Mega each with a RTC:
-one Uno is connected to a Water Meter and read water flow.
-two Unos are driving relays connected to solenoid valves and are also connected to temp/humidity sensors.
-the Mega is the Hub and communicate with the Unos and is connected to internet with an Ethernet Shield

Networking:

  • i try to use Bluetooth adapters HC 06 or better 05 : main reason is because are really cheap...
  • I have tried serial communication and work very well....now only for two device at the time .
  • I need to disconnect one and connect next one......
  • I think doing this in sequence several time a minute to avoid loosing data.
  • Other option in to use more than one HC 05 on the Mega since I have more comm ports.

Software :
-up to now I have written some code for the Water Meter Uno and for the Sprinkler Controller Uno
-in booth cases are controlled by the Serial comm port (testing is done one stand alone Uno).
-I use EEPROM memory to store to watering program and data(flux of each valve).
-i am working on the Mega code :
-it should connect serially to the Uno's to be able to control and monitor all operations .
-It is connected to Ethernet as a ChatServer...may be later as a Web Server...
-the serial networkig of the Uno with Bluetooth is the main challenge:
I hope to be able to control 3-4 unos sequentially without loosing data.....

I am looking for ideas or suggestions .......

Do you have a block diagram? I'm interested to know if your Hub just collects statistics and displays them or if it has some control functions too.

As you are finding its quite hard to do bluetooth communication with multiple devices. One possible cheap alternative are these 315/433Mhz radios (http://www.instructables.com/id/RF-315433-MHz-Transmitter-receiver-Module-and-Ardu/) which are usually available for a dollar or two (they are only 1-way so you need 2 pairs for bi-directional communications).

For slightly more money you can get the nrf2401 modules which have duplex and multi-point capability. https://www.sparkfun.com/datasheets/RF/nRF2401rev1_1.pdf

If power isnt a problem then the ESP8266 wifi modules might also be usable.

Theres a nice summary at Wireless Buying Guide - SparkFun Electronics of some other options.

Hope this helps.

Thank you for your interesting suggestions: :slight_smile:

-I going to study the possibility of using ESP8266 :it very interesting since it should be compatible with serial communications, long range and low cost. I am looking for some existing application or library to use as a baseline for my SW.
-The other devices you suggest may be less easy to use for my scope. Data exchange must be very reliable since it basically control watering devices and I dont want have problem with noise or interferences. I already use 433 Gh module to control a remote switch that open a bystable valve.
This will be use in areas where there is no power since all circuit can be powered by a 9v battery.

I am working on a detailed block diagram on how the network will work :
today I have only implemented the functions in the nodes....
i am working now on the Hub sw ... basically it should:
-give serial command to each unit and
-monitor their functionality listening and recording all data transmitted
-be the main User interface for all the system:
-a simple Telnet command Hub (for the beginning..)
-complete user friendly web interface (it will take time to develop.....)
-control and coordination of all nodes:
-automatic adjustement of watering in function of data coming from a meteo station
-control of valves water flow with alarm and or shootdown functions
-algoritms to define seasonal and weather dependent watering needs
-verify and avoid overlapping of watering cycles
-......
All togever a long way to go............. (i am working now on the 3 first requirement of the list!) :o

The below site has a number of esp8266 modules that might be of interest. Have you tried setting up a master/slave network between the master and slave arduinos using the arduino serial port wired connections? Might be something to do before introducing wireless connections.

nrf2401 is quite reliable over line-of sight distances (uses 2.4Ghz band) and has libraries for arduino (http://playground.arduino.cc/InterfacingWithHardware/Nrf24L01). In particular you may wish to read http://tmrh20.github.io/RF24Network/ and https://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

ESP8266 is not optimized for low-power operation so battery power may prove troublesome although there are mods to help (eg http://tim.jagenberg.info/2015/01/18/low-power-esp8266/)- I had assumed that water-control solenoids would need some kind of permanent power.

zoomkat:
The below site has a number of esp8266 modules that might be of interest. Have you tried setting up a master/slave network between the master and slave arduinos using the arduino serial port wired connections? Might be something to do before introducing wireless connections.

http://www.banggood.com/buy/esp8266.html

Thank you
I have tried the suggested link but I get a "no permission" to open the site.
Googling I have found many alternatives,
it would be good to get an advice on witch one to chose:

  • I am oriented to buy the Olimex one

Regading the wired link.....: that the way I am working now: I use a wired link to develop and test the sw.

rw950431:
nrf2401 is quite reliable over line-of sight distances (uses 2.4Ghz band) and has libraries for arduino (http://playground.arduino.cc/InterfacingWithHardware/Nrf24L01). In particular you may wish to read http://tmrh20.github.io/RF24Network/ and https://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

ESP8266 is not optimized for low-power operation so battery power may prove troublesome although there are mods to help (eg http://tim.jagenberg.info/2015/01/18/low-power-esp8266/)- I had assumed that water-control solenoids would need some kind of permanent power.

Thanks I will investigate also the NRF2401 but I can tell you already that ESP8266 seams suited to this application:
-power is not a problem : valves solenoid require quite a bit of current.
-For the same reason I don't consider useful to use batteries:
data are stored on EEPROM and I have a RTC to keep the time.
-a range of few hundred meters may be necessary
-it appears possible to ESP8266 as node micro avoiding the need for the UNO and reducing total cost
-it seams also possible to use Arduino IDE for that .
-the main difference is that I need a supporting breadboard and 3V components (RELAY RCT etc.)

Looking around in the web there is a lot of data...... I have not found anyhow a place where I can get info
and guidance on how to proceed( choice of firmware, breadbord, SDK or better Arduino IDE environment, etc.)
It look like there is a lot going on relative to ESP8266 applications development environments so it may be difficult to chose the right solution.
I may proceed now testing and developing the Mega Sw using wired or/and Bluetooth and moving later to ESP8266 or NRF2401......

I have decided to test the nRF24L01 ...the most cheap solution!

Result are good but not exciting:

  • I have tested the range : a reliable connection up to 10-15 m.
  • I have tried some test SW for the network master with Ethernet shield :
    booth Sd and Ethernet do not work, apparently I should use a SoftSPI library......
    but I could not have nRF24, Ethernet and SD working togever.

Booth for the short range and for the SW difficulties/complexity :

I dont think this is the best solution!!

I also have purchase a ESP8266 MCU ..... I hope to get it soon!!

I think that miuPanel is the solution :slight_smile: .
Basically is a fully customizable bidirectional remote control from your smartphone through internet.
No need to know internet protocols and no need to design an mobile APP. It is very simple to use.

I buy from it from ebay and I love it!

The system is very simple to use. It has two element: a ESP8266 module (with a preloaded miuPanel firmware) and a free APP.
The idea is that you can desing your panel (adding led, button, slider, plot, image, background...) using a very compact and simple language developed for this system. (For example to add a led n.1 green L1G:0;). The string which represent you panel is sent from your Arduino to miuPanel wi-fi module (using the TX serial line) which sent to APP on the screen of your smartphone, that display it.
There is also online simulator, that permit you to test your graphics, during its building step.

miuPanel online simulator

Check this example:

Dg0.3;{%100,3!000,0A0^Tfi:My Biological Garden;}/G0%100,5015:0,100,0,100,10,5: Water flow: minutes:Liters/Hour:0F0:FFF:FFF:252:121;/Tfb15:Water Pump n.1;{!000,888^%100,20r30-5L1G:0:Off;|12W19:1;|L2G:1:On;}/10Tfb15:Liters/Hour: ;M1*15fb#F00:50;{!000,888^%100,20r30-5T:0 L;|R1%60:0:100:1:50:0;|T:100L;}

A sketch as example? Look this remote relay control

Thanks!

Miupanel is n interesting solution for interfacing Arduino with browsers.

In my case, I need to connect a Master Arduino ( Mega+Ethernet Shield) with several slave Arduinos(or ESP2866) and miupanel will be useless.

AFTER LONG TIME........
:slight_smile:
That the way my work is progressing:

-1 I have started working on ESP8266 and I have found that most of the work can be done with it
-2 the only limitation is the n. GPIO availables that is very small therefore we need expanders.
-3 I have discovered OpenSprinkler sw that do most of the function necessary for my slave nodes
-4 After 2 month of hard work I have ported OpenSprinkler to ESP8266
-5 It is no available on github.om/pbecchi/OpenESP8266_Sprinkler

I will keep working on it and I will develop a master code that will control opensprinkler stations!

Hi pbecchi,
the miuPanel firmware on ESP8266 module is able to create a wireless network of master-slave ESP modules.

This can be done with the TCP or UDP sockets:

http://www.miupanel.com/Wi-Fi-Module/TCP-SOCKETS-File-Data-Transfer

http://www.miupanel.com/Wi-Fi-Module/UDP-SOCKETS-Panel-Networks