GewoonMaarten / iot-watering-system

Watering system with a moisture sensor and firebase database.
MIT License
6 stars 5 forks source link
arduino esp8266 firebase home-automation iot moisture-sensor nodejs watering

IOT watering system

Watering system with moisture sensor and firebase database.

Firebase

This project uses Firebase from Google to store the data collected from the moisture sensor. The Arduino code only uploads the value from the moisture sensor and whether the pump is on to the database. There is a Nodejs project include which, when uploaded as a cloud function to the Firebase database will add a datetime to the newly added values. Another function is added to clean the measurements that are older than one month. This data is not valuable to me so remove it.

The JSON structure

The cloud function will format a datetime based on the machine time. the format is a YYYY-MM-DD HH:mm:ss, e.g.: 2017-04-13 16:59:23. The Arduino codes add a boolean based on whether the pump is currently active. And the value the value of the moisture sensor is added. This all combined gives the following data structure:

{
  "measurement" : {
    "-KgQiGUIjxPrxezXVW1H" : {
      "dateTime" : "2017-04-13 16:59:23",
      "isWatering" : 0,
      "value" : 2.72
    }
  }
} 

The Hardware

Parts list:

I bought most of the things on Ali Express so thats where I will provide links for.

Schematic:

Schematic

PCB:

pcb

The final product:

Related

How to plot the sensor data: Systems.maartens.website

License: MIT