Watering system with moisture sensor and firebase database.
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 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
}
}
}
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
How to plot the sensor data: Systems.maartens.website
License: MIT