MICROCONTROLLER BASED AUTOMATIC PLANT IRRIGATION SYSTEM Mr. Premansu Rath 1, Niti Bharti 2,Sanjana Varanasi 3 and Shivani Varanasi 4 1 Asst. Professor, Gandhi Institute Of Engineering and Technology, Gunupur 2 Under Graduate, Gandhi Institute Of Engineering and Technology, Gunupur Abstract Water is a prime concern in our life. Everyone uses water very much. Excess usage may lead to problem of water crisis in the future purpose. The Microcontroller based Automatic plant irrigation which controls the usage of water and also reduces the Man power. This Project presented here waters your plants regularly when you are out for vocation. The circuit comprises sensor parts built using op-amp IC LM324. Op-amp s are configured here as a comparator. Two stiff copper wires are inserted in the soil to sense the whether the Soil is wet or dry. The Microcontroller was used to control the whole system it monitors the sensors and when more than two sensors sense the dry condition then the microcontroller will switch on the motor and it will switch off the motor when all the sensors are in wet. The microcontroller does the above job it receives the signals from the sensors, and this signals operated under the control of software which is stored in ROM. I. INTRODUCTION 1.1 BLOCK DIAGRAM OF AUTOMATIC PLANT IRRIGATION SENSOR 1 SENSOR 2 SENSOR 3 MICRO CONTROLLER (AT89C51) 16 x 2 LCD DISPLAY MOTOR UNIT SENSOR 4 LAMP 1.2 Block diagram description: The circuit comprises sensor parts built using op-amp IC LM324. Op-amp s are configured here as a comparator. Two stiff copper wires are inserted in the soil to sense the whether the Soil is wet or dry. The Microcontroller was used to control the whole system it monitors the sensors and when more than two sensors sense the dry condition then the microcontroller will switch on the motor and it will switch off the motor when all the sensors are in wet. 1.3 Microcontroller: The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (EPROM). The device is manufactured using Atmel s high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pin out. The on-chip flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. 1.4 Sensor: In our project sensor sense soil whether soil is wet or dry.lm 324 op amp used as sensor. @IJMTER-2016, All rights Reserved 653
1.5 Stepper Motor: If more than one sensors sense soil is dry then stepper motor is ON. If one or none sensors sense soil is wet then stepper motor is OFF. It is interfacing with microcontroller by using ULN2003 driver circuit 1.6 LCD 16 x 2: LCD in this project is used to display the messages to the how many sensors sense wet and dry also state of motor unit(on/off). 2.1 What is a Microcontroller? Block diagram of microcontroller II. AT89C51 MICROCONTROLLER A microcontroller is an integrated chip that is often part of an embedded system. The microcontroller includes a CPU: ALU,PC,SP and registers, RAM, ROM, I/O ports, and timers like a standard computer, but because they are designed to execute only a single specific task to control a single system, they are much smaller and simplified so that they can include all the functions required on a single chip.. 2.2 ADVANTAGES OF MICROCONTROLLERS: Their powerful, cleverly chosen electronics is able to control a variety of processes and devices (industrial automatics, voltage, temperature, engines, etc) independently or by means of I/O instruments such as switches, buttons, sensors, LCD screens, relays etc. Their low cost makes them suitable for installing in places which attracted no such interest in the past. This is the fact accountable for today's market being swamped with cheap automatons and "intelligent" toys. 2.3 TYPES OF 8051 MICROCONTROLLER: The 8051 has the widest range of variants of any embedded controller on the market. The smallest device is the Atmel 89c1051, a 20 Pin FLASH variant with 2 timers, USART, 20mA. The fastest parts are from Dallas, with performance close to 10 MIPS! The most powerful chip is the Infineon Technologies 80C517A, with 32 Bit ALU, 2 UARTS, 2K RAM, PLCC84 package, 8 x 16 Bit PWMs, and other features. 2.4 ATMEL Microcontroller 2.4.1 FEATURES: Compatible with MCS-51 Products. 4K Bytes of In-System Reprogrammable Flash Memory. Endurance: 1,000 Write/Erase Cycles. Fully Static Operation: 0 Hz to 24 MHz. Three-level Program Memory Lock. @IJMTER-2016, All rights Reserved 654
2.4.2 Overview: 2.4.3 Block diagram The AT89C51 provides the following standard features: 4Kbytes of Flash, 128 bytes of 13.RAM, 32 I/O lines, two 16-bit timer/counters, five vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. 2.4.3 Pin Description: VCC: Supply voltage. GND: Ground. @IJMTER-2016, All rights Reserved 655
2.5 Types of Memory: The 8051 has three very general types of memory. To effectively program the 8051 it is necessary to have a basic understanding of these memory types. 2.5.1 On-Chip Memory refers to any memory (Code, RAM, or other) that physically exists on the microcontroller itself. On-chip memory can be of several types. 2.5.2 External Code Memory is code (or program) memory that resides off-chip. This is often in the form of an external EPROM. 2.5.2.1 External RAM is RAM memory that resides off-chip. This is often in the form of standard static RAM or flash RAM. 2.5.2.2 Register Banks: The 8051 uses 8 "R" registers which are used in many of its instructions. These "R" registers are numbered from 0 through 7 (R0, R1, R2, R3, R4, R5, R6, and R7). These registers are generally used to assist in manipulating values and moving data from one memory location to another. 2.5.2.3 Bit Memory: The 8051, being a communications oriented microcontroller, gives the user the ability to access a number of bit variables. These variables may be either 1 or 0. There are 128 bit variables available to the user, numbered 00h through 7Fh. The user may make use of these variables with commands such as SETB and CLR. 2.6 REGISTER IN 89C51 1. SFR 2. PO 3. SP 4. DPL/DPH 5. TCON 6. SCON 7. TMOD 8. TL0/THO 2.7 BASIC REGISTERS:: The Accumulator If you ve worked with any other assembly languages you will be familiar with the concept of an Accumulator register. The Accumulator, as its name suggests, is used as a general register to accumulate the results of a large number of instructions. The "R" registers The "R" registers are a set of eight registers that are named R0, R1, etc. up to and including R7. These registers are used as auxiliary registers in many operations. @IJMTER-2016, All rights Reserved 656
The "B" Register The "B" register is very similar to the Accumulator in the sense that it may hold an 8-bit (1- byte) value. The "B" register is only used by two 8051 instructions: MUL AB and DIV AB. The Data Pointer (DPTR) The Data Pointer (DPTR) is the 8051 s only user-accessible 16-bit (2-byte) register. The Accumulator, "R" registers, and "B" register are all 1-byte values. DPTR, as the name suggests, is used to point to data. It is used by a number of commands which allow the 8051 to access external memory. The Program Counter (PC) The Program Counter (PC) is a 2-byte address which tells the 8051 where the next instruction to execute is found in memory. When the 8051 is initialized PC always starts at 0000h and is incremented each time an instruction is executed. The Stack Pointer (SP) The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1-byte) value. The Stack Pointer is used to indicate where the next value to be removed from the stack should be taken from. When you push a value onto the stack, the 8051 first increments the value 2.8 INTERRUPTS As stated earlier, program flow is always sequential, being altered only by those instructions which expressly cause program flow to deviate in some way. However, interrupts give us a mechanism to "put on hold" the normal program flow, execute a subroutine, and then resume normal program flow as if we had never left it. The event may be one of the timers "overflowing," receiving a character via the serial port, transmitting a character via the serial port, or one of two "external events." Programming the Flash The AT89C51 is normally shipped with the on-chip Flash memory array in the erased state (that is, contents = FFH)and ready to be programmed. The programming interface accepts either a high-voltage (12-volt) or a low-voltage (VCC) program enable signal. 3.1 Power supply circuit III. HARDWARE DESCRIPTION Any invention of latest technology cannot be activated without the source of power. So in this fast moving world we deliberately need a proper power source which will be apt for a particular requirement. All the electronic components starting from diode to ics only work with a DC. 3.1.1 Transformer A bridge rectifier coupled with a step down transformer is used for our design. The voltage rating of transformer used is 0-12V and the current rating is 500mA. When AC voltage of 230V is applied across the primary winding an output AC voltage of 12V is obtained. One alteration of input causes the top of transformer to be positive and the bottom negative. The next alteration will temporarily cause the reverse. @IJMTER-2016, All rights Reserved 657
3.1.2 Rectifier In the power supply unit, rectification is normally achieved using a solid state diode. Diode has the property that will let the electron flow easily at one direction at proper biasing condition. Bridge rectifiers of 4 diodes are used to achieve full wave rectification. 3.1.3 Filtering unit Filter circuit which is usually a capacitor acts as a surge arrester always follows the rectifier unit. This capacitor is also called as a decoupling capacitor or a bypass capacitor, is used not only to short the ripple with frequency to ground but also leave the frequency of the DC to appear at the output. 3.1.4 Regulators The voltage regulators play an important role in any power supply unit. The primary purpose of a regulator is to aid the rectifier and filter circuit in providing a constant DC voltage to the device. IV. INTERFACES 4.1 Stepper Motor Interfacing 4.1.1 Introduction: A stepper or stepping motor converts electronic pulses into proportionate mechanical movement. Each revolution of the stepper motor's shaft is made up of a series of discrete individual steps. A step is defined as the angular rotation produced by the output shaft each time the motor receives a step pulse. Figure 1Paper drive mechanism using stepper machine 4.1.2 TYPES OF STEPPER MOTOR: Most popular types of stepper motors are-permanent-magnet (PM) -Variable reluctance (VR) and -Hybrid motor. 4.1.2.1 Permanent-magnet stepper motor: The permanent-magnet stepper motor operates on the reaction between a permanent-magnet rotor and an electromagnetic field.. Both the stator and rotor have teeth. 4.1.2.2 Variable-reluctance (VR) Stepper Motors The variable-reluctance (VR) stepper motor differs from the PM stepper in that it has no permanent-magnet rotor and no residual torque to hold the rotor at one position when turned off. 4.1.2.3 Hybrid Stepper Motors The hybrid step motor consists of two pieces of soft iron, as well as an axially magnetized, round permanent-magnet rotor. 4.1.4 Applications of stepper Motor: Stepper motors are used in a wide variety of applications in industry, including computer peripherals, business machines, motion control, and robotics, which are included in process control @IJMTER-2016, All rights Reserved 658
and machine tool applications. Its applications are found in Computer Peripherals, Business Machines Process Control, and in Machine Tools. 4.1.6 DRIVER FOR STEPPER MOTOR: We have used ULN2003driver in our project to interface with the stepper motor required for the automatic opening of the door of the industry when authorized person enters. FEATURES OF ULN2003: -ULN2003 is a 16 bit IC -It is of Darlington pair amplifier (1 to 1000) -1.2 Amps current is supported. 4.2 RELAY: The relay is an electromagnetic device which energies when the supply is given. Relay circuit is used to activate the relay through microcontroller. The relay is an electromagnetic device which energies when the supply is given. Relay circuit is used to activate the relay through microcontroller. 4.3 LCD DISPLAY UNIT: In our project we use an intelligent LCD display of two lines,20 character per line, that is interfaced to the 8051. The display contains two internal byte-wide registers, one for commands (RS=0) and the second for the characters to be displayed (RS=1). It also contains a user-programmed RAM area that can be programmed to generate any desired character that can be formed using a dot matrix. To distinguish between these two data areas, the hex command byte 80 will be used to signify that the display RAM address 00h is chosen. V. ASSEMBLY LANGUAGE 5.1 INTRODUCTION TO ASSEMBLY LANGUAGE PROGRAMMING Unlike the other programming languages catalogued here, assembly language is not a single language, but rather a group of languages. Each processor family (and sometimes individual processors within a processor family) has its own assembly language. In contrast to high level languages, data structures and program structures in assembly language are created by directly implementing them on the underlying hardware. So, instead of cataloging the data structures and program structures that can be built (in assembly language you can build any structures you so desire, including new structures nobody else has ever created), we will compare and contrast the hardware capabilities of various processor families. Assembly language programs must be converted into machine language by a program called assembler. Assembly language is generally referred to as a low level language because it directly deals with the internal structure of the CPU to program in assembly language one must know all the registers of CPU and the size of each and other details as well. Agriculture Gardening Soil moisture detection VI. APPLICATIONS VII. CONCLUSION The conclusion of this project is to watering to the plants, to control usage of water and reducing man power purpose. In this project we are using AT889C51 micro controller and by programming the micro controller depending on sensors output and stepper motor which are used for the watering to the plants and we can use the project in the agriculture and soil moisture detection. @IJMTER-2016, All rights Reserved 659
REFERENCES [1] M.A. Mazidi & J G mazidi, The 8051 micro controller and embedded systems, pearson education asia, (2002). [2] Scott MAC. Kenzie, The 8051 micro controller, second edition, pretice hall Inc., USA, (1995). [3] John B Peatmen, Design with micro controllers, Mc- Graw Hill, USA, [4] Michael Predko, Hand- Book of micro controllers, Mc-Graw Hill, New-york, (1999). [5] Jonathan W Valvano, Embeded micro processor systems, Thimson asia pvt. Ltd, Singapore, (2000). [6] Takashi kenjo and Akira sugwara, Stepping motors and their micro processor control, Oxford science Publications, Clarendon press, Oxford, (1994). Internal Circuit Diagram of LM339:- International Journal of Advancements in Research & Technology, Volume. @IJMTER-2016, All rights Reserved 660