plant watering automation arduino

House Plant Watering Automation with Arduino Project – Part 1

Plant Watering Automation Project Description

The goal of this project is to create an Arduino Plant Watering System which would not only time a watering cycle, but provide a feedback loop back to the controller. This type of automation has greater control over the system and will be much more efficient. It will also prevent you from over/under watering your plants.

Required materials and hardware

The first part of the plant watering automation project will require you to have the following items:

Optional Hardware:

soil moisture arduino

Connecting Everything Together

The sensor comes in two modules. The first one is the actual sensor or “fork” which goes into the soil. The second one is a breakout board which amplifies the signal from the sensor. The connection between them is done through two wires. The polarity does not matter as the “fork” is symmetrical. The other four pins on the breakout are VCC, GND, AO and DO. Two (VCC and GND) will go to power and the other two are signals. DO stands for Digital Output which is controlled by the potentiometer. It will be set high if a certain threshold is exceeded. The AO pin is an Analog Output which is what we are interested in. Connect it to pin A0 on the Arduino.

Programming the plant soil measurements

As mentioned above, our goal for this part of the plant watering automation project is to read the moisture level of our soil. Here’s the code which accomplishes just that and more:
void setup() {
Serial.begin(9600);
}
void loop() {
int humidityRaw = analogRead(A0); // 1023 to 0 ===> 0 to 100%
int humidityReal = map(humidityRaw, 1023, 0, 0, 100);
Serial.println(humidityReal);
delay(100);
}

The first initialization is used to start serial communication. Inside our loop we start by reading the analog signal from the sensor. It is then passed to a map function (reference: Map Function) which scales the signal to the value that is meaningful to us. Finally, the serial print is used to output the value to the terminal.

Conclusion

At this point you should be seeing the data passed from your sensor in the Arduino Serial Port. It should also be scaled to a percentage value through the map function. Hopefully, you were able to implement this functionality.

Thank you for reading & watching!
– EEEnthusiast

Comments 1

Leave a Reply

Your email address will not be published.

CommentLuv badge