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.
- WEmos D1 mini
- Power Relay (5v)
- Small pump
- Tube
- Moisture sensor
- A way to convert 12v to 5v. Is used this. But you could use a 5v regulator.
- Diode
- NPN transistor. I used a BC547
- Wire
- 12v powersupply with 5.5 * 2.1mm DC jack
Schematic:
PCB:
Related
How to plot the sensor data: Systems.maartens.website
License: MIT

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.




