Automatic Drip Irrigation System. How to make?

Programming, Tutorial, Coding, New Design, and/or any project for your Arduino and Raspberry Pi can post your topic /suggestion here.
User avatar
DK Pramis
Posts: 4
Joined: Tue Oct 24, 2017 5:35 pm

Automatic Drip Irrigation System. How to make?

Sat Oct 28, 2017 8:22 pm

It has three sections: sensor, microcontroller and water-pump motor circuits.
prototype watering the plant in a flower pot.jpg
The sensor circuit detects soil condition by measuring the soil voltage and comparing it with a reference voltage. A BC548 transistor is used to drive relay RL1. DC motor pump M1 is connected between the normally-open (N/O) pin and pole of the relay.

If the soil is dry, i.e., the ground voltage is greater than the reference voltage, the microcontroller (ATmega16) gives a logic-1 output signal. The transistor conducts to energise relay RL1 (as its pole pin comes in contact with the N/O pin) and the motor turns on with power supply provided from the battery.

When the soil is wet, i.e., soil voltage is less than the reference voltage, the logic-0 signal of the microcontroller turns the transistor, and hence the motor switches ‘off.’
The motor pump status (‘on’ or ‘off’) and soil condition (‘dry’ or ‘wet’) are displayed on LCD1.
indicating the motor status in wet soil condition.jpg
indicating the motor status in wet soil condition.jpg (71.74 KiB) Viewed 451 times
Software

The software was developed using four tools: CodeVisionAVR, Proteus, SinaProg and PCB Wizard.

CodeVisionAVR
The coding and hex file were generated using the Evaluation version of CodeVisionAVR tool. In CodevisionAVR, open a new project and select ‘Target AVR Chip’ as ATmega. Select the ATmega16 chip with 8MHz clock frequency, followed by output port as Port B0. Then select ‘ADC Enabled’ option and set voltage reference as AREF pin with 1000kHz clock. Next, select ‘Enable Alphanumeric LCD Support’ option followed by Port C (PC0-RP6) with 16 characters.

In ‘Program’ menu, select ‘Generate, Save and Exit’ option. Save the file three times with the same name but different extensions as indicated by the software. In the coding window, start code within the while loop to read the sensor output signal at AD0 pin of the microcontroller. Next, put a condition if reference voltage 2V is greater than or equal to the sensor signal. Then build the entire project file to produce the hex file.

To simulate the code, double-click the controller (U1) and insert the hex file. Simulation runs when the sensed voltage is higher than the reference voltage (2V). The LCD shows that the soil is dry and the motor is ‘on.’ When the sensed voltage is less than the reference voltage, the LCD shows the soil as ‘wet’ and the motor as ‘off.’

USBasp
USBasp is a USB in-circuit programmer for Atmel AVR controllers, similar to AVRuPro+ board. It consists of an ATMega88 or an ATMega8 and a few passive components. The programmer uses a firmware-only USB driver, requiring no particular USB controller. It is used along with SinaProg software to burn the hex file into the controller.

SinaProg
SinaProg software is used to burn the hex code and set fuse bits for the AVR microcontroller. It is a good software tool for hobbyists and experimenters alike. Connect the AVR USB programmer such as USBasp to your PC. Load the hex code, select the device programmer and set the fuses (Int.2MHz)

PARTS LIST:
parts-list.jpg
parts-list.jpg (63.78 KiB) Viewed 451 times
THE SOURCE CODE AND TEMPLATE
Automatic Drip Irrigation System.rar
(99.69 KiB) Downloaded 28 times
automaticdripirrigationsystem.zip
(234.29 KiB) Downloaded 28 times
First, program the microcontroller with the hex code and place it on the PCB. Connect the moisture sensor to the circuit, ensuring that Vcc, GND and D0 pins are properly connected. Note that the moisture sensor includes YL-38 and YL-69 modules. YL-38 is basically a driver and isolator for YL-69 moisture probe (Fig. 8). YL-38 has four pins (Vcc, GND, D0 and A0) on one side, and two pins on the other side, which are used to connect the prongs/probes (YL-69) that are to be inserted into the soil. D0 pin is used for digital output and A0 pin (not used in this project) is used for analogue output. The module also has a potentiometer to calibrate the sensitivity of the sensor.
Prongs with driver.jpg
Prongs with driver.jpg (83.49 KiB) Viewed 451 times
Connect a 9V battery to the circuit. Regulator IC 7805 provides regulated 5V output to run the circuit. Note that you can also use a 12V DC power supply depending on your motor pump. During testing at EFY Lab, a 12V DC supply was used for the water motor pump.
To test the project, insert the sensor probe into the soil. Switch on the power supply to the circuit. If the soil is dry, the motor will automatically turn on and the LCD will show ‘Dry soil, Motor on’ message.

You can further extend this project to make a practical drip irrigation system. Typically, a drip irrigation system requires some special components and control systems. For example, you may need distribution lines (both large- and small-diameter pipes and pipe fittings), electronic or hydraulic control valves, poly fittings and accessories (to make connections), emitters, drippers or spray heads depending on the design and application.


Return to “ARDUINO AND RASPBERRY PI”

Links

In total there are 10 users online :: 0 registered, 0 hidden and 10 guests
Registered users: No registered users
Most users ever online was 156 on Sun Jun 17, 2018 7:42 am
Total posts 405
Total topics 293
Total members 58
Our newest member nagesh nilkanth
No birthdays today