You are on page 1of 4

construction

GSM-Based Borewell
Water-Level Monitor
farmers to walk all the way to their
fields at night just to switch the pump
motor off. Besides, he may never get
f the water level in a borewell
to know the problem.
drops below the threshold level
This problem can be solved by
for pumping, its pump motor may
using this GSM-based system that
get air-locked or even burn out due
will automatically give the user a
to dry running. It is inconvenient for
call on his mobile
phone when the
water level in the
borewell drops
below or rises to
the threshold level for pumping.
The user can also
remotely switch
on or switch off
Fig. 1: Block diagram of gsm-based borewell water-level monitoring system
the pump motor
Gurunath Reddy

mar
sunil ki u
eo
& San th

by sending an SMS from his mobile


phone. The system is simple, reliable,
portable and affordable.

Circuit description
Fig. 1 shows the block diagram of
the GSM-based borewell water-level
monitoring system. Fig. 2 shows the
complete circuit. It comprises the
power supply section, water-level sensor circuit, microcontroller, MAX232
driver, relay driver and GSM modem.
The GSM board has a valid SIM card
with sufficient recharge amount to
make outgoing calls.
The circuit is powered by regulated
5V DC. The 220V, 50Hz AC mains is
stepped down by transformer X1 to

Fig. 2: Circuit of gsm-based borewell water-level monitoring system


www.efymag.com

Electronics For You | May 2012

103

construction

Fig. 3: GSM modem

deliver a secondary output of 12V, 250


mA. The transformer output is rectified by bridge rectifier br1, filtered by
capacitor C1 and regulated by IC 7805
(IC3). Capacitor C2 bypasses ripples
from the regulated supply. LED1 acts
as the power-on indicator. Resistor R1
limits the current through LED1.
The AT89C51 microcontroller is
connected to the water-level sensor
circuit, relay driver and MAX232. The
microcontroller is programmed to take
necessary actions. The mobile number
used in the GSM modem is included in
the code before burning the code into
the microcontroller.
The water-level sensor circuit
comprises transistor T1 (BC548) as
sensor driver and water sensors A and
B dipped into the borewell along with
the pipe. Sensor A is dipped to the
threshold point for pumping and sensor B is dipped below the pipe to the
bottom of the borewell.
When water in the borewell fills to
the threshold level, it is sensed by sensor A and you get a call on your mobile
phone. Now you can turn the motor
on by sending the SMS motor11 on
from your mobile phone to the SIM
number in the GSM modem. You can
also turn the motor off by sending the
SMS motor11 off.
Sensor A is connected to the base
of transistor T1 (BC548). When there
is a high voltage at the base, T1 con104

May 2012 | Electronics For You

ducts and a low voltage is available


at its collector. This low signal is fed
to pin 12 (port pin p3.2) of the MCU.
Similarly, for a low voltage input at

the base, T1 stops conducting and a


high voltage signal is available at its
collector. So pin 12 of the MCU gets
a high signal input. The high or low
voltage signal at pin 12 is monitored
and processed by the program in the
MCU, and decision to turn the motor
off taken when the water level dips
below sensor A.
Pin 3 (port pin p1.2) of the MCU
is the output pin. It is connected to
relay-driver transistor T2 (BC548) and
LED2. T2 drives relay RL1, which, in
turn, activates the motor. LED2 glows
to indicate the motor-on status.
When water level in the borewell
dips below sensor A, the conducting path between sensors A and B
breaks. Hence a signal is received
by the microcontroller. The microcontroller turns the running motor
off and makes a call to the users
cell phone through a GSM modem

Table I

Motor, Mobile and LED Status for Different Water Levels


Borewell

Water level

Motor

Mobile LED2

Full
Above point A On
Call from modem On

Empty

Below point A

Off

Call from modem

Off

Remarks
SMS operation to turn on/off
the motor
SMS operation not allowed

Table II

Key Features of SIM300 Series


Features

Implementation

Power supply

Single supply voltage of 3.4V-4.5V

Power saving

Typical power consumption in SLEEP mode: 2.5 mA

Frequency bands

SIM300 tri-band (EGSM 900, DCS 1800, PCS 1900). The band can be
set by AT COMMAND, and default band is EGSM 900 and DCS 1800

Compliant to GSM Phase 2/2+

SMS

MT, MO, CB, text and PDU mode

SMS storage: SIM card

Supports transmission of SMS alternatively over CSD or GPRS. User can


choose the preferred mode

SIM interface

Supported SIM card: 1.8V, 3V

External antenna

Connected via a 50-ohm antenna connector or antenna pad

Two serial interfaces

Serial port 1: Seven lines on the serial port interface

Serial port 1 can be used for CSD FAX, GPRS and sending AT command
of controlling module

Serial port 1 can use multiplexing function, but you cannot use serial
port 2 at the same time

Autobauding supports baud rate of 1200 to 115,200 bps

Serial port 2: Two lines on serial port interface, /TXD and /RXD

Serial port 2 used only for transmitting AT command

www.efymag.com

construction
Table III

List of Commands
Command Description
AT

Check whether the serial interface


and GSM modem are working

ATE0

Turn echo off when there is less


traffic on serial line

AT+CNMI

Display the new incoming SMS

AT+CPMS Select SMS memory


AT+CMGF SMS string formathow they are
compressed
AT+CMGR Read the new message from a
given memory location
AT+CMGS Send message to a given recipient
AT+CMGD Delete message

Parts List
Semiconductors:
IC1
IC2
IC3
BR1
T1, T2
LED1, LED2
D1

Fig. 4: An actual-size, single-side PCB for the GSM-based borewell water-level monitoring system

- AT89C51 microcontroller
- MAX232 driver
- 7805, 5V regulator
- 1A bridge rectifier
- BC548 npn transistor
- 5mm light-emitting diode
- 1N4007 rectifier diode

Resistors (all -watt, 5 per cent carbon):


R1
- 1-kilo-ohm
R2, R6
- 470-ohm
R3, R4
- 10-kilo-ohm
R5
- 100-kilo-ohm
Capacitors:
C1
C2, C4-C7
C3
C8, C9

- 1000F, 25V electrolytic


- 0.1F ceramic
- 10F, 16V electrolytic
- 22pF ceramic

Miscellaneous:
X1
- 220V AC primary to 12V,
250mA secondary
transformer
RL1
- 12V, 1C/O relay
S1
- Tactile switch
- 11.0592MHz crystal
XTAL
GSM modem - SIM300 V7.03 modem

- Two water-level steel sensor
rods

to indicate that the water level is too


low to pump the water and the motor
has been switched off. In this way,
the motor is protected from airlocks
and burnouts due to dry running.
The status of motor, water level and
LED2 are shown in Table I. The GSM
modem used in this project is SIM300
V7.03 (refer Fig. 3). Its key features are
listed in Table II.

GSM modem SIM300 V7.03


The GSM module is a specialised type
of modem which accepts a SIM card
www.efymag.com

Fig. 5: Component layout for the PCB

and operates on a subscribers mobile


number over a network, just like a cellular phone. Basically, it is a cellphone
without display. Modem SIM300 is a
triband GSM/GPRS engine that works
on EGSM 900MHz, DCS 1800MHz and
PCS 1900MHz frequencies.
GSM modem is RS232-logic-level
compatible, i.e., it takes -3V to -15V as
logic high and +3V to +15V as logic
low. MAX 232 is used to convert TTL
into RS232 logic level and vice versa.
Hence MAX232 is a voltage-level
converter used between the microcontroller and the GSM board.
The signal at pin 11 of the microcontroller is sent to the GSM modem
through pin 11 of MAX232. This signal
is received at Pin 2 (RX) of the GSM

modem. The GSM modem transmits


the signal from Pin 3 (TX) to the microcontroller through MAX232, which
is received at pin 10 of IC1.

Software program
The software program is written in
C language and compiled using Keil
software. The AT commands listed in
Table III are used in the code to receive
the mobile signal. The hex code of the
program is burnt into the MCU using
Flash Magic software.

Construction and testing


An actual-size, single-side PCB layout
of the GSM-based borewell water-level
monitoring system is shown in Fig. 4
and its component layout in Fig. 5.
Electronics For You | May 2012

105

construction

Fig. 6: Authors prototype

For testing the circuit, proceed


as follows:
1. After assembling all the components on the PCB, connect TX and
RX pins of the GSM modem to pins 13
and 14 of MAX232, respectively. Insert
a valid SIM in the card holder of the
GSM modem.
2. Connect ground pin of the GSM
modem to the ground rail of the circuit.
3. Use two single-strand (hook-up)
wires as sensor A and sensor B. (In the

106

May 2012 | Electronics For You

actual application, use of steel rods as


sensors is recommended.) Hang the
sensors into a bucket or mug such that
sensor A is above sensor B.
4. Pour water into the bucket until
the water level reaches sensor A.
5. Now switch on the circuit.
You should get a call on your mobile
phone. This indicates that you can turn
the motor on.
6. Send SMS motor11 on from
any mobile phone to the SIM in the
modem to turn the motor on. You

can also turn the motor off by sending motor11 off message from any
mobile phone.
7. Now remove water from the
bucket until the water level in the
bucket dips below sensor A. The motor should automatically switch off
and you should receive a call from
the modem simultaneously alerting
you that the borewell (bucket in this
case) is empty and the motor has been
switched off.
After testing the above steps, you
can install the system in the borewell
by inserting sensors A and B into the
pipe with sensor B placed at the bottom of the borewell as shown in the
circuit. Your borewell monitoring system is now ready for use. The authors
prototype is shown in Fig. 6.
EFY note. The source code of this
article is available on www.efymag.
com.
The author is a student of BE in electronics and
telecommunications at SIT, Tumkur

www.efymag.com

You might also like