Control a Smart Irrigation System offline/online "simultaneously" (ESP8266)?

Hello, my name is Adrián, and I have been working on irrigation system modules with arduino (AC version) for some time, and now I am trying to continue this develop with the wireless version [1].

The meaning of this post, is to show the communication protocol proposed, and also to ask some questions about this, where:

  • the Red waves represent the communication between the radios of the Sensor Nodes and the Remote Actuator, and the information transmitted is mainly to develop the agronomical tasks.

  • the Green waves represent the communication between any smart phone with the Remote Actuator via wifi, using the ESP8266. This will allow the configuration and the control of the system offline, where no Internet connection is required.

  • the Blue waves represent the communication between the Remote Actuator and a Router connected to the Internet, and this optional connection will allow the configuration and the control of the system online, via a web server.

Can the ESP8266 works simultaneously as an access point to control the system, without an Internet connection (offline), but also change the mode periodically to work as a client to be connected online to a web server for monitoring tasks?

Thanks in advance.

[1] https://ecommerce-aisur.org/sac/wiki/index.php/Sistema_de_Riego_DC_-_Modelo_A

Hi! Nice project Adrián!

AFAIK, the ESP8266 module cannot be configured simultaneously to be running as a Soft AP, and also as a WiFi client connected to a different AP. However you could switch the working mode, so sometimes is an AP so you can configure some parameters offline, and the other one connects to your WiFi and provides remote monitoring. This could be changed by pressing a button, by time, by a sensor reading, or any other similar trigger, this is just software!

Hi Alvaro! thanks, well, project in progress. The AC version as been running for 2 years, without problems, and the system never hang, thanks to the use of an appropriate technology like the arduino pro mini as the microcontroller, enough to develop the agronomical task needed.

But continuing with this topic, the Solar Wireless DC version, in fact, and according to your answer is great, because that is how the system will work. I have added a button to be able to wake up the device (but of course the PCB as also a RTC embedded for sampling frequency), and if the button is pressed more than some specific seconds it will enter into a config mode, etc.

In summary, is good to know that is just a question of software; I was pretty sure about that, but I had some doubts, I am not a programmer, just a designer. In next posts, I will show the circuit proposed, diagram proceses, funtionalities, etc.

This is a translation of google sorry errors
It is a good project with many applications so I’ll be attentive to their development sincerely, I encourage the project.

Great Adrian! Let me know if I can help you in anything. We are also developing some hardware, so we can help in this too!

Just one question, do you expect to run the system indefinitely from the solar panel and the battery? Did you test the autonomy? It would be great if you can share your knowledge about that :slight_smile:

Sure, in fact this is an open source project, where collaborations are welcome based on the principle of synergy, but not only that, find partners with a business purpose it is also desirable.

About the circuit block proposed (first prototype PCB approach), let me show it:

This is the Sensor Node Device:


How it works?

  • The node has a soil moisture sensor with electrodes, which determines the gradient of humidity in the soil we want to have, and thanks to that, we can select the optimum of the soil moisture that fits with the hydric profile of our plants, but also, a soil moisture minimum can be selected, promoting degrees of soil aeration, and its associated processes.

  • Also, a soil temperature sensor avoids the irrigation, when the soil reaches a critical high temperature programmed by the user, protecting the roots and the whole plant from damages.

This is the Remote Actuator:


How it works?

  • This device control the irrigation zones, according to the data sent by the sensor nodes, opening when necessary the 9VDC latch electrovalves.

  • But also to control the amount of water that is being used in our field, we can add a flow meter that measures the liters of water used during the irrigation process.

About the microcontroler, it is based on the development by Felix Rusu, called Moteino (ATmega + RF Radio) who has developed this module, but also has written great libraries to control data transmission between nodes.

Is a good question, but not to extend too much this post, in the next one I will show the energy strategy proposed.

@Fram_Mart I think so, this smart solar powered irrigation system device (S.A.C. Automatic Cropping system), has been design to develop agricultural tasks, more specifically, watering plants automatically in the most efficiently possible way, obtaining a higher yield on plant growth, in addition to a more optimal use of a natural resource, the water. In addition to that, the system can be controlled and configured easily with any smartphone via wifi, but also by Internet, where the data can be logged and stored into a cloud server, being this information very useful for agronomists to study the evolution of environmental parameters, and its relation with growth rate.

PS: Confieso que también tiro constantemente del google translator, de todos modos, para cuestiones más concretas o específicas que se consideren oportunas, o que se hagan difícil transmitir en inglés, tampoco considero ningún problema que podamos dirigirnos en español en ese caso.

hola Adrian ,tengo en cuenta tus consejos y como quiero poner en valor la lengua española y su gran potencial ,desde ahora me tomo la palabra y nos comunicamos es español una lengua con un mercado de mas de …http://www.twago.es/blog/la-importancia-de-hablar-espanol/

Well, about the energy strategy, in the PCB shown as a first prototype, I am going to use a typical module (TP4056) to charge the battery from a solar panel, with a step-up/step-down DC/DC regulator, just to be able to start with the agronomical functionalities, send data from the nodes to the remote actuator, etc. But the next evolution will be to redesign the circuit with better solutions to improve the energy management, in this way, I found these good chips in my opinion to be used, like:

  • From Texas Instruments:

BQ24210
[BQ25504] ti.com/product/bq25504
[BQ25570] ti.com/product/bq25570

  • From Linear Technology:

LTC3105/LTC4071
[LTC3106] linear.com/product/LTC3106
[LTC3331] linear.com/product/LTC3331

  • From Maxim Integrated:

[MAX17710] maximintegrated.com/en/products/power/battery-management/MAX17710.html

  • From Analog Devices:

[ADP5090] analog.com/en/products/power-management/switching-power-converters/switching-regulators/adp5090.html

A really interesting evolution, can be also to replace the li-po battery for a supercapacitor; I would like to offer a maintenance-free system, without changing the energy source for at least 10 years minimum, well that’s my goal, :slight_smile:

Now it is time to start with the numbers, like consumption, sampling frequency, battery capacity, etc.

So, what do you think about this solution with one of these chips?, probably you already knew them.

@Fram_Mart Sin duda, la lengua española tiene una importancia fundamental en el contexto internacional. Sin embargo también considero una circunstancia relevante, el hecho de que la comunidad de desarrolladores/programadores, utilicen el inglés. Por ello, quizás lo ideal el equilibrio en el uso de ambos idiomas, según en que ámbito se trate.

He iniciado el hilo en inglés siguiendo la pauta del foro, allá donde fueres haz lo que vieres, pero se podría igualmente abrir un segundo hilo en español, de modo que se permita seguir compartiendo el desarrollo con los no hispanohablantes a través de este hilo, y en paralelo solventar dudas y cuestiones en español en otro, para quienes no dominen/dominemos el inglés. Como se considere oportuno, estoy abierto a propuestas :slight_smile: .

Ok, so Let’s start with the maths.

This is the approach proposed, and why not to go further and redesign the circuit to be used with a supercapacitor, to improve the longevity of the devices, as shown before.

In this case, I will use this interesting Super capacitor discharge time calculator from:

http://www.circuits.dk/calculator_capacitor_discharge.htm

Where the values added were:

Vcapmax: 2.7 V
Vcapmin: 1.3 V
Capacitor Size: 300 Farads
Capacitor ESR: 0.006 Ohms
Imax: 200000 uA (200mA)

And the result is about 2000 seconds for a constant current discharge, and that means, if I am not wrong:

Conditions:

  • The sensor node, will have a sampling frequency every 2 hours, more than enough for the parameters we are measuring (soil moisture and temperature, and we will get nice smooth graphs also).
  • The maximum consumption of the node will be 200mA during a maximum of 10 seconds per sampling (120sec/day).

Conclusions:

  • The node will be able to run normally with completely dark conditions (disabled recharging from the solar panel), considering the worse sampling time of 10 seconds per measurement (normally it will take 2 seconds aprox.) for about 16 days. I think this is great; well, it is necesary to review the numbers, but if they are correct, the results are quiet good, and maybe it is possible to reduce the capacitor size, we will see.

  • According to the specifications of the supercapacitor, It can run during 1 million cycles, and the solar panel has also a long life, about 20 years. So, considering the device running with normal environmental conditions, that means day-night cycles, where the supercapacitor will be recharged by the solar panel, and the rest of the electronic components do not have special stress and no mechanical stress at all, the system can reach a minimum of 10 years maintenance-free, as proposed.

Hi Adrian,

I have been so busy these days, so I cannot take a deeper look to your post.

I love the idea of using a supercapacitor for replacing a standard battery. Seems to be a nice solution to avoid maintenance on the nodes… Sure that a battery will have problems in the long time, and also the possible adverse conditions of the terrain (temperature, humidity, etc). The numbers looks good, hope it behave the same when deployed. Did you have numbers on price? not sure if the supercapacitors are cheap :slightly_smiling:

When do you expect to have a working prototype? It would be good to see pictures and performance of a real setup.

Hi Alvaro, well the price of the supercapacitor, is not necessary high enough to not be considered in this system, and the advantages as you have listed perfectly are considerable; for example a Maxwell supercap 350F cost 10€ aprox. (BCAP0350 E270 T11), good price I think! :grin:.

Well, right now, I am waiting some components, some of them coming from the US, and I hope in a maximun of 2 weeks, I will have all I need to assembly the first prototype, and for sure I will be sharing pictures of it. About the prototypes, what I am able to built right now, are those shown in the first pictures above, where there are already PCBs built, those devices will let us to start with the communication test, agronomical functionalities, etc., but is true that in this case, the power source will be provided by a solar panel and a li-po battery. That means that the devices are fully functional, with the disadvantage of replacing the battery every 2 or 3 years maybe. Now I am redesigning the circuit to be used with a supercap, but by the moment, what we have, is more than ennough to start having fun :yum: