Post Top Ad

Tuesday, February 6, 2024

on video Automatic Watering System for Plants using Arduino



Automatic Watering System for Plants using Arduino

This Instructable will explain how to make a plant watering system powered by Arduino. Each of the components is specified with a link to where they can be purchased online. The process of making the system will be detailed step-by-step from the hardware to the code.


Additionally you will need:


- some wire cutters


- plant pot with hole in bottom for drainage + tray for underneath (if inside)


- plant + 50/50 compost/soil mix


- a stand/base to compile the parts on (possibly piece of 12mm plywood (350 x 200mm - if using a small plant pot this should be okay)


TOTAL COST: £54.31 (note that prices will vary depending on supplier and the country you order within).

This sketch gives an overview of the logic behind the system. The system takes 240v of mains electricity through a step-down converter power supply transforming it to a 12v output. The Arduino is connected to a moisture sensor and relay via a breadboard. The Moisture sensor takes multiple readings from the soil each minute and when the moisture content drops below the pre-set value the relay is triggered sending 12v to the water pump. The power is cut again when the moisture sensor reads a value greater than 70% content.


This step is specific to the specified power supply. If you have no previous experience of wiring you MUST seek the advice of a qualified professional. 240v is potentially deadly.


POWER IN - Mains Electricity


1. Take the live wire and connect it to the 'L' terminal on the power supply. In the image this is the brown wire.


2. Take the Neutral wire and connect it to the 'N' terminal. Ensure that both are securely connected with none of the copper wire exposed.


POWER OUT - 12v Conversion


1. Connect a brown wire to the V+ terminal.


2. Connect a blue wire to the Com(Neutral) Terminal.

This component is called a 'Chocolate Block', it is used to take a single wire input and connect it to multiple wire outputs. For this project you need two channels.


1. Wire the brown live wire from the power supply output to one side of the chocolate block.


2. Wire the blue neutral wire from the power supply output to the other channel of the chocolate block.


3. Run two wires of the same color from the other side of each channel. These steps are best understood when read in conjunction with the image above.

The Arduino is the 'brains' of the system. Follow these steps to wire it up, it is important that you use the same colored wire as in my explanation to avoid confusion further down the line.


1. Connect a 'male' red wire to the pin hole marked '5v' leave the other end disconnected for now.


2. Connect a gray wire to the pin hole marked 'A1' leave the other end disconnected for now.


3. Connect the one of the blue wires running from the chocolate block to the pin hole marked 'GND'.


4. Connect one of the brown wires running from the chocolate block to the pin hole marked 'VIN'.


5. On the other side of the Arduino Board, connect a red wire to the pin hole marked '12v' leave the other side disconnected for now.

This component is called a breadboard, I elected to use it in this project to save myself and others from having to solder components together. It works like this;


HOW IT WORKS


The board is rectangular, place it on the surface you are working on in a portrait orientation. The holes are electrically connected to one another horizontally, but not vertically. This means that you can plug in various pins to the board running horizontally and power will flow through them all in series.


BACK TO THE PROJECT


You may find it useful to refer to the sketch at the top of this Instructable in addition to following the written instructions.


In connected series (Horizontally at a portrait orientation) connect the following wires.


1. The '5v' pin that runs from the Arduino board and is currently not connected at the other end. - In this same series connect two more wires of the same color and leave the other end of the wires disconnected for now.

2. Below take the wire that runs from the 'GND' pin hole on the arduino. Connect another two wires of the same color to the same line and leave the other end of the wires disconnected for now.


1. From the breadboard take one of the positive wires (Brown) and connect it to the moisture sensor module


2. From the breadboard take one of the neutral wires (Blue) and connect it to the other second input hole on the moisture sensor module.

From the sensor module in the last step connect two 'female' wires to the other side, run these to the moisture sensor itself. The length of these wires is important for you to decide as it is what will dictate how far the plant can sit from the components on completion.


This component is called a 'Relay' it is essentially a switch. When the moisture sensor takes a reading that is less that 40% moisture content of the soil the arduino will trigger the relay which sends 12v from the power supply to the water pump.

1. Take the last remaining positive (brown) wire that is connected to the breadboard and connect this to the pin hole on the relay marked 'NC'


2. Take the last remaining neutral (blue) wire that is connected to the breadboard and connect this to the pin hole marked 'NO'


3 On the other side of the Relay connect a red wire to the hole marked 'VCC', a yellow wire to 'GND' and a brown wire to 'INN'

WARNING - DO NOT RUN THE PUMP DRY, IT WILL DESTROY THE PLASTIC COGS


1. Take the positive wire (brown) running from the relay and connect it to one of the pins of the water pump. It doesn't matter which pin you connect it to, however, by changing this around you change the direction that the pump will push the water in.


2. Take the remaining neutral (blue) cable from the chocolate block and connect it to the other pin on the water pump. Ensure that these two cables do not touch as they will spark.


3. Cut the plastic tube in two parts and connect a piece to each end of the water pump, you may also choose to secure the pipe with zip-ties and epoxy. It is extremely important that the pump does not lie given its proximity to live electrical components.

Building a Housing for Your Watering System

I built the housing seen in the images from 16mm birch faced ply offcuts from a previous project, you can make the housing however you please. If you choose to stick the components to the housing, ensure that you do not use a conductive adhesive as this will risk short-circuiting the system.

The final step is to write the code and upload it to the Arduino. The code seen in the image above works for this system. In essence this code works to take an almost constant moisture content reading. When the reading is below 30% 'humidity real', the relay is triggered, sending 13v to the water pump. The water pump is cut again when the moisture content is read as having risen. You may wish to change this value depending on the plant type, environmental conditions etc.

 



Automatic Watering System for Plants using Arduino

This Instructable will explain how to make a plant watering system powered by Arduino. Each of the components is specified with a link to where they can be purchased online. The process of making the system will be detailed step-by-step from the hardware to the code.


Additionally you will need:


- some wire cutters


- plant pot with hole in bottom for drainage + tray for underneath (if inside)


- plant + 50/50 compost/soil mix


- a stand/base to compile the parts on (possibly piece of 12mm plywood (350 x 200mm - if using a small plant pot this should be okay)


TOTAL COST: £54.31 (note that prices will vary depending on supplier and the country you order within).

This sketch gives an overview of the logic behind the system. The system takes 240v of mains electricity through a step-down converter power supply transforming it to a 12v output. The Arduino is connected to a moisture sensor and relay via a breadboard. The Moisture sensor takes multiple readings from the soil each minute and when the moisture content drops below the pre-set value the relay is triggered sending 12v to the water pump. The power is cut again when the moisture sensor reads a value greater than 70% content.


This step is specific to the specified power supply. If you have no previous experience of wiring you MUST seek the advice of a qualified professional. 240v is potentially deadly.


POWER IN - Mains Electricity


1. Take the live wire and connect it to the 'L' terminal on the power supply. In the image this is the brown wire.


2. Take the Neutral wire and connect it to the 'N' terminal. Ensure that both are securely connected with none of the copper wire exposed.


POWER OUT - 12v Conversion


1. Connect a brown wire to the V+ terminal.


2. Connect a blue wire to the Com(Neutral) Terminal.

This component is called a 'Chocolate Block', it is used to take a single wire input and connect it to multiple wire outputs. For this project you need two channels.


1. Wire the brown live wire from the power supply output to one side of the chocolate block.


2. Wire the blue neutral wire from the power supply output to the other channel of the chocolate block.


3. Run two wires of the same color from the other side of each channel. These steps are best understood when read in conjunction with the image above.

The Arduino is the 'brains' of the system. Follow these steps to wire it up, it is important that you use the same colored wire as in my explanation to avoid confusion further down the line.


1. Connect a 'male' red wire to the pin hole marked '5v' leave the other end disconnected for now.


2. Connect a gray wire to the pin hole marked 'A1' leave the other end disconnected for now.


3. Connect the one of the blue wires running from the chocolate block to the pin hole marked 'GND'.


4. Connect one of the brown wires running from the chocolate block to the pin hole marked 'VIN'.


5. On the other side of the Arduino Board, connect a red wire to the pin hole marked '12v' leave the other side disconnected for now.

This component is called a breadboard, I elected to use it in this project to save myself and others from having to solder components together. It works like this;


HOW IT WORKS


The board is rectangular, place it on the surface you are working on in a portrait orientation. The holes are electrically connected to one another horizontally, but not vertically. This means that you can plug in various pins to the board running horizontally and power will flow through them all in series.


BACK TO THE PROJECT


You may find it useful to refer to the sketch at the top of this Instructable in addition to following the written instructions.


In connected series (Horizontally at a portrait orientation) connect the following wires.


1. The '5v' pin that runs from the Arduino board and is currently not connected at the other end. - In this same series connect two more wires of the same color and leave the other end of the wires disconnected for now.

2. Below take the wire that runs from the 'GND' pin hole on the arduino. Connect another two wires of the same color to the same line and leave the other end of the wires disconnected for now.


1. From the breadboard take one of the positive wires (Brown) and connect it to the moisture sensor module


2. From the breadboard take one of the neutral wires (Blue) and connect it to the other second input hole on the moisture sensor module.

From the sensor module in the last step connect two 'female' wires to the other side, run these to the moisture sensor itself. The length of these wires is important for you to decide as it is what will dictate how far the plant can sit from the components on completion.


This component is called a 'Relay' it is essentially a switch. When the moisture sensor takes a reading that is less that 40% moisture content of the soil the arduino will trigger the relay which sends 12v from the power supply to the water pump.

1. Take the last remaining positive (brown) wire that is connected to the breadboard and connect this to the pin hole on the relay marked 'NC'


2. Take the last remaining neutral (blue) wire that is connected to the breadboard and connect this to the pin hole marked 'NO'


3 On the other side of the Relay connect a red wire to the hole marked 'VCC', a yellow wire to 'GND' and a brown wire to 'INN'

WARNING - DO NOT RUN THE PUMP DRY, IT WILL DESTROY THE PLASTIC COGS


1. Take the positive wire (brown) running from the relay and connect it to one of the pins of the water pump. It doesn't matter which pin you connect it to, however, by changing this around you change the direction that the pump will push the water in.


2. Take the remaining neutral (blue) cable from the chocolate block and connect it to the other pin on the water pump. Ensure that these two cables do not touch as they will spark.


3. Cut the plastic tube in two parts and connect a piece to each end of the water pump, you may also choose to secure the pipe with zip-ties and epoxy. It is extremely important that the pump does not lie given its proximity to live electrical components.

Building a Housing for Your Watering System

I built the housing seen in the images from 16mm birch faced ply offcuts from a previous project, you can make the housing however you please. If you choose to stick the components to the housing, ensure that you do not use a conductive adhesive as this will risk short-circuiting the system.

The final step is to write the code and upload it to the Arduino. The code seen in the image above works for this system. In essence this code works to take an almost constant moisture content reading. When the reading is below 30% 'humidity real', the relay is triggered, sending 13v to the water pump. The water pump is cut again when the moisture content is read as having risen. You may wish to change this value depending on the plant type, environmental conditions etc.

 

No comments:

Post a Comment

Post Top Ad

Pages