Implementing a plant monitoring system which waters the plant when moisture level of soil is low & also monitors the temperature & moisture.
Soil moisture sensor
Before we move to mount the soil moisture sensor, we will go through the principle of soil moisture sensor. There are 4 pins in the sensor:
The sensor provides both digital and analog output which can be used for different purpose. The digital threshold can be changed using the potentiometer. So id we use digital output then we will have only two moisture levels. We can define one moisture level as pump 'TURN OFF' and the other level as pump 'Turn ON'. But we have a disadvantage here using the digital output. Whenever the motor starts, and the moisture level increases near sensor and crosses the threshold, pump will be switched off. Thus, watering will be for very short period of time and water will not reach into deep roots.
Other option is to use analog output. Sensor returns analog value between 0-1023, where 0 is for wet soil and 1023 for dry soil. Here we can set two thresholds, one for starting the watering and one for stopping.
For this project we are using analog output of soil moisture sensor.
Temperature sensor LM35 -
The temperature sensor will print the temperature of the room on the
evive's screen. LM35 sensor has been used for this. If you are using the temperature sensor for the first time then you may follow this code which prints the temperature around the sensor on the serial monitor in degree Celsius.
For pinouts you can see this image
just join the VCC in 5 volt of evive and GND to ground and output to any analog pin we done it in A0.
Humidity sensor provides the information humidity level of air around the plant. It has 3 pins,
Humidity sensor detects the humidity of the air around it. It has three pins that are VCC, GND and analog pin. Just connect the VCC to 5 volt and GND to ground and analog pin to A2 or whatever you want.