Sie sind auf Seite 1von 4

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:

Soil Moisture Sensor FC-28 (Link: Arrela Soil Hygrometer Detection Module (Soil Moisture Sensor) For arduino )

Jumper Cables Female to Male (Link: Phantom YoYo 40P dupont cable 200mm male to female )

A potted plant or medium with soil

Arduino R3 Board

USB A-to-B Cable for the Arduino

Optional Hardware:

Breadboard (Link: 170 Points Mini Breadboard for Arduino Proto Shield (6 PCS) )

C O N N E C T I N G E V E R YT H I N G TOG E T H E R
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.

P R O G R A M M I N G TH E P L A N T S O I L M E A S U R E ME N T S
As mentioned above, our goal for this part of the plant watering automation project is to read the moisture level of our soil. Heres 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.

ARDUINO PLANT WATERING DRIP FEED


SYSTEM

In the second part of this project, we will be looking at driving a water pump
with the Arduino. Based on the moisture level in the soil, this will allow us to enable watering. Note that this may also be accomplished by a valve. In
other words, if your water container is higher than the plant, you can open/close a valve thus releasing the liquid.

REQUIRED MATERIALS AND HARDWARE


Our Arduino Plant Watering system will require several items in the second part. Ive pre-selected the following items:

Water Pump: 12V DC Mini Water Pump Product Link: Magicfly DC30A-1230 12V DC 2 Phase CPU Cooling Car Brushless Water Pump
Waterproof Submersible

Relay: 5V Normally Open (NO) relay Product Link: uxcell HK3FF-DC5V-SHG DC 5V 5PIN AC250V 10A DC30V 10A PCB Power Relay

Transistor: 2N4401 BJT Product Link: Set of 50 pcs TRANSISTOR 2N4401 NPN 600mA (0.6A) 40V

Resistor: 220ohm Product Link: E-Projects 220 Ohm Resistors 1/4 Watt 5% 220R (100 Pieces)

Optional Hardware:

Breadboard (Link: 170 Points Mini Breadboard for Arduino Proto Shield (6 PCS) )
Power Supply: 12V rechargeable power supply Product Link: Fashion Outlet Mini Portable DC-168 12V Rechargeable Li-ion Battery Pack
for CCTV Camera

C O N N E C T I N G Y O U R AR D U I N O W ATE R I N G S Y S T E M
The connections for the arduino plant watering project are quite simple. You will need to connect the base of the transistor through the current limiting
resistor and into the arduino digital pin. The emitter and collector of the BJT are used to toggle the relay. They need to go through the coil. When the
coil is energized, the relay will close on the high voltage side. You will need to create a loop with the pump, relay high side and the 12v battery. View my
video for detailed instructions on how to build the full circuit. You will have your Arduino watering system running in no time!

Here is the full wiring diagram for the circuit. Note: the humidity sensor itself connects to the red module you can see on the drawing.

P R O G R A M M I N G T H E R E L AY D R I V E R AN D T H E P U M P T O T U R N O N B A S E D
O N W ATE R L E V E L
CODE: FULL CODE ON GITHUB
In this part of the project, we are ready to water our plant. Most of the code is reapplied from part 1; the only difference being the driver for the relay

and the condition to water the plant.


int waterPump = 13;
void setup() {
Serial.begin(9600);
pinMode(waterPump, OUTPUT);
}
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);
if (humidityReal < 90) { digitalWrite(waterPump, HIGH); }else{ digitalWrite(waterPump, LOW); } }

As you can see, the code is not extremely different than what we had in the first part of the tutorial for the automatic watering system. The major
difference is the initialization of the relay pin and the check for the moisture level to be below 90%.

CONCLUSION
You should now have a fully implemented arduino plant watering system in your house. You can safely leave this running while you are on vacation or
travelling. The biggest watch-out for this setup is the fact that a restive sensor will corrode overtime. It can either be replaced or triggered based on a
timer which would prolong its life. Lastly, a respectable automatic watering system would have an integrated light system. I'll let you figure that one out.
Make sure to update me with any projects you've built!

Das könnte Ihnen auch gefallen