Sie sind auf Seite 1von 13


GSM controlled automatic irrigation system using 8051 microcontroller


GSM controlled automatic irrigation system using 8051 microcontroller

A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Microcontrollers are used in automatically controlled products and devices. A microcontroller can be considered a selfcontained system with a processor, memory and peripherals and can be used as an embedded system. Since microcontroller is an embedded system it can be interfaced with GSM modem.[1] A microcontroller is a computer with most of the necessary support chips onboard. All computers have several things in common, namely: . A central processing unit (CPU) that executes programs. . Some random-access memory (RAM) where it can store data that is variable. . Some read only memory (ROM) where programs to be executed can be stored. . Input and output (I/O) devices that enable communication to be established

with the outside world i.e. connection to devices such as keyboard, mouse, monitors and other peripherals.There are a number of other common characteristics that define microcontrollers. If a computer matches a majority of these characteristics, then it can be Classified as a microcontroller. Microcontrollers may be: . Embedded inside some other device (often a consumer product) so that they can control the features or actions of the product. Another name for a microcontroller is therefore an embedded controller. . Dedicated to one task and run one specific program. The program is stored in ROM and generally does not change. . A low-power device. A battery-operated microcontroller might consume as little as 50 milliwatts. A microcontroller may take an input from the device it is controlling and controls the device by sending signals to different components in the device. A microcontroller is often small and low cost. The components may be chosen to minimise size and to be as inexpensive as possible.

Mukesh Patel School of Technology Management & Engineering

The actual processor used to implement a microcontroller can vary widely. In many products, such as microwave ovens, the demand on the CPU is fairly low and price is an important consideration. In these cases, manufacturers turn to dedicated microcontroller chips devices that were originally designed to be low-cost, small, low-power, embedded CPUs. The Motorola 6811 and Intel 8051 are both good examples of such chips.
The 8051 architecture provides many functions (CPU, RAM, ROM, I/O, interrupt logic, timer, etc.) in a single package

8-bit ALU, Accumulator and 8-bit Registers; hence it is an 8-bit microcontroller 8-bit data bus It can access 8 bits of data in one operation 16-bit address bus It can access 216 memory locations 64 KB (65536 locations) each of RAM and ROM On-chip RAM 128 bytes (data memory) On-chip ROM 4 Kbyte (program memory) Four byte bi-directional input/output port UART (serial port) Two 16-bit Counter/timers Two-level interrupt priority Power saving mode (on some derivatives)

Fig.1.1 Block diagram of a microcontroller

Mukesh Patel School of Technology Management & Engineering

Fig.1.2 Constituent parts of a microcontroller

One particularly useful feature of the 8051 core was the inclusion of a Boolean processing engine which allows bit-level Boolean logic operations to be carried out directly and efficiently on select internal registers and select RAM locations. This advantageous feature helped cement the 8051's popularity in industrial control applications because it reduced code size by as much as 30%. Another valued feature is the inclusion of four bank selectable working register sets which greatly reduce the amount of time required to complete an interrupt service routine. With a single instruction the 8051 can switch register banks as opposed to the time consuming task of transferring the critical registers to the stack or designated RAM locations. These registers also allowed the 8051 to quickly perform a context switch which is essential for time sensitive real-time applications.[2]

Main aim of this project is to provide sms based tracking of different locations in the home while you are not at home. This project can also be used to monitor the different signals conditions of the machines in factory or industry. A GSM module will be installed in the home which will transmit the status of different doors continuously after short intervals or when the status of any signal is changed. Location will be sent as a sms through gsm network. These messages will be received by another GSM module situated at some remote location. The purpose of this project is to monitor and control electrical devices (Analog and Digital) remotely using GSM modem/phone. The GSM modem provides the communication mechanism between the user and the microcontroller system by means of SMS messages. Irrigation systems are as old as man itself since agriculture is the foremost occupation of civilized humanity. To irrigate large areas of plants is an onerous job. In order to overcome

Mukesh Patel School of Technology Management & Engineering

this problem many irrigation scheduling techniques have been developed which are mainly based on monitoring the soil, crop and weather conditions. Irrigation scheduling engrosses when to irrigate and how much water to be applied .Currently most of the irrigation scheduling systems and their corresponding automated hardware are fixed rate. Variable rate irrigation is very essential not only for the improvement of irrigation system but also to reduce the irrigation cost and to increase crop yield. The heart of automatic irrigation system (fixed rate or variable rate) is its control unit: as it controls irrigation time and water flow. Intelligent control based irrigation is necessitated to maximize the efficiency and production. Existing technologies varies from water balance or check book method to sophisticated sensor-based systems. Most of the irrigation systems use ON/OFF controllers. These controllers can not give optimal results for varying time delays and varying system parameters.[3] This project (interfacing mobile phone with microcontroller 8051 for machines control through SMS) has many important other application and can be used to control Switch ON or OFF any machines at far off places using a gsm modem by sending sms through the communication between the mobile and the embedded devices (microcontroller 8051).This remote control of appliances is possible through Embedded Systems. The use of Embedded System in Communication has given rise to many interesting applications that ensures comfort and safety to human life. The microcontroller is interfaced with GSM Modem in mobile phone via MAX232 level convertor. The microcontroller project is designed to allow easy use of a mobile phone to control appliances or machines at any far location may be in industry or at home. Using a mobile phone the development of the control system will be carried out using SMS. This will communicate with another mobile phone, which in turn controls the devices attached to microcontroller modules. moving message display using 8051 microcontroller When the action has been carried out then a response is sent to the user. The use of mobile phones to remotely control an appliance control system. The microcontroller would then control the device based on the information given to it. The devices are connected to the 8051 microcontroller using relays and optocouplers. These relay are controlled through software to switch ON or OFF the device as required. For every message received to microcontroller through mobile phone in form of SMS, the controller will check for the valid and pre-define format. If the message is correct the controller will perform the operation. microcontroller interfacing with lcd and gsm to display the msg sent to interfaced gsm [4]

Indian agriculture is dependent on the monsoons which is not a reliable soucre of water.Therefore there is a need for an irrigation system in the country which can provide water to the farms according to their soil types.This paper represents the prototype design of microcontroller based automatic irrigation sytem which will allow irrigation to take place in zones where watering is required.

Mukesh Patel School of Technology Management & Engineering

The system works on sms feature of the mobile phone. No hard work need to be done by the farmer.He has to send a sms to the irrigation system to switched on as well as off the irrigation system. The irrigation system switching status will be received to the farmer in his mobile as a sms.The return sms will be automatically sent by the irrigation system.This project works on two mode. It depends on the farmer that what he choose to control the irrigation system. Mode1: In Mode 1, farmer can send the fix time interval in the sms to switch on or off the irrigation system

Mode2: In Mode 2, farmer can directly send the command to switch on or off the irrigation system whenever he needs There is a water level indicatior in the system that gives a signal to the microcontroller that the water is supplied to irrigate the land or not.On the basis of this water status signal the microcontroller devices automatically switches on the irrigation system. The project runs with the help of battery power, So this continuously monitor the power failure. If a power failure occures then after getting power again, the irrigation system switches on again. In the block diagram you are seeing a DC motor that is our irrigation system. A GSM modem is used at the field end microcontroller system to send or receive the messages from the farmers mobile phone. Mobile phone is a self gsm modem so there is not need to any additional gsm modem to send or receive the messages from home.The water level indicator circuit send the status of water that the required water is supplied to land or not. A real time clock is also used in the system, by the help of which, the microcontroller knows that when it has to switch on or off the irrigation system using regular interval sent by the farmer in the sms. Fig3.1 A block diagram of is shown below

Mukesh Patel School of Technology Management & Engineering

In above figure, the GSM modem is serially connected to the Microcontroller unit. 8051 Microcontroller is the central controller unit of the system. Real Time Clock (RTC) is seprately connected to the micrcontroller to tell it only the time interval. A water level indicator is also an important part of the system that is responsible to switch on or off the irrigation system. A motor driver is an electronic circuit that receives signal from the microcontroller to drive the DC Motor. DC Motor uses its seprate DC Power supply.This is switched on of off by the help of Relay device used in Motor Driver Circuit.[5] The hardware board contains microcontroller AT89c51 at the heart of the system. The microcontroller is interfaced with GSM Modem of mobile phone via MAX232 level convertor. It is used to convert RS232 voltage levels to TTL voltage levels. display the message in notice board with the help of mobile 8051 project gsm architecture based motor on and off circuit diagram

The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 8K bytes of Flash programmable and erasable read only memory (PEROM). The device is compatible with the industry-standard 80C51 and 80C52 instruction set and pin out. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer which provides a highly-flexible and cost-effective solution to many embedded control applications.A GSM modem is a wireless modem that works with a GSM wireless network. A wireless modem behaves like a dial-up modem. The main difference between them is that a dial-up modem sends and receives data through a fixed telephone line while a wireless modem sends and receives data through radio waves. Like a GSM mobile phone, a GSM modem requires a SIM card from a wireless carrier in order to operate.controlling machines using gsm mobile sms services Generally, computers use AT commands to control modems. Reading of message from the SIM card inserted into the modem is done by sending the appropriate AT command to the modem.

Mukesh Patel School of Technology Management & Engineering

The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA- 232 inputs to 5-V TTL/CMOS levels. Each driver converts TTL/CMOS input levels into EIA-232 levels.

GSM Modem, which works at RS-232 voltage levels, logic 1 varies from -3 to -15 volts and logic 0 from +3 to +15 volts. The microcontroller which works on TTL logic levels, logic 1 is +5 volts and logic 0 is 0 volts. Therefore to interface the two we use a MAX 232 driver IC.tutorial tracker gps gsm [6]

The heart of the automatic irrigation system is the 80C51microcontroller. The Intel 80C51incorporates therein a 1288 read/write data memory, which has 4K bytes of EPROM and is expandable to 64K bytes via RAM module .The micrcontroller also includes four 8-bit ports(32 I/O lines), two 16-bit timer/counters, a high performance, full-duplex serial channel and onchip oscillator and clock circuits. Eight of the I/O lines comprising Port 0 function as an address bus 20 and a data bus. Address information at Port 0 may be applied, via an address latch, to the address bus. A moisture sensor is associated with each of the plurality of zones. Each such sensor is periodically interrogated by a pulse signal provided by the micrcontroller via a driver or buffer circuit. This interrogation signal causes the moisture sensorstooutput an analog voltage which is proportional to the amount of moisture in the soil in which the sensors are embedded.

Mukesh Patel School of Technology Management & Engineering

fig4.1 Circuit diagram of microcontroller based irrigation system.

The analog signal is fed to an analog/digital converter which operates to create a digital representation of the measured analog quantity on the data bus leading to the microcontroller.An analog-to-digital converter suitable for use in the system is ADC 0809[4]. It comprises a monolithic CMOS device with an 8-bit A/D converter, an 8-channel multiplexer and microcontroller compatible control logic. Using successive approximation as the conversion technique, this 8-bit A/D converter is readily interfaced to its associated microcontroller by the latched and decoded multiplexer address inputs and latched TTL tristate output[7]

Fig4.2.prototype system

Mukesh Patel School of Technology Management & Engineering


The following section describes the AT-Command set. The commands can be tried out by connecting a GSM modem to one of the PCs COM ports. Type in the test-command, adding CR + LF (Carriage return + Line feed = \r\n) before executing. Table gives an overview of the implemented AT-Commands in this application. The use of the commands is described in the later sections. AT-Command set overview The AT Command AT ATE0 AT+CNMI AT+CPMS AT+CMGF AT+CMGR AT+CMGS AT+CMGD Description of Commands Check if serial interface and GSM modem is working. Turn echo off, less traffic on serial line. Display of new incoming SMS. Selection of SMS memory. SMS string format, how they are compressed. Read new message from a given memory location. Send message to a given recipient. Delete message.

GSM Modem is used to receive message from the authorized user. This GSM modem requires a SIM card from a wireless carrier in order to operate. This SIM number is contact number of the receiving section. First, the microcontroller have to send AT A response "OK" should be returned from the mobile phone or GSM modem. Now the microcontroller will send "AT+CPIN?". The AT command "AT+CPIN?" is used to query whether the mobile phone or GSM modem is waiting for a PIN (personal identification number, i.e. password). If the response is "+CPIN: READY", it means the SIM card is ready for use. After this, various AT commands depending on the used modems instruction set are send to modem and responses are received. This process is very useful in testing GSM modems. , the AT89S52 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. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next interrupt. In this project MODEM is communication with the

Mukesh Patel School of Technology Management & Engineering


microcontroller through serial port, the microcontroller will send the commands to the modem through RS 232.and the data is read through serial port therefore to make compatible computer serial port with microcontroller serial port we are using the RS 232 converter.A GSM network is composed of several functional entities, whose functions and interfaces are specified. Figure 1 shows the layout of a generic GSM network. The GSM network can be divided into three broad parts. The Mobile Station is carried by the subscriber. The Base Station Subsystem controls the radio link with the Mobile Station. The Network Subsystem, the main part of which is the Mobile services Switching Center (MSC), performs the switching of calls between the mobile users, and between mobile and fixed network users. The MSC also handles the mobility management operations. Not shown is the Operations and Maintenance Center, which oversees the proper operation and setup of the network. The Mobile Station and the Base Station Subsystem communicate across the Um interface, also known as the air interface or radio link. 8051 provides a transmit channel and a receive channel of serial communication. The transmit data pin (TXD) is specified at P3.1, and the receive data pin (RXD) is at P3.0. All modes are controlled through SCON, the Serial control register. The timers are controlled using TMOD, the Timer mode register, and TCON, the Timer control register. free circuit electronic gsm controller system ,controlling machines using gsm mobile sms services gsm interfacing with microcontroller 8051[8]

What are the benefits of automatic irrigation?
Reduced labour: As the irrigator is not required to constantly monitor the progress of an irrigation, the irrigator is available to perform other tasks uninterrupted. Improved lifestyle: The irrigator is not required to constantly check the progress of water down the bays being irrigated. The irrigator is able to be away from the property, relax with the family and sleep through the night. More timely irrigation: Irrigators with automation are more inclined to irrigate when the plants need water, not when it suits the irrigator. Assists in the management of higher flow rates: Many irrigators are looking to increase the irrigation flow rates they receive through installing bigger channels and bay outlets. Such flow rates generally require an increase in labour as the time taken to irrigate a bay is reduced thus requiring more frequent change over. Automation allows for these higher flows to be managed without an increase in the amount of labour.

Mukesh Patel School of Technology Management & Engineering


More accurate cut-off: Automation of the irrigation system allows cut-off of water at the appropriate point in the bay. This is usually more accurate than manual checking because mistakes can occur if the operator is too late or too early in making a change of water flow. Reduced runoff of water and nutrients: Automation can help keep fertiliser on farm by effectively reducing run off from the property. Retaining fertiliser on farm has both economic and environmental benefits. Reduced costs for vehicles used for irrigation: As the irrigator is not required to constantly check progress of an irrigation, motor bikes, four wheelers and other vehicles are used less. This reduces the running costs of these vehicles and they require less frequent replacement.[9]

What are the disadvantages of automatic irrigation?
Cost: There are costs in purchasing, installing and maintaining automatic equipment. Reliability: Can the irrigator trust an automatic system to work correctly every time? Sometimes failures will occur. Often these failures are because of human error in setting and maintaining the systems. A re-use system is good insurance to collect any excess runoff when failures occur. Increased channel maintenance: There is a need to increase maintenance of channels and equipment to ensure the system works correctly. Channels should be fenced to protect the automatic units from stock damage[10]

8. Future scope:
Solar Panels continuously charge the 12V Lead Acid Battery through a charger. Charger also helps in stopping reverse currents.Around 300mA of current from the solar panel was found sufficient enough to charge the battery. Battery took around 6 hours to charge In future we can interchange power supply with solar power supply.Project deals with irrigation of farmlands based on soil wetness thus making it more fertile. Since completely automatic, constant monitoring is not required. Solar energy is used to generate pollution-free
Mukesh Patel School of Technology Management & Engineering


power thus making it completely eco-friendly. By effective utilization of Atmel based microcontrollers and Solar panels, our objective can be attained.65% of Indias Population depend on Farming for their livelihood.Since Solar Energy is used, Independency on power supply & manual labor.[11]

9. Reference:
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.

Mukesh Patel School of Technology Management & Engineering