Project Report

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 95

PROJECT REPORT ON

IMPLEMENTATION OF STREET LIGHT


CONTROL WITH MANHOLE
MONITORING

CONTENTS

1. ABSTRACT

2. INTRODUCTION

3. FUNCTIONAL DESCRIPTION OF THE PROJECT

4. BLOCK AND CIRCUIT DIAGRAM

5. BRIEF DESCRIPTION ABOUT GSM TECHNOLOGY

6. DESCRIPTION ABOUT ATMEGA 2560 MICROCONTROLLER

7. POWER SOURCE DESCRIPTION

8. DESCRIPTION ABOUT LDR

9. BRIEF DESCRIPTION ABOUT 555 TIMER CHIP

10. HARDWARE DETAILS

11. SOFTWARE DETAILS

12. CONCLUSIONS AND REFERENCES


IMPLEMENTATION OF STREET LIGHT
CONTROL WITH MANHOLE
MONITORING
ABSTRACT
This project represents the implementation and design function of
Street light automation, Underground Drainage and Manhole Monitoring
System using GSM technology. The vital considerations of this design are
low cost, low maintenance, fast deployment, and high number of sensors,
long life-time and high quality of service. The proposed model provides a
system for automatic control of the street lights, street lights working
condition, water level inside a manhole and also checks whether a
manhole lid is open. In real time, this system can remotely monitor current
states of the street lights, manholes and water level in them and will alert
the officials early by sending a SMS through the GSM.

The objective of the project is to provide automatic control and fault


detection on street lamps along with manhole monitoring. The proposed
system targets the automatic operation of the street light on economical
affordable for the streets and immediate information response about the
street lamp fault. Moreover, errors which occur due to manual operation
can also be eliminated. In addition, a password based phase line control
mechanism is designed in the project to repair the faults in the line by
disconnecting the supply to the line by entering the password.

One of the advantages of the project is that clogs in drainage pipes


can be detected as soon as it is formed rather than detecting it after the
sewage water starts overflowing into the roads causing serious
inconvenience to the public and revenue loss to the government. The
system, in addition, does not require any human labor to detect the clog.
Thus the clogs can be detected easily without any human interference.
Therefore, a variety of sensors and clog detecting modules are placed in
various positions along the drainage network and the data is collected
using GSM. Thus the project will provide an efficient means of monitoring
the drainage or sewage outlet system providing a way for the smarter
sewer system and detecting the clog formation at its very existence, and
helps maintain a clean environment, avoiding deadly contagious diseases
helping the entire human race lead a healthy peaceful life.

The water level in the drainage network is monitored through the


electrodes that are placed at certain low and high level. Whenever the
water level touches the high level electrode which will be placed at almost
20% of the drainage pipe line, automatically a message in the form of SMS
will be sent to the concern mobile number that is defined in the controller.
By this the drainage pipeline can be cleaned before it overflows. One more
feature developed in the project is checking the manhole lid condition and
when it is opened automatically the information will be again sent through
the GSM to the concern authorities.

The control circuit is designed with the arduino mega controller and
LDR (Light Dependant Resistor) for sensing the light condition (day/night,
street light ON/OFF, manhole open/close). The LDR is a kind of optical
sensor, which acts as a variable resistor according to the light intensity.
This device is used to monitor the light continuously and is wired with timer
IC. The timer IC provides a logic signal to the controller depending on the
light. By this the controller controls the lights automatically through the
relay depending up on the availability of natural light, identifies whether
street light is working or not and also manhole open or close.

CHAPTER – 2

INTRODUCTION

The project work described here is quite useful for the state
electricity and municipal departments, generally the line men either he
belongs electricity department or municipality, it is the duty of him to
energize the street lights in the evening, preferably after Sun set, and he is
supposed to be switched off these lights in early in the morning, when the
Sun is raised again. But unfortunately due to many reasons the line men
may forget to switch off these lights in the morning. Often at many places
these lights remains in on condition during the day time also, this is
because of the negligence of line men. In this regard lot of energy is
wasted, resulting power cuts. There are many reasons for power cuts, in
that list this reason also can be added and it can be underlined.

This project work also deals with password based phase line
controller is a simple project that helps in controlling the electrical line with
help of a password. Now a days electrical accidents to the line men are
increasing while repairing the electrical lines. This is due to the lack of
proper communication between the electrical sub-station and the
maintenance staff. This project gives a solution to this problem to ensure
the safety of the line man. In this proposed project work, the control
(ON/OFF) of the electrical line lies with the line man. The concept is
designed such that maintenance staff or the line man has to enter the
password to switch ON/OFF the electrical line. If there is any fault in the
electrical line or any repair is to be done to the line, then the supply to the
electrical line is cut off by entering the password and can comfortably
repair the line. After repairing the line, by entering the password again,
supply to the electrical line will be restored. Separate passwords can be
assigned to different electrical phase lines. The system is designed with a
single line with two different passwords. At the output a relay is connected
and this relay contact is used to make or break supply to the electrical line.
Presently the demo module is constructed with two street lights all of them
can be controlled through the password.

Most of the cities adopted the underground drainage system and it is


the duty of managing station (Municipal Corporation) to maintain
cleanliness of the cities. If the drainage maintenance is not proper the pure
water gets contaminate with drainage water and infectious diseases may
get spread. The drainage gets blocked during rainy season, it will create
problem for routine life such as traffic may get jammed, the environment
becomes dirty, and totally it upsets the public. Suppose if there should be a
facility which would be there in Municipal Corporation (managing station)
that the officials come to know immediately after blocking of drainage in
which area and the exact place where it is blocked and it also informs if the
manhole lid is open. So our main focus is monitoring manholes using
sensors. If drainage gets blocked and water overflows, and if manhole lid
is opens, it is sensed by the sensors, then that sensor sends information
via GSM module which is located in that area to the corresponding
managing station.
The Sewage Outlet System of a manhole monitoring has been a
difficult and tedious task. A clog in the sewage pipe will lead to overflow
and stagnation of sewer water along the streets. The environmental issues
and diseases that arise to sewage stagnation are disastrous. The irregular
maintenance of sewage Outlet System has caused huge catastrophes in
the state claiming many human lives. The project proposes a novel
mechanism to monitor sewage outlet pipes. The clog in the pipe will be
sent to the concern officials by means of GSM.

Regular maintenance of drainage system will ensure that it functions


properly at all times. It should be ensured that the outlet ditches of the
subsurface systems are free from blockages caused by sediment buildup
and the debris does not seal the inlet covers. Drainage problems can
cause significant damage to home, property, and the City of Shoreline
storm drain system. Today’s drainage system is not computerized. So
whenever there is blockage it is difficult to figure out the exact location of
the blockage. Also, we don’t get early alerts of the blockage. Hence
detection and repairing of the blockage become so time-consuming. It
becomes very inconvenient to handle the situation when pipes are blocked
completely due to such failure of drainage line people face a lot of
problems. It is important to identify and correct drainage problems when
they occur. If a tile of the drainage system breaks, it has to be replaced,
otherwise, it can contaminate bodies of fresh water. A research conducted
by the University of Illinois has shown drainage systems can also
contribute to contamination problems, especially when a clog occurs and is
left unnoticed. The sewage outlet system monitoring has been a difficult
and tedious task. A clog in the sewage pipe will lead to overflow and
stagnation of sewer water along the streets. The environmental issues and
diseases that arise to sewage stagnation are disastrous. The irregular
maintenance of sewage outlet system has caused huge catastrophes in
the state claiming many human lives.

If drainage gets blocked then it will create many problems such as


traffic jam, the environment becomes dirty, and if manhole lid is not closed
properly there is a chance of occurrence of accidents and also people may
get fall into the drainage. To overcome all these problems it is necessary to
adopt a remote monitoring system in the managing station. Manhole
maintenance by human control is very difficult because environment is
poor and it is difficult to go inside the manholes for inspecting the states of
the manholes. Immediately it is not possible to confirm if the person
intrudes the manhole or an accident happens in the manhole. A proper
drainage system is essential for the people who live in urban areas as this
system reduces flood effect by carrying water away (a facility to dispose of
liquid waste). Improper maintenance of existing drainage system leaves
people to suffer.

Irregular monitoring of drainage system leads to contamination of


water and leads to water-borne diseases. Stagnation of water on roads will
cause roads to damage. More importantly, flooding of roads lead to traffic
jams and causes loss of valuable human hours, loss of revenue and
employment. Groundwater contamination is also possible if once it is
contaminated it’s very difficult to clean up. A good and efficient drainage
system is badly required for the developing countries like India. In the
creation of many smart cities, the architecture of drainage system plays an
important role. To maintain a good and proper drainage system it takes
more human resource. Even though investing crores of rupees in drainage
department when it rains the scenario will be the same. To overcome all
these problems, we need a remote monitoring system to monitor the state
of drainage inside drainage channels. To solve all these problems a remote
alarm system is required for transmitting current states of information
detected by sensors set inside the manhole to a managing station.

In this project work, micro-controller chip is playing a major role, the


controller used in this project is arduino ATMEGA2560. Nowadays with the
advancement of technology in the field of micro-controllers, all the activities
in our day-to-day living have become part of information technology and
we find micro-controllers in each and every application. Thus, the trend is
directing towards controller based project works. However in this project
work, the basic signal processing of information gathering from the
drainage network pipeline and manhole lid open condition, is done with
analog circuit, for this purpose copper electrodes for water level in the
pipeline and light sensor LDR for manhole lid open condition are used for
sensing.

The entire system is designed with microcontroller unit; the natural


light sensing circuit designed using LDR is connected like an input to the
controller. Depending on the information given to the micro controller about
the status of the natural light, the controller recognizes whether the
manhole lid is opened or closed. Here ARDUINO ATMEGA2560 controller
is used to perform the above mentioned operation and sends message
through GSM. The detailed description is provided in the following
chapters.
Micro-controller works according to the program written in it. The
program is written in such a way, so that the Microcontroller can read and it
can store the information received from the parameter outputs. According
to the received information, the Microcontroller generates digitalized
information and this digitalized information is fed to control the outdoor light
through the relay contact.

Micro-controllers are "embedded" inside some other device so that


they can control the features or actions of the product. Another name for a
micro-controller, therefore, is "embedded controller". Micro-controllers are
dedicated to one task and run one specific program. The program is stored
in ROM (read-only memory) and generally does not change. Micro-
controllers are often low-power devices. A battery-operated Microcontroller
might consume 50 milli watts. A micro-controller has a dedicated input
device and often (but not always) has a small LED or LCD display for
output. A micro-controller also takes input from the device it is controlling
and controls the device by sending signals to different components in the
device.
CHAPTER – 3

FUNCTIONAL DESCRIPTION OF THE PROJECT


The detailed circuit description of the project work is explained along
with circuit diagram. For better understanding total circuit diagram is
divided into various sections and each section circuit description with its
circuit diagram is provided in this chapter. The details are as follows.

One part of project describes about monitoring the line that is not
working and inform the same to the concern authorized person through
GSM technology. In line which is not working i.e., faulty is sensed and the
information will be transmitted through GSM module automatically.

This project is focused on the necessity of the automated street light


system and the peculiar way of implementation with embedded system
tools. The microcontroller is used as the brain to control the process
involved. Relay is used as an automatic switch in this system that acts as a
circuit breaker. Light Dependent Resistor (LDR) is a type of sensor which
actually does the work of sensing the light (line) working or not.

The system with LDR sensors and GSM are used to intimate the
status of light (line) ON/OFF status i.e., fault condition to the concern
authorities through GSM. Through the keyboard, by entering the password,
supply to that particular line can be disconnected by the line man for
repairing. After repairing is done, the same line can be restored by the user
himself.

LIGHT SENSING CIRCUIT


As described in the abstract LDR is used for detecting the light.
Generally for measuring the light intensity LDR’s are preferred because of
their wide variation in the resistance. Measurement of light intensity is an
important management for many applications. Generally the light intensity
is measured in Lux or Lumens, in some places it is measured in Foot
candles also, Lux is the popularly known unit, and therefore the light
measuring instrument can be called as “LUX METER”.

There are many techniques existed in the world for measuring the
light intensity, these differs depending up on the availability of light
sensors, the main function of the light sensor is to sense the brightness of
light. Hear LDR is used as a light sensing device, the purpose of sensing
the light is to control the street lights, not for measuring the light. The LDR
used in this project work is a very sensitive device, which converts the light
energy into variable resistance, and the resistance of this LDR will vary
according to the light intensity. As the light intensity increases, resistance
decreases (inversely proportional). The amount of light falling on the
surface of the light sensing device is to be converted in to the
proportionate DC level. A 10k resistor is connected in series with the LDR
to form a potential dividing network. The output is taken from the midpoint,
which is called as reference voltage and this voltage varies according to
the light intensity. One end of the resistor is connected to the constant +5V
DC source, the other end is connected to the LDR, from this point
reference voltage is taken out. The other end of the LDR is connected to
the ground. The output of the potential dividing network is fed to the 555
timer IC, which is configured in “MONOSTABLE” mode of operation.
A Light Dependent Resistor (LDR) or a photo resistor is a device
whose resistivity is a function of the incident electromagnetic radiation.
Hence, they are light sensitive devices. They are also called as photo
conductors, photo conductive cells or simply photocells. They are made up
of semiconductor materials having high resistance. A light dependent
resistor works on the principle of photo conductivity. Photo conductivity is
an optical phenomenon in which the materials conductivity (Hence
resistivity) reduces when light is absorbed by the material.

TRIGGER CIRCUIT
In this circuit IC555 timer is used as mono stable mode of
configuration. The resistance of the LDR will vary from minimum to
maximum according to the natural light fallen on it. The dark resistance of
the LDR will be more than 100K and the light resistance will be less than
1K. Hence, whenever light falls on the LDR, the resistance will come
down and this makes a trigger signal to the IC 555 timer. Thereby the
output of the timer becomes high which is fed to the controller. During the
night the resistance of the LDR will be very high by which the output of the
timer remains in zero state. Depending on these high and low signals, the
controller is programmed to send the information automatically through
GSM to the line man mobile.

The LDR will have two resistances, i.e., dark resistance and light
resistance. The dark resistance is the resistance, when no light falls on the
LDR. This resistance will be more than 100K. The light resistance is the
resistance, when light falls on the LDR i.e., if the LDR is exposed to the
bright light or Sun light then the resistance of the LDR will become less
than 1K. The resistance of the LDR will vary according to the light
intensity (Inversely proportional).

This LDR is designed in association with IC 555 timer configured as


‘Mono-Stable’ mode of configuration. The IC 555 timer is a versatile IC,
consists of two built in comparators, threshold at 1/3Vcc and 2/3Vcc. The
1/3 Vcc comparator is monitored at Pin No.2. The 2/3 Vcc comparator is
monitored at pin.6. These pins are shorted and connected to the ground
through the LDR. Thus if pin no.2 voltage is less than 1/3Vcc, output of the
IC becomes high, similarly, if the voltage is more than 2/3Vcc, output of the
IC becomes zero i.e., whenever the natural light falls on the LDR, the
resistance of the LDR will become less than 1K and makes the voltage at
Pin no. 2 or 6 less than 1/3 Vcc, which in turn triggers the IC whose output
is connected to the controller that energizes the relay. This relay contact is
used to provide supply to the outdoor lights. Once the LDR resistance
becomes less than 1K, this in turn changes the state of internal
comparator of 555 timer IC and the output of the IC to become high. This
high output is fed to the controller that identifies line is working. If the
output is low, then the controller understands the line is not working and
will transmit a message through the GSM modem automatically.
The device either it is configured in Astable or mono-stable, the
basic function of triggering at two different levels are common, only the
difference is that in mono-stable mode of operation the circuit triggers due
to the external pulses, where as in the Astable mode of operation, the
capacitor charges and discharges continuously, there by the potential
applied to the trigger pin will be changed automatically. In the A 555 set in
the Astable mode is basically an oscillator. It changes states by itself
according to the support components connected externally. On (high) then
off (low) then on then off... in the schematic diagram given below, an LED
is connected at the output, which turns on turn off at every interval of one
second. According to that the timing components are selected, based on
the formulas given below frequency can be adjusted to the required level.
Detailed description about the timer chip is provided in the further
chapters.

The circuit description begins from LDR, it is the main function of the
overall system to monitor the output of LDR continuously. As described in
the previous chapters, the resistance of the LDR will vary automatically
according to the natural light intensity. With the combination of LDR and
10K resistor connected in series with each other, a potential dividing
network is designed to generate reference voltage according to the light
intensity. In this regard 10K resistor and LDR network is connected across
the +5V DC source, and the reference voltage developed at mid point is
fed to timer IC. When the LDR is exposed to the bright light, the resistance
of it reduces by less than 1K, as per the potential dividing network formula
(R2/R1+R2 X Vcc), when this LDR is treated as R2, then reference voltage
= 1K/10K+1K X 5V = 0.45V. Means when the LDR is exposed to the light,
the reference voltage will be less then 0.5V, this is less than 1/3 Vcc and
based on this potential, the timer IC triggers and output status will be
changed automatically. Similarly dark resistance of the LDR will be more
then 100K, in this condition V. Ref = 100K/10K+100K X 5V = 4.5V, so after
the Sun set or during the Sun set, the voltage generated by the net work
will be more than 4V, and this is more than 2/3 Vcc.

WATER LEVEL SENSORS


A lot of varieties of water level sensors are available for us in the
market with different technologies. Here in this module, the water level
sensors for drainage pipeline used are the common equipment generally
used is the copper electrode. For identifying the level of the water in the
pipe, it is equipped with two copper electrodes. One is the low level
indicator that is placed at 20% capability of the pipeline and the second
electrode is the high level indicator that is placed at the 90% capability of
the pipeline. In addition to these two copper electrodes one more electrode
is used, called as the common electrode that is given the Vcc (supply),
connected till below of the low-level indicator electrode.

The outputs of these two level sensing electrodes are connected to


the microcontroller through the switching circuits designed with transistors.
The outputs of the electrodes is connected to the base of the low power
transistor 547, whose emitter is grounded and the collector is connected to
the micro controller, which is also given supply of 5v. As water is a good
conductor the copper electrodes outputs will be in high state until the tank
is full in the pipeline, by which all the transistors will be in ON state and the
controller will be receiving a logic high signal because the supply will be
grounded through the transistor when it is in conduction. And whenever the
water level decreases the electrodes will be in air and the output will be
low by which the transistor will be OFF state.

So the supply from the collector does not go to the controller and
thus the controller receives logic low signal, so that the controller knows
the water level is decreased. So when the controller gets a high signal
from the 90% level electrode, automatically transmits a message through
the GSM to the concern authorities. And thus the concern person will get
the information about the water level of the drainage pipeline and can take
necessary action to clear it early before it overflows.

ARDUINO CONTROLLER
Arduino is a tool for making computers that can sense and control
more of the physical world than your desktop computer. It's an open-
source physical computing platform based on a simple microcontroller
board, and a development environment for writing software for the board.
Arduino can be used to develop interactive objects, taking inputs from a
variety of switches or sensors, and controlling a variety of lights, motors,
and other physical outputs. Arduino projects can be stand-alone, or they
can communicate with software running on your computer (e.g. Flash,
Processing, MaxMSP.) The boards can be assembled by hand or
purchased preassembled; the open-source IDE can be downloaded for
free. The Arduino MEGA is a microcontroller board based on the
ATmega2560.

The Arduino Mega 2560 is a microcontroller board based on


the ATmega2560. It has 54 digital input/output pins (of which 15 can be
used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports),
a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP
header, and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power
it with a AC-to-DC adapter or battery to get started. The Mega 2560 board
is compatible with most shields designed for the Uno and the former
boards Duemilanove or Diecimila.

When cheaper boards are available, why go with Arduino Mega?


The main reason behind this is the additional features that are inbuilt with
this board. First feature is the large I/O system design with inbuilt 16
analog transducers and 54 digital transducers that supports with USART
and other communication modes. Secondly, it has inbuilt RTC and other
features like analog comparator, advanced timer, interrupt for controller
wakeup mechanism to save more power and fast speed with 16 Mhz
crystal clock to get 16 MIBS. It has more than 5 pins for Vcc and Gnd to
connect other devices to Arduino Mega.

Other features include JTAG support for programming, debugging


and troubleshooting. With large FLASH memory and SRAM, this board can
handle large system program with ease. It is also compatible with the
different type of boards like high-level signal (5V) or low-level signal (3.3V)
with I/O ref pin.

Brownout and watchdog help to make the system more reliable and
robust. It supports ICSP as well as USB microcontroller programming with
PC.
The Arduino Mega 2560 is a replacement of the old Arduino Mega,
and so in general reference, it will be called without the ‘2560’ extension. It
is usually used for very complex projects. Detailed description is provided
in the further chapters.

Liquid Crystal Display (LCD)

LCD Displays are dominating LED displays, because these displays


can display alphabets, numbers and some kind of special symbols, where
as LED’s (seven segment display) can display only numbers. These LCD
displays are very useful for displaying user information and
communication. LCD displays are available in various formats. Most
common are 2 x 16, is that two lines with 16 alphanumeric characters.
Other formats are 3x16, 2x40, 3x40 etc;

In recent years LCD is finding widespread use replacing LED’s,


because of the ability to display numbers, characters, and graphics.
Another advantage is, because of its compactness and ease of
programming for characters and graphics, more information in the form of
text message or graphics can be displayed. Generally, the LCD modules
have an 8-bit interface, besides the 8-bit data bus; the interface has a few
other control lines. The 8-bit data bus is connected to port ’0’ and the
control lines are connected to port ‘2’. The default data transfer between
the LCD module and an external device is 8-bits, however it is possible to
communicate with the LCD module using only four of the 8-data lines. The
R/W line is connected to ground and hence the processor cannot read any
status information from the LCD module, but can only write data to the
LCD.
The LCD panel used in this project work is having 14 pins. The function of
each pin description with table is provided in the next page:

Pin No. Name Description


Pin no. 1 D7 Data bus line 7 (MSB)
Pin no. 2 D6 Data bus line 6
Pin no. 3 D5 Data bus line 5
Pin no. 4 D4 Data bus line 4
Pin no. 5 D3 Data bus line 3
Pin no. 6 D2 Data bus line 2
Pin no. 7 D1 Data bus line 1
Pin no. 8 D0 Data bus line 0 (LSB)
Enable signal for row 0 and 1
Pin no. 9 EN1
(1stcontroller)
0 = Write to LCD module
Pin no. 10 R/W
1 = Read from LCD module
0 = Instruction input
Pin no. 11 RS
1 = Data input
Pin no. 12 VEE Contrast adjust
Pin no. 13 VSS Power supply (GND)
Pin no. 14 VCC Power supply (+5V)
Enable signal for row 2 and 3
Pin no. 15 EN2
(2ndcontroller)
Pin no. 16 NC Not Connected
Vcc, Vss, and VEE: While Vcc and Vss provide +5V and ground,
respectively; VEE is used for controlling LCD contrast.

RS - register select: There are two very important registers inside the
LCD. The RS pin is used for their selection as follows. If RS = 0, the
instruction command code register is selected, allowing the user to send a
command such as clear display, cursor at home, etc. If RS = 1 the data
register is selected, allowing the user to send data to be displayed on the
LCD.
R/W - read/write: R/W input allows the user to write information to the
LCD or read information from it. R/W = 1 when reading; R/W =0 when
writing.
E - Enable: The enable pin is used by the LCD to latch information
presented to its data pins. When data is supplied to data pins, a high to low
pulse must be applied to this pin in order for the LCD to latch in the data
present at the data pins. This pulse must be a minimum of 450 ns wide.
D0 – D7: The 8 bit data pins, D0 – D7, are used to send information to the
LCD or read the contents of the LCD’s internal registers. To display letters
and numbers, we send ASCII codes for the letters A – Z, a – z, and
numbers 0 – 9 to these pins while making RS = 1. There are also
instructions command codes that can be sent to the LCD to clear the
display or force the cursor to the home position or blink the cursor. Detailed
description about LCD interfacing and regarding description of the LCD
panels is provided in the further chapters.

GSM MODEM

Semen’s GSM Smart Modem is a multi-functional, ready to use,


rugged unit that can be embedded or plugged into any application. The
Smart Modem can be controlled and customized to various levels by using
the standard AT commands. The modem is fully type-approved; it can speed
up the operational time with full range of Voice, Data, Fax and Short

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.

Computers use AT commands to control modems. Both GSM modems


and dial-up modems support a common set of standard AT commands. GSM
modem can be used just like a dial-up modem. In addition to the standard AT
commands, GSM modems support an extended set of AT commands. These
extended AT commands are defined in the GSM standards.

AT-Command set: The following section describes the AT-Command


set. The commands can be tried out by connecting a GSM modem to one of
the PC’s 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

Command Description
AT Check if serial interface and GSM modem is working.
ATE0 Turn echo off, less traffic on serial line.
AT+CNMI Display of new incoming SMS.
AT+CPMS Selection of SMS memory.
AT+CMGF SMS string format, how they are compressed.
AT+CMGR Read new message from a given memory location.
AT+CMGS Send message to a given recipient.
AT+CMGD Delete message.

With the extended AT commands, various things can be done:

 Reading, writing and deleting SMS messages.


 Sending SMS messages.
 Monitoring the signal strength.
 Monitoring the charging status and charge level of the battery.
 Reading, writing and searching phone book entries.
The number of SMS messages that can be processed by a GSM modem
per minute is very low -- only about six to ten SMS messages per minute.

Accessing GSM Modem using Microsoft Hyper Terminal


Microsoft HyperTerminal is a small program that comes with Microsoft
Windows. We use it to send AT commands to the GSM modem. It can be
found at Start -> Programs -> Accessories -> Communications ->
HyperTerminal.

Before programming our SMS application, it is required to check if the


GSM modem and SIM card are working properly first. The MS
HyperTerminal is a handy tool when it comes to testing the GSM device. It is
a good idea to test the GSM devices beforehand. When a problem occurs,
sometimes it is difficult to tell what causes the problem. The cause can be
the program, the GSM device or the SIM card. If GSM device and SIM card
with MS HyperTerminal and they operate properly, then it is very likely that
the program or other hardware causes the problem.

RS-232
RS-232 was created for one purpose, to interface between Data
Terminal Equipment (DTE) and Data Communications Equipment (DCE)
employing serial binary data interchange. So as stated the DTE is the
workstation and the DCE is the modem or other communications device.
Often the workstation will be the computer, but here microcontroller is used
to transmit the temperature data to the concern mobile. This converter chip
is needed to convert TTL logic from a Microcontroller (TxD and RxD pins) to
standard serial interfacing for PC (RS232).

Initially the data acquired from the sensor, it is transmitted through


GSM in the form of SMS. The authorized mobile number is programmed &
along with the message, data is transferred through RS232.

In communications, RS-232 is a standard for serial binary data signals


connecting between a DTE (Data terminal equipment) and a DCE (Data
Circuit-terminating Equipment). It is commonly used in computer serial ports.
In RS-232, data is sent as a time-series of bits. Both synchronous and
asynchronous transmissions are supported by the standard. In addition to
the data circuits, the standard defines a number of control circuits used to
manage the connection between the DTE and DCE. Each data or control
circuit only operates in one direction that is, signaling from a DTE to the
attached DCE or the reverse. Since transmit data and receive data are
separate circuits, the interface can operate in a full duplex manner,
supporting concurrent data flow in both directions. The standard does not
define character framing within the data stream, or character encoding.
MAX-232

The module consists of the sensors (IR), micro controller (89c51),


GSM modem, and etc. The interfacing of the controller with the GSM
modem cannot be done directly because they belong to two different logic
families i.e., the micro controller is of CMOS logic family and the GSM
modem is of TTL logic family. So the signals of one device are not be read
by the other device directly. There should be a mediator to communicate
between these two devices. In order to do such function an IC MAX 232 is
used in the module, which is connected with the serial port RS 232
connector. The MAX 232 IC consists of two transmitter and two receiver
pins. So it functions in bi-directional i.e., the CMOS signals from the
controller are converted into TTL signals and are fed to the GSM modem
and the TTL signals from the GSM modem are converted into CMOS signals
that will be fed to the micro controller.

RELAY

A relay is an electrical switch that opens and closes under the


control of another electrical circuit. In the original form, the switch is
operated by an electromagnet to open or close one or many sets of
contacts. A relay is able to control an output circuit of higher power than
the input circuit, it can be considered to be, in a broad sense, a form of an
electrical amplifier. So a relay can be defined as an automatic
electromagnetic/electronic switch, which can be used to make or break the
circuit. The detailed description of the relay is provided in the further
chapters. In this project two relays are used to control the cooling fan and
the DC motor individually.
A relay is an electrical switch that opens and closes under control of
another electrical circuit. In the original form, the switch is operated by an
electromagnet to open or close one or many sets of contacts. These contacts can be
either Normally Open (NO), Normally Closed (NC), or change-over contacts.

Normally-open contacts connect the circuit when the relay is activated; the
circuit is disconnected when the relay is inactive. It is also called Form A contact
or "make" contact. Form A contact is ideal for applications that require to switch a
high-current power source from a remote device.

Normally-closed contacts disconnect the circuit when the relay is activated;


the circuit is connected when the relay is inactive. It is also called Form B contact
or "break" contact. Form B contact is ideal for applications that require the circuit
to remain closed until the relay is activated.

Change-over contacts control two circuits: one normally-open contact and


one normally-closed contact with a common terminal. It is also called Form C
contact.

OPERATION

The relays used in this project work are electromagnetic relays. The
electromagnetic relay is basically a switch (or a combination of switches)
operated by the magnetic force generated by a current flowing through a
coil. Essentially, it consists of four parts an electromagnet comprising a
coil and a magnetic circuit, a movable armature, a set of contacts, and a
frame to mount all these components. However, very wide ranges of relays
have been developed to meet the requirements of the industry. This relay
is nothing but a switch, which operates electromagnetically. It opens or
closes a circuit when current through the coil is started or stopped. When
the coil is energized armature is attracted by the electromagnet and the
contacts are closed. That is how the power is applied to the signals
(indicators). The construction of the typical relay contains a code
surrounded by a coil of copper wire. The core is mounted on a metal
frame. The movable part of the relay is called armature. When a voltage is
applied to the coil terminals, the current flowing through the coil produces a
magnetic field in the core. In other words, the core acts as an
electromagnet and attracts the metal armature. When the armature is
attracted to the core, the magnetic path is from the core through armature,
through the frame, and back to the core. On removing the voltage the
spring attached to the armature returns the armature to its original position.
In this position, there is a small air-gap in the magnetic path. Hence, more
power is needed to pull in the armature than that needed to keep it held in
the attracted position.

A relay is an electrically operated switch. Current flowing through the


coil of the relay creates a magnetic field which attracts a lever and
changes the switch contacts. The coil current can be on or off so relays
have two switch positions and they are double throw (changeover)
switches.

Relays allow one circuit to switch a second circuit which can be


completely separate from the first. For example a low voltage battery
circuit can use a relay to switch a 230V AC mains circuit. There is no
electrical connection inside the relay between the two circuits; the link is
magnetic and mechanical.

The animated picture shows a working relay with its coil and switch
contacts. You can see a lever on the left being attracted by magnetism
when the coil is switched on. This lever moves the switch contacts.

 COM = Common, always


connect to this, it is the moving part of the switch.
 NC = Normally Closed,
COM is connected to this when the relay coil is off.
 NO = Normally Open,
COM is connected to this when the relay coil is on.
 Connect to COM and NO if
you want the switched circuit to be on when the relay coil is on.
 Connect to COM and NC if you want the switched circuit to be on when
the relay coil is off.

The relay's switch connections are usually labeled COM, NC and NO:
Relay Driving Circuits: Relays circuits are designed which energizes
according to the signals obtained from Micro controller. Relays are used to
control the lights and fans individually by the controller. The operation of
the relay driving circuit is as follows.

Whenever the microcontroller port output is high to energize the


relay, the transistor 547 becomes on with the help of +12V power supply
through the coil of the relay and there by the relay becomes on. This
contact of the relay is used to energize the corresponding lamp. To provide
a visual indication an LED is also provided along with the coil of the relay
so that whenever relay energizes its LED also gets energized.

Regulated power supply is used to drive Microcontroller, light


sensing circuits. In order to obtain a continuous un-interrupted regulated
power supply to the sensing circuits, control circuits and lamp post a 12V
DC is derived from the mains supply unit which provides a regulated power
supply. A 5V regulated power supply is designed from 12V DC through
voltage regulator such that it provides a steady Vcc for all the power
supplies.

A relay is an electromagnetic switch, which can be used to make or


break the circuit. Here the relay is connected at the output of the
microcontroller to control the switch board. The relay used here is having
only one set of changing over contact, when this relay is energized
normally open contact gets closed and supply is provided to the electrical
device. When the same relay is de-energized, normally open contact
remains in open condition and supply is disconnected to the device. The
contact rating of the relay is 1.5 amps; less than 1.5 amps restrict so
current flowing through the contact. If any heavy load device is used,
higher rating relay must be selected accordingly.

A relay is an electrical switch that opens and closes under the


control of another electrical circuit. In the original form, the switch is
operated by an electromagnet to open or close one or many sets of
contacts. These contacts can be either Normally Open (NO), Normally Closed
(NC), or change-over contacts. A relay is able to control an output circuit of
higher power than the input circuit, it can be considered to be, in a broad
sense, a form of an electrical amplifier. So a relay can be defined as an
automatic electromagnetic/electronic switch, which can be used to make or
break the circuit.

The relay used in this project work is electromagnetic relay. The


electromagnetic relay is basically a switch (or a combination of switches)
operated by the magnetic force generated by a current flowing through a
coil. Essentially, it consists of four parts an electromagnet comprising a
coil and a magnetic circuit, a movable armature, a set of contacts, and a
frame to mount all these components. However, very wide ranges of relays
have been developed to meet the requirements of the industry. This relay
is nothing but a switch, which operates electromagnetically. It opens or
closes a circuit when current through the coil is started or stopped. When
the coil is energized armature is attracted by the electromagnet and the
contacts are closed. That is how the power is applied to the signals
(indicators). The construction of the typical relay contains a code
surrounded by a coil of copper wire. The core is mounted on a metal
frame. The movable part of the relay is called armature. When a voltage is
applied to the coil terminals, the current flowing through the coil produces a
magnetic field in the core. In other words, the core acts as an
electromagnet and attracts the metal armature. When the armature is
attracted to the core, the magnetic path is from the core through armature,
through the frame, and back to the core. On removing the voltage the
spring attached to the armature returns the armature to its original position.
In this position, there is a small air-gap in the magnetic path. Hence, more
power is needed to pull in the armature than that needed to keep it held in
the attracted position.

The electromagnetic relay, one of mankind’s first electrical device,


was used practically in telegraphy as early as 1850. The modern relay,
properly applied, is one of the most simple, effective and dependable
component available. In the majority of instances, it can achieve better
reliability at lesser cost than an equivalent solid-state complex type of
relay. The term ‘relay’ was used for the first time to describe an invention
made by Samuel Morse in 1836. The device invented by Morse was a
“Telegraph Amplifying Electromagnetic Device” which enabled a small
current flowing in a coil to switch on a large current in another circuit and
thus helped in “relay” of signals.

A relay is a device that opens or closes an auxiliary circuit under


some predetermined condition in the main circuit. The object of a relay is
generally to act as a sort of electric magnifier, that is to say, it enables a
comparatively weak current to bring into operation a much stronger
current. It also provides complete electrical isolation between the
controlling circuit and the controlled circuit. The relay is operated like a
switch to control the supply to the line (light). The controller controls the
operation of the relay i.e., ON and OFF by which the supply will be given or
disconnected to the line to control the lights.

The relay contacts and the terminals are mounted on an insulated


board. When no current flows through the relay coil, the contact arm, or
pole as it is called, mounted on the armature, touches the “top” (N/C)
contact. When the coil is energized by flow of current, the armature along
with the contact arm assembly moves downwards; so that the contact arm
touches the “bottom” (N/O) contact. When an electric current is flowing
through a relay coil, it is said to be energized, and when the current flow
stops, the relay is said to be de-energized. They have a set of parallel
contacts, which are all pulled in when the electromagnet pulls in the
armature. On being energized, whether a relay makes contact(s) or breaks
them depends on the design of contact arrangements. Though the
contacts are open or close simultaneously, the sequence of operation
cannot be guaranteed in this of construction. To have a definite switching
sequence, stacked contacts are used.

Schematic of relay with contact


CHAPTER – 5

DETAILED DESCRIPTION ABOUT GSM TECHNOLOGY

GSM (Global System for Mobile Communications) is a digital cellular


communications system. It was developed in order to create a common
European mobile telephone standard but it has been rapidly accepted
worldwide. GSM is designed to provide a comprehensive range of services
and features to the users not available on analogue cellular networks and in
many cases very much in advance of the old public switched telephone
network (PSTN). In addition to digital transmission, GSM incorporates many
advanced services and features like worldwide roaming in other GSM
networks

During the early 1980s, analog cellular telephone systems were


experiencing rapid growth in Europe, particularly in Scandinavia and the
United Kingdom, but also in France and Germany. Each country developed
its own system, which was incompatible with everyone else’s in equipment
and operation. This was an undesirable situation, because not only was the
mobile equipment limited to operation with national boundaries, which in a
unified Europe were increasingly unimportant, but there was also a very
limited market for each type of equipment, so economies of scale and the
subsequent savings could not be realized.

The Europeans realized this early on, and in 1982 the conference of
European Posts and Telegraphs (CEPT) formed a study group called the
Group Special Mobile (GSM) to study and develop a pan-European public
land mobile system. The proposed system has to meet certain criteria:

 Good subjective speech quality


 Low terminal and service cost
 Support for international roaming
 Ability to support handheld terminals
 Support for range of new services and facilities
 Spectral efficiency

And interaction with integrated service digital network (ISDN) which


offers the capability to extend the single-subscriber – line system with the
various to a multi-service system. The first commercial GSM system, called
D2, was implemented in Germany in 1982.

This valuable channel of communication can equip us with a powerful


tool for controlling desired device or process parameter from distant location,
through electromagnetic waves. With a little effort logic can be setup to even
receive a feedback on the status of the device or the process being
controlled.

SERVICES PROVIDED BY GSM

From the beginning, the planners of GSM wanted ISDN Compatibility


in terms of the services offered and the control signaling used. However,
radio transmission limitations, in terms of bandwidth and cost, do not allow
the standard ISDN B-channel bit rate of 64kbps to be practically achieved.

Using the ITU-T definitions, telecommunication services can be


divided into bearer services, tele-services, and supplementary services. The
most basic tele-service supported by GSM is telephony. As with all other
communications, speed is digitally encoded and transmitted through the
GSM network as a stream. There is also an emergency service, where the
nearest emergency – service provider is notified by dialing three digits.

A variety of data services is offered. GSM users can send and receive
data, at rates up to 9600bps, to users on POTS (Plain Old Telephone
Service), ISDN, Packet Switched Public Data Networks, and Circuit
Switched public Data Networks using a variety of access methods and
protocols, such as X-25 or X.32. Since GSM is a digital network, a modem
is not required between the user and GSM network, although an audio
modem is required inside the GSM network to inter work with POTS.

Other data services include Group 3 facsimile, as described in ITU-T


recommendation T.30, which is supported by use of an appropriate fax
adaptor. A unique feature of GSM, not found in older analog systems, is the
Short Message Services (SMS). SMS is a bi-directional service for short
alphanumeric (up to 160 bytes) messages. Messages are transported in a
store-and-forward fashion. For point-to-point SMS, a message can be sent
to another subscriber to the service, and an acknowledgement of receipt is
provided to the sender. SMS can also be used in a cell-broadcast mode, for
sending messages such as traffic updates or news updates. Messages can
also be stored in the SIM card for later retrieval.

Supplementary services are provided on top of tele-services or bearer


services. In the current (Phase I) specifications, they include several forms
of call forward (such as call forwarding when the mobile subscriber is
unreachable by the network), and call barring of outgoing or incoming calls,
for example when roaming in another country. Many additional
supplementary services will be provided in the Phase 2 specifications, such
as caller identification, call waiting, multi-party conversations.
ARCHITECTURE OF THE GSM NETWORK

A GSM network is composed of several functional entities, whose


functions and interfaces are specified. The GSM network can be divided into
three broad parts. The subscriber carries the mobile station. 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 following figure shows the layout of a generic GSM net work of
the Mobile Station and the Base Station Subsystem.

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 Un-interface, also known
as the air interface or radio link. The Base Station Subsystem
communicates with the Mobile services Switching Center across the A
interface.
M Subscriber Identity Module BSC Base Station Controller
MSC Mobile services Switching Center ME Mobile Equipment
HLR Home Location Register EIR Equipment Identity
Register
BTS Base Transceiver Station VLR Visitor Location Register
AuC Authentication Center

General Architecture of a GSM Network

Mobile Station
The mobile station (MS) consists of the mobile equipment (the
terminal) and a smart card called the Subscriber Identity Module (SIM). The
SIM provides personal mobility, so that the user can have access to
subscribed services irrespective of a specific terminal. By inserting the SIM
card into another GSM terminal, the user is able to receive calls at that
terminal, make calls from that terminal, and receive other subscribed
services.
The International Mobile Equipment Identity (IMEI) uniquely identifies
the mobile equipment. The SIM card contains the International Mobile
Subscriber Identity (IMSI) used to identify the subscriber to the system, a
secret key for authentication, and other information. The IMEI and the IMSI
are independent, thereby allowing personal mobility. The SIM card may be
protected against unauthorized use by a password or personal identity
number.

Base Station Subsystem


The Base Station Subsystem is composed of two parts, the Base
Transceiver Station (BTS) and the Base Station Controller (BSC). These
communicate across the standardized Abis interface, allowing (as in the rest
of the system) operation between components made by different suppliers.

The Base Transceiver Station houses the radio transceivers that


define a cell and handles the radio-link protocols with the Mobile Station. In
a large urban area, there will potentially be a large number of BTSs
deployed, thus the requirements for a BTS are ruggedness, reliability,
portability, and minimum cost.

The Base Station Controller manages the radio resources for one or
more BTSs. It handles radio-channel setup, frequency hopping and
handovers, as described below. The BSC is the connection between the
mobile station and the Mobile service Switching Center (MSC).

Network Subsystem

The central component of the Network Subsystem is the Mobile


services Switching Center (MSC). It acts like a normal switching node of the
PSTN or ISDN, and additionally provides all the functionality needed to
handle a mobile subscriber, such as registration, authentication, location
updating, handovers, and call routing to a roaming subscriber. These
services are provided in conjunction with several functional entities, which
together form the Network Subsystem. The MSC provides the connection to
the fixed networks (such as the PSTN or ISDN). Signaling between
functional entities in the Network Subsystem uses Signaling System Number
7 (SS7), used for trunk signaling in ISDN and widely used in current public
networks.

The Home Location Register (HLR) and Visitor Location Register


(VLR), together with the MSC, provide the call-routing and roaming
capabilities of GSM. The HLR contains all the administrative information of
each subscriber registered in the corresponding GSM network, along with
the current location of the mobile. The location of the mobile is typically in
the form of the signaling address of the VLR associated with the mobile
station. The actual routing procedure will be described later. There is
logically one HLR per GSM network, although it may be implemented as a
distributed database.

The Visitor Location Register (VLR) contains selected administrative


information from the HLR, necessary for call control and provision of the
subscribed services, for each mobile currently located in the geographical
area controlled by the VLR. Although each functional entity can be
implemented as an independent unit, all manufacturers of switching
equipment to date implement the VLR together with the MSC, so that the
geographical area controlled by the MSC corresponds to that controlled by
the VLR, thus simplifying the signaling required. Note that the MSC contains
no information about particular mobile stations – this information is stored in
the location registers.

The other two registers are used for authentication and security
purposes. The equipment Identity Register (EIR) is a database that contains
a list of all valid mobile equipment on the network, where its International
Mobile Equipment Identity (IMEI) identifies each mobile station, An IMEL is
marked as invalid if it has been reported stolen or is not type approved. The
Authentication Center (AuC) is a protected database that stores a copy of
the secret key stored in each subscriber’s SIM card, which is used for
authentication and encryption over the radio channel.

GSM Modem: GSM Modem Product, from Sparr Electronics limited (SEL),
provides full functional capability to Serial devices to send SMS and Data
over GSM Network. The product is available as Board Level or enclosed in
Metal Box. The Board Level product can be integrated in to Various Serial
devices in providing those SMS and Data capability and the unit housed in a
Metal Enclosure can be kept outside to provide serial port connection. The
GSM Modem supports popular “AT” command set so that users can develop
applications quickly. The product has SIM cardholder to which activated
SIM card is inserted for normal used. The power to this unit can be given
from UPS to provide uninterrupted operation. This product provides great
feasibility for Devices in remote location to stay connected which otherwise
would not have been possible where telephone lines do not exist.
Application Areas
 Mobile Transport vehicles.
 LAN based SMS servers
 Alarm notification of critical events including Servers
 Network Monitoring and SMS reporting
 Data Transfer applications from remote locations
 Monitor and control of Serial services through GSM Network
 Integration to custom software for Warehouse, Stock, Production,
Dispatch notification through SMS

Serial Pin out (D-9 Connector)

Serial Port D-type 9 pin connector, which is male on the back of the
GSM modem, thus you will require a female connector on your device.
Below is a table of pin connections for the 9 Pin D-type

9- Pin female connector

Pin No. Abbreviation Full Name


Pin 3 TD Transmit Data
Pin 2 RD Receive Data
Pin 7 RTS Request To Send
Pin 8 CTS Clear To Send
Pin 6 DSR Data Set Ready
Pin 5 SG Signal Ground
Pin 1 CD Carrier Detect
Pin 4 DTR Data Terminal Ready
Pin 5 RI Ring Indication
Pin Functions

Abbreviation Full Name Function


TD Transmit Data Serial Data Output (TXD)
RD Receive Data Serial Data Input (RXD)
CTS Clear to Send This line indicates that the Modem is
ready to exchange data.
DCD Data Carrier Detect When the modem detects a “Carrier”
from the modem at the other end of
the phone line, this line becomes
active.
DSR Data Set Ready This tells the UART that the modem
is ready to establish a link.
DTR Data Terminal Ready This is the opposite to DSR. This tells
the modem that the UART is ready to
link.
RTS Request To Send This line informs the Modem that the
UART is ready to exchange data.
RI Ring Indicator Goes active when modem detects a
ringing signal from the PSTN.
NULL Modems

A Null Modem is used to connect two DTES together. This is


commonly used as a cheap way to network games or to transfer files
between computers using Z modem protocol, X modem Protocol etc. This
can also be used with many Microprocessor Development Systems.

D9 D9
3 TD RD 2
2 RD TD 3
5 SG SG 5
4 DTR DTR 4
6 DSR DSR 6
1 CD CD 1
7 RTS RTS 7
8 CTS CTS 8

Null Modem Wiring Diagram

Above is my preferred method of wiring a Null Modem. It only


requires 3 wires (TD, RD & SG) to be wired straight through thus is more
cost effective to use with long cable runs. The theory of operation is
reasonably easy. The aim is to make to computer it is talking to a modem
rather than another computer. Any data transmitted from the first computer
must be received by the second thus TD is connected to RD. the second
computer must have the same set-up thus RD is connected to TD. Signal
Ground (SG) must also be connected so both grounds are common to each
computer.
The Data Terminal Ready is looped back to Data Set Ready and Carrier
Detect on both computers. When the Data Terminal Ready is asserted
active, then the Data Set Ready and Carrier Detect immediately become
active. At this point the computer thinks the Virtual Modem to which is
connected is ready and has detected the carrier of the other modem. All left
to worry about now is the Request to Send and Clear to Send. As both
computers communicate together at the same speed, flow control is not
needed thus these two lines are also linked together on each computer.
When the computer wishes to send data, it asserts the Request to Send
high and as it’s hooked together with the Clear to Send, it immediately gets
a reply that it is ok to send and does so.
SEND MESSAGE +CMGS
Description:
The <address> field is the address of the terminal to which the message is
sent. To send the message, simply type, <ctrl-z> character (ACII 26). The
text can contain all existing characters except <ctrl-z> and <ESC> (ASCII
27). This command can be aborted using the <ESC> character when
entering text. In PDU mode, only hexadecimal characters are used
(‘0’…’9’,’A’…’F’).
Syntax:
Command syntax in text mode:
AT+CMGS= <da> [,<toda> ] <CR> text is entered <ctrl-z / ESC >
Command syntax in PDU mode:
AT+CMGS= <length> <CR> PDU is entered <ctrl-z / ESC >

Command Possible response


AT+CMGS=”+33146290800” <CR> +CMGS;<mr>
Please call me soon fred. <ctrl.z> OK
Note: send a message in text mode. Note: successful transmission
AT+CMGS+<length><CR><pdu><ctrlz> +CMGS;<mr>
OK
Note: Send a message ij pdu mode Note: successful transmission

Example for CMGS Commands


The message reference, <mr>, which is returned to the application, is
allocated by the product. This number begins with 0 and is incremented by
one for each outgoing message (successful and failure cases); it is cyclic on
one byte (0 follows 255). Note: this number is not a storage number –
outgoing message is not stored
CHAPTER – 7

DESCRIPTION ABOUT RS 232

This article is intended to help the designer’s sort through the various
features available in RS-232 interface products. The main features
described are the regulated charge pump, Auto shutdown, RS-232
compatible versus compliant operation, ESD protection, and data rates
including Mega baud operation.

What is RS-232 Communication?


RS stands for “recommended standard”, and 232 is a number
assigned to this standard by the Electronics Industry Association (EIA). In
fact, the updated name is EIA 232D, but most people still call it RS-232.
The standard defines such things as the type of signal used, timing,
the number of bits in a character, which bit goes first, how to separate one
character from another, and codes to mark the beginning and the end of the
message. Because of these standards, serial communication such as RS-
232 can be used over ordinary telephone lines.
RS-232 Background

Despite the development of newer digital interface standards, the


humble RS-232 serial port remains the most widely used means for
transferring data. Robust and easy to use, the RS-232 port is an attractive
alternative to more digitally demanding and temperamental interfaces.
Two RS-232 devices still in use today, the 1488 and 1489, exemplify
the early origins of this standard. Bipolar power supplies power devices from
that era because the RS-232 standard requires each transmitter to provide a
+5V (minimum) signal for a low and a -5V (minimum) signal for a high.
These higher voltages ensure greater noise immunity after they travel
through lossy cables to RS-232 receivers. But they require a dual power
supply and many PC boards included a negative power supply solely to
power devices such as the 1488 and 1489.

The Single-Supply RS-232 Transceiver

In 1987, Maxim introduced the MAX232, the first single-supply RS-


232 device. The MAX232 (and many other devices powered by +5V
supplies) includes two charge pumps. One doubles +5V to approximately
+10V and the other inverts the +10V charge-pump output to -10V. Because
these charge pumps are unregulated, the positive and negative output
voltages of the transmitters they power often drop well below +10V and
-10V. How far they drop is a function both of the capacitance of the cable
driven by the transmitters and the data rate.

The MAX232 quickly became an industry standard. Many board


designers still use it, despite the fact that single-supply devices have
undergone extensive improvements over the years. Understanding the
features of new devices will help the design engineer choose the best parts
for the application.

RS-232 Transceivers Powered by Low-Voltage Single


Supplies

As power-supply voltages dropped from +5V to +3.3V and lower,


single-supply RS-232 transceivers kept pace. Those transceivers that are
powered from voltages ranging from 3.0V to 5.5V use two regulated charge
pumps instead of the unregulated types used in the parts powered by +5V
only. Rather than double the input voltage, one regulated charge pump
boosts the input voltage to about +5.4V; a regulated inverting charge pump
supplies an output of about -5.4V. A big power-savings advantage results, as
±5.4V driving the capacitive load presented by the cable consumes quite a
bit less power than, say, ±9V.

Questions about noise immunity often arise when design engineers


first discover these devices. Their noise immunity, however, is excellent, as
the regulated charge pumps work harder to maintain a ±5.4V output as
cables get longer and the capacitive load increases. In fact, a ±5.4V output
is maintained with longer cables and higher data rates when using these
devices than when using devices with unregulated outputs that are initially of
higher output voltage.

Maxim also offers a series of RS-232 transceivers that operate from


voltages as low as 2.35V. Moreover, one RS-232 transceiver, the MAX3218,
uses an inductor along with capacitors to allow operation with supplies as
low as +1.8V.

Saving Supply Current through Auto shutdown


Techniques

Many RS-232 transceivers provide a simple shutdown feature that's


activated by applying a logic level to the shutdown pin. Often this feature
saves enough current to allow the battery of a portable piece of equipment
to last for a sufficient amount of time. Another means for shutting down the
power of an RS-232 device is available, however; it places the RS-232
device into shutdown mode whenever it detects that the RS-232 interface
isn't in use. This feature, called Auto shutdown, is useful, because in many
applications RS-232 devices are used for only short periods of time.

The Auto shutdown feature monitors whether the RS-232 interface


isn't in use by detecting whether a cable is present. If a cable isn't connected
to an RS-232 transceiver, there's no reason to power the device. A
transceiver equipped with the Auto shutdown feature monitors the RS-232
signals at its receivers to determine whether a cable is connected. When a
cable isn't present, the signals at the RS-232 receiver inputs hover near 0V;
the transceiver shuts down when all its receiver inputs are at or near 0V. The
part automatically takes itself out of shutdown if any one of the receiver
inputs exceeds +2.7V or goes below -2.7V (i.e., whenever the cable is
reconnected). Also, this feature can be overridden with signals that force the
device on or off.

Auto shutdown Plus is similar to Auto shutdown in that it is designed


to save power by shutting down the RS-232 device whenever it's not in use.
The difference, however, is that Auto shutdown Plus shuts down the
transceiver not only when the cable is disconnected, but also when the cable
is connected and data edges haven't appeared for 30 seconds or more. That
way you can get the benefit of an automated shutdown regardless of
whether the cable is connected. Auto shutdown-Plus devices monitor both
the RS-232 receiver inputs and the digital transmitter inputs for signal
activity; shutdown ensues if no activity is present on any of these lines. As
with Auto shutdown, you can force on or off the device using pins that
override the Auto shutdown plus feature.

The Auto shutdown Plus logic incorporated in an RS-232 transceiver


such as the MAX3238 allows the transceiver to stay powered as long it
detects signal transactions at its transmitter or receiver inputs within 30
seconds. Otherwise the transceiver is automatically powered down because
no signal transactions are present. Logic levels applied to the FORCEON
and FORCEOFF-bar pins turn device power on and off independently of
whether signal activity is detected.

Compatible Versus Compliant

To be compliant with the RS-232 specification, transmitters are


required to provide a ±5V output. For RS-232 receivers to be compliant, their
thresholds must be ±3V maximum. Thus, these devices operate with a
healthy ±2V noise margin (and often more, because receiver thresholds are
usually lower than ±3V). It's possible to erode some of that margin and still
maintain accurate data transmissions. Margins get reduced when transmitter
output voltages span a narrower range. When transmitter outputs are a
minimum of ±3.7V, they are considered to be compatible, instead of
compliant, RS-232 outputs. For example, when you power an RS-232
device that doesn't contain charge pumps (and hence is cheaper and
smaller) with ±5V supplies, its output voltages cannot possibly reach ±5V. A
device operated under those conditions with transmitter outputs of ±3.7V at
minimum is said to be RS-232 compatible instead of compliant.

Enhanced ESD Protection

All RS-232 devices include ESD-protected structures on their pins to


protect against electrostatic discharges encountered during handling and
assembly. Some manufacturers offer devices both with standard and
enhanced protection. Because both the standard and the enhanced-
protection parts almost always come with the same pin out, adding devices
with enhanced ESD protection usually requires no modification to an existing
PC board.

Some applications require ±15kV ESD protection on both the RS-232


and the CMOS digital pins. For example, in order to reduce cost and size,
cell phones do not include the RS-232 transceiver in the phone itself.
Instead, they route CMOS-level signals out through the connector at the
bottom of the phone. If the cell-phone owner wants to connect to the RS-232
port of a laptop, he or she purchases a "data-lump" cable, which includes an
RS-232 transceiver. In this situation, both sides of the RS-232 transmitters
and receivers are brought out to connectors, exposing them to increased
ESD risk. In such cases, it may be desirable to have extended ESD
protection on both the RS-232 and CMOS sides of the transmitters and
receivers. The MAX3380E and MAX3381E are two examples of transceivers
that are suited to this task.

Data Rates

The latest RS-232 specification calls for data rates of 20kbps or


below. Despite this restriction, the data rates of most RS-232 transceivers
far surpass that speed. In fact, today's RS-232 transceivers reach speeds of
1 Mbps. See Figure 2. To reach that speed, those devices violate another
RS-232 specification, the maximum allowed transmitter-output slew rate of
30V/is.
CHAPTER – 6

BRIEF DESCRIPTION ABOUT ARDUINO


ATMEGA2560 CONTROLLER

It is a microcontroller board based on Atmega 2560 microcontroller.


Arduino Boards have revitalized the automation industry with their easy to
use platform where everyone with little or no technical background can get
started with learning some basic skills to program and run the board. In
terms of coding, all these boards are programmed in Arduino IDE software
and you don’t need to attach extra components or devices to put them in
the running condition. Everything is already built in the board that makes
this device readily available. Just plug and play with the board as per your
requirement.

All the boards mentioned above work perfectly for a number of


Arduino Projects when you require a simple task to be completed with less
number of I/O pins and memory. However, when the nature of project goes
complex, a board with less memory fails to complete the task. This is
where Arduino Mega 2560 comes handy. This board comes with 54 pins
and 16 analog pins with more memory to store the code. Sounds crazy,
isn’t it? Thanks to technology that keep your covered in every aspect and
provides support in any way when it comes to fulfilling your technical
needs.
 Arduino Mega 2560 is a Microcontroller board based on
Atmega2560. It comes with more memory space and I/O pins as
compared to other boards available in the market.
 There are 54 digital I/O pins and 16 analog pins incorporated on the
board that make this device unique and stand out from others.
 Out of 54 digital I/O, 15 are used for PWM (pulse width modulation).
 A crystal oscillator of 16MHz frequency is added on the board.
 This board comes with USB cable port that is used to connect and
transfer code from computer to the board.
 DC power jack is coupled with the board that is used to power the
board. Some version of Arduino board lacks this feature like Arduino
Pro Mini doesn’t come with DC power jack.
 ICSP header is a remarkable addition to Arduino Mega which is used
for programming the Arduino and uploading the code from the
computer.

 This board comes with two voltage regulator i.e. 5V and 3.3V which
provides the flexibility to regulate the voltage as per requirements as
compared to Arduino Pro Mini which comes with only one voltage
regulator.
 There is no much difference between Arduino Uno and Arduino
Mega except later comes with more memory space, bigger size and
more I/O pins.
 Arduino software called Arduino IDE is used to program the board
which is a common software used for all boards belonged to Arduino
family.
 Availability of Atmega16 on the board makes it different than Arduino
Pro Mini which uses USB to serial converter to program the board.
 There is a reset button and 4 hardware serial port called USART
which produces a maximum speed for setting up communication.
 Following figure shows the specifications of Arduino mega 2560
 Arduino Mega is specially designed for the projects requiring
complex circuitry and more memory space. Most of the electronic
projects can be done pretty well by other boards available in the
market which make Arduino Mega uncommon for regular projects.
However, there are some projects that are solely done by Arduino
Mega like making of 3D printers or controlling more than one motors,
because of its ability to store more instructions in the code memory
and a number of I/O digital and analog pins.
 There are three ways to power the board. You can either use a USB
cable to power the board and transfer code to the board or you can
power it up using Vin of the board or through Power jack or batter.
 Last two sources to power the board are required once you already
built and compile code into the board through USB cable.
 This board comes with resettable polyfuse that prevents the USB
port of your computer from overheating in the presence of high
current flowing through the board. Most of the computers come with
an ability to protect themselves from such devices, however, the
addition of fuse provides an extra layer of protection.
 It can be used either way i.e. for creating stand-alone projects or in
combination with other Arduino boards. Most complex projects can
be created using this board

Arduino Mega 2560 Pinout

Following figure shows the pinout of Arduino Mega 2560.


 Each pin comes with a specific function associated with it. All analog
pins can be used as digital I/O pins.
 Designing of a project using Arduino Mega gives you the flexibility of
working with more memory space and processing power that allows
you to work with a number of sensors at once. This board is
physically larger than other Arduino boards.

Pin Description

5V & 3.3V. This pin is used to provide output regulated voltage around 5V.
This regulated power supply powers up the controller and other
components on the board. It can be obtained from Vin of the board or USB
cable or another regulated 5V voltage supply. While another voltage
regulation is provided by 3.3V pin. Maximum power it can draw is 50mA.

GND. There are 5 ground pins available on the board which makes it
useful when more than one ground pins are required for the project.
Reset. This pin is used to reset the board. Setting this pin to LOW will
reset the board.

Vin. It is the input voltage supplied to the board which ranges from 7V to
20V. The voltage provided by the power jack can be accessed through this
pin. However, the output voltage through this pin to the board will be
automatically set up to 5V.

Serial Communication. RXD and TXD are the serial pins used to transmit
and receive serial data i.e. Rx represents the transmission of data while Tx
used to receive data. There are four combinations of these serial pins are
used where Serail 0 contains RX(0) and TX(1), Serial 1 contains TX(18)
and RX(19), Serial 2 contains TX(16) and RX(17), and Serial 3 contains
TX(14) and RX(15).

External Interrupts. Six pins are used for creating external interrupts i.e
interrupt 0(0), interrupt 1(3), interrupt 2(21), interrupt 3(20), interrupt 4(19),
interrupt 5(18). These pins produce interrupts by a number of ways i.e.
providing LOW value, rising or falling edge or changing value to the
interrupt pins.

LED. This board comes with built-in LED connected to digital pin 13. HIGH
value at this pin will turn the LED on and LOW value will turn it off. This
gives you the change of nursing your programming skills in real time.

AREF. AREF stands for Analog Reference Voltage which is a reference


voltage for analog inputs.

Analog Pins. There are 16 analog pins incorporated on the board labeled
as A0 to A15. It is important to note that all these analog pins can be used
as digital I/O pins. Each analog pin comes with 10-bit resolution. These
pins can measure from ground to 5V. However, the upper value can be
changed using AREF and analogReference() function.

I2C. Two pins 20 and 21 support I2C communication where 20 represents


SDA (Serial Data Line mainly used for holding the data) and 21 represents
SCL(Serial Clock Line mainly used for providing data synchronization
between the devices)

SPI Communication. SPI stands for Serial Peripheral Interface used for the
transmission of data between the controller and other peripherals
components. Four pins i.e. 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS) are
used for SPI communication.

Arduino Mega is comparatively larger than other boards available in the


market. It comes 4-inch length and 2.1-inch width. However, USB port and
power jack are slightly extended from the given dimensions.

Shield Compatibility
 Arduino Mega is compatible with most of the shields designed for
other Arduino boards.
 Before you intend to use a shield, make sure the operating
voltage of the shield is compatible with the board voltage. Most of
the shields operate at 3.3V or 5V which is compatible with this
board, however, shields with higher operating voltage can
damage the board.
 Also, the header distribution of the shield must resonate with the
pin distribution of the board, so you can simply attach the shield
with the board and make it in a running condition.
Programming
 Arduino Mega 2560 can be programmed using Arduino Software
called IDE which supports C programming.
 The code you make on the software is called sketch which is burned
in the software and then transferred to the board through USB cable.
 This board comes with a built-in bootloader which rules out the
usage of an external burner for burning the code into the board.
 The bootloader communicates using STK500 protocol.
 Once you compile and burn the program on the board, you can
unplug the USB cable which eventually removes the power from the
board. When you intend to incorporate the board into your project,
you can power it up using power jack or Vin of the board.
 Multitasking is another feature where Arduino mega comes handy.
However, Arduino IDE Software doesn’t support multitasking feature
but you can use other operating systems like FreeRTOS and RTX to
write C program for this purpose. This gives you the flexibility of
using your own custom build program using ISP connector.

Applications

Arduino Mega 2560 is an ideal choice for the projects requiring more
memory space to used with more number of number pins on the board.
Following are the main applications of the Arduino mega boards.

 Developing 3D printer
 Controlling and handling more than one motors
 Interfacing of number of sensors
 Sensing and detecting temperature
 Water level detection projects
 Home automation and security systems
 Embedded Systems
 IoT applications
 Parallel programming and Multitasking
CHAPTER – 7

POWER SOURCE DESCRIPTION

INTRODUCTION
The power supplies are designed to convert high voltage AC mains
electricity to a suitable low voltage supply for electronics circuits and other
devices. A RPS (Regulated Power Supply) is the Power Supply with
Rectification, Filtering and Regulation being done on the AC mains to get a
Regulated power supply for Microcontroller and for the other devices being
interfaced to it.
For example a 5V regulated power supply system as shown below:

Fig: Block Diagram of the Power Supply


A power supply unit can by broken down into a series of blocks,
each of which performs a particular function. A d.c power supply which
maintains the output voltage constant irrespective of a.c mains fluctuations
or load variations is known as “Regulated D.C Power Supply”.

TRANSFORMER

A transformer is an electrical device which is used to convert


electrical power from one Electrical circuit to another without change in
frequency. Transformers convert AC electricity from one voltage to another
with little loss of power. Transformers work only with AC and this is one of
the reasons why mains electricity is AC. Step-up transformers increase in
output voltage, step-down transformers decrease in output voltage. Most
power supplies use a step-down transformer to reduce the dangerously
high mains voltage to a safer low voltage. The input coil is called the
primary and the output coil is called the secondary. There is no electrical
connection between the two coils; instead they are linked by an alternating
magnetic field created in the soft-iron core of the transformer. The two lines
in the middle of the circuit symbol represent the core. Transformers waste
very little power so the power out is (almost) equal to the power in. Note
that as voltage is stepped down current is stepped up. The ratio of the
number of turns on each coil, called the turn’s ratio, determines the ratio of
the voltages. A step-down transformer has a large number of turns on its
primary (input) coil which is connected to the high voltage mains supply,
and a small number of turns on its secondary (output) coil to give a low
output voltage.
Fig: An Electrical Transformer

Turns ratio = Vp/ VS = Np/NS


Power Out= Power In
VS x IS=VP x IP
Vp = primary (input) voltage
Np = number of turns on primary coil
Ip = primary (input) current

RECTIFIER

A circuit which is used to convert a.c to dc is known as RECTIFIER.


The process of conversion a.c to d.c is called “rectification”.

Types of Rectifiers

1. Half wave Rectifier


2. Full wave Rectifier
(i). Centre tap full wave rectifier.
(ii). Bridge type full bridge rectifier.
Type of Rectifier
Parameter Half wave Full wave Bridge
Number of diodes 1 2 4
PIV of diodes Vm 2Vm Vm
D.C output voltage Vm/ 2Vm/ 2Vm/
Vdc,at no-load 0.318Vm 0.636Vm 0.636Vm
Ripple factor 1.21 0.482 0.482
Ripple frequency f 2f 2f
Rectification 0.406 0.812 0.812
efficiency
Transformer
Utilization 0.287 0.693 0.812
Factor(TUF)
RMS voltage Vrms Vm/2 Vm/√2 Vm/√2
Table: Comparison of Rectifier Circuits

Full-wave Rectifier

From the above comparison we came to know that full wave bridge
rectifier as more advantages than the other two rectifiers. So, in our project
we are using full wave rectifier circuit.

FILTER

A Filter is a device which removes the a.c component of rectifier


output but allows the d.c component to reach the load.

Capacitor Filter
We have seen that the ripple content in the rectified output of half
wave rectifier is 121% or that of full-wave or bridge rectifier or bridge
rectifier is 48% such high percentages of ripples is not acceptable for most
of the applications.

Ripples can be removed by one of the following methods of filtering.

(a) A capacitor, in parallel to the load, provides an easier by –pass


for the ripples voltage though it due to low impedance. At ripple
frequency and leave the D.C. to appear at the load.

(b) An inductor, in series with the load, prevents the passage of the
ripple current (due to high impedance at ripple frequency) while
allowing the d.c (due to low resistance to d.c)

(c) Various combinations of capacitor and inductor, such as L-


section filter section filter, multiple section filter etc. which make
use of both the properties mentioned in (a) and (b) above. Two
cases of capacitor filter, one applied on half wave rectifier and
another with full wave rectifier.

Filtering is performed by a large value electrolytic capacitor


connected across the DC supply to act as a reservoir, supplying current to
the output when the varying DC voltage from the rectifier is falling. The
capacitor charges quickly near the peak of the varying DC, and then
discharges as it supplies current to the output. Filtering significantly
increases the average DC voltage to almost the peak value (1.4 × RMS
value).
To calculate the value of capacitor(C),
C = ¼*√3*f*r*Rl
Where,
f = supply frequency,
r = ripple factor,
Rl = load resistance

Note: In our circuit we are using 1000µF hence large value of


capacitor is placed to reduce ripples and to improve the DC component.

REGULATOR

Voltage regulator ICs is available with fixed (typically 5, 12 and 15V)


or variable output voltages. The maximum current they can pass also rates
them. Negative voltage regulators are available, mainly for use in dual
supplies.

Most regulators include some automatic protection from excessive


current ('overload protection') and overheating ('thermal protection'). Many
of the fixed voltage regulators ICs have 3 leads and look like power
transistors, such as the 7805 +5V 1A regulator shown on the right. The
LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input
pin, connect the negative lead to the Common pin and then when you turn
on the power, you get a 5 volt supply from the output pin.
Fig: A Three Terminal Voltage Regulator

Circuit Diagram of Power Supply is shown below:


CHAPTER – 10

DESCRIPTION ABOUT LDR

The Photoconductive Cell

A Photoconductive light sensor does not produce electricity but


simply changes its physical properties when subjected to light energy. The
most common type of photoconductive device is the Photo-resistor which
changes its electrical resistance in response to changes in the light intensity.
Photo-resistors are Semiconductor devices that use light energy to control
the flow of electrons, and hence the current flowing through them. The
commonly used Photoconductive Cell is called the Light Dependant Resistor
or LDR.

LDRs or Light Dependent Resistors are very useful especially in


light/dark sensor circuits. Normally the resistance of an LDR is very high,
sometimes as high as 1000 000 ohms, but when they are illuminated with
light resistance drops dramatically. When a light level of 1000 lux (bright
light) is directed towards it, the resistance is 400R (ohms). When a light level
of 10 lux (very low light level) is directed towards it, the resistance has risen
dramatically to 10.43M (10430000 ohms).

The Light Dependant Resistor


LDR

As its name implies, the Light Dependant Resistor (LDR) is made


from a piece of exposed semiconductor material such as cadmium sulphide
that changes its electrical resistance from several thousand Ohms in the
dark to only a few hundred Ohms when light falls upon it by creating hole-
electron pairs in the material. The net effect is an improvement in its
conductivity with a decrease in resistance for an increase in illumination.
Also, photo-resistive cells have a long response time requiring many
seconds to respond to a change in the light intensity.

Materials used as the semiconductor substrate include, lead


sulphide (PbS), lead selenide (PbSe), indium anti-monide (InSb) which
detect light in the infra-red range with the most commonly used of all photo-
resistive light sensors being Cadmium Sulphide (Cds). Cadmium sulphide is
used in the manufacture of photoconductive cells because its spectral
response curve closely matches that of the human eye and can even be
controlled using a simple torch as a light source. Typically then, it has a peak
sensitivity wavelength (λp) of about 560nm to 600nm in the visible spectral
range.

The Light Dependant Resistor Cell

The most commonly used photo-resistive light sensors is the ORP12


Cadmium Sulphide photoconductive cell. This light dependant resistor has a
spectral response of about 610nm in the yellow to orange region of light.
The resistance of the cell when un-illuminated (dark resistance) is very high
at about 10MΩ's which falls to about 100Ω's when fully illuminated (lit
resistance). To increase the dark resistance and therefore reduce the dark
current, the resistive path forms a zigzag pattern across the ceramic
substrate. The CdS photocell is a very low cost device often used in auto
dimming, darkness or twilight detection for turning the street lights "ON" and
"OFF", and for photographic exposure meter type applications. One simple
use of a Light Dependant Resistor, is as a light sensitive switch as shown
below.

LDR Switch

This basic light sensor circuit is of a relay output light activated


switch. A potential divider circuit is formed between the photo-resistor, LDR
and the resistor R1. When no light is present i.e. in darkness, the resistance
of the LDR is very high in the Mega-ohms range so zero base bias is applied
to the transistor TR1 and the relay is de-energized or "OFF".

As the light level increases the resistance of the LDR starts to


decrease causing the base bias voltage at V1 to rise. At some point
determined by the potential divider network formed with resistor R1, the
base bias voltage is high enough to turn the transistor TR1 "ON" and thus
activate the relay which in turn is used to control some external circuitry. As
the light level falls back to darkness again the resistance of the LDR
increases causing the base voltage of the transistor to decrease, turning the
transistor and relay "OFF" at a fixed light level determined again by the
potential divider network.

By replacing the fixed resistor R1 with a potentiometer VR1, the


point at which the relay turns "ON" or "OFF" can be pre-set to a particular
light level. This type of simple circuit shown above has a fairly low sensitivity
and its switching point may not be consistent due to variations in either
temperature or the supply voltage. A more sensitive precision light activated
circuit can be easily made by incorporating the LDR into a "Wheatstone
Bridge" arrangement and replacing the transistor with an Operational
Amplifier as shown.

Light Level Sensing Circuit

In this basic circuit the light dependant resistor, LDR1 and the
potentiometer VR1 form one arm of a simple Wheatstone bridge network
and the two fixed resistors R1 and R2 forming the other arm. Both sides of
the bridge form potential divider networks whose outputs V1 and V2 are both
connected to the inverting and non-inverting voltage inputs respectively of
the operational amplifier. The configuration of the operational amplifier is as
a Differential Amplifier also known as a voltage comparator with its output
signal being the difference between the two input signals or voltages, V2 -
V1. The feedback resistor Rf can be chosen to give a suitable amplifier
voltage gain if required.

The resistor combination R1 and R2 form a fixed reference voltage


input V2, set by the ratio of the two resistors and the LDR - VR1 combination
a variable voltage input V1. As with the previous circuit the output from the
operational amplifier is used to control a relay, which is protected by a free
wheel diode, D1. When the light level sensed by the LDR and its output
voltage falls below the reference voltage at V2 the output from the op-amp
changes activating the relay and switching the connected load. Likewise as
the light level increases the output will switch back turning "OFF" the relay.

The operation of this type of circuit can also be reversed to switch


the relay "ON" when the light level exceeds the reference voltage level and
vice versa by reversing the positions of the light sensor LDR and the
potentiometer VR1. The potentiometer can be used to "pre-set" the
switching point of the differential amplifier to any particular light level making
it ideal as a light sensor circuit.

Photo-junction Devices

Photo-junction Devices are basically PN-Junction light sensors or


detectors made from silicon semiconductor PN-junctions which are sensitive
to light and which can detect both visible light and infrared light levels.
Photo-junction devices are specifically made for sensing light and this class
of photoelectric light sensors includes the Photodiode and the
Phototransistor.
The Photodiode.

Photo-diode

The construction of the Photodiode light sensor is similar to that of a


conventional PN-junction diode except that the diodes outer casing is either
transparent or has a clear lens to focus the light onto the PN junction for
increased sensitivity. The junction will respond to light particularly longer
wavelengths such as red and infrared rather than visible light.

This characteristic can be a problem for diodes with transparent or


glass bead bodies such as the 1N4148 signal diode. LED's can also be used
as photodiodes as they can both emit and detect light from their junction. All
PN-junctions are light sensitive and can be used in a photo-conductive
unbiased voltage mode with the PN-junction of the photodiode always
"Reverse Biased" so that only the diodes leakage or dark current can flow.

The current-voltage characteristic (I/V Curves) of a photodiode with


no light on its junction (dark mode) is very similar to a normal signal or
rectifying diode. When the photodiode is forward biased, there is an
exponential increase in the current, the same as for a normal diode. When a
reverse bias is applied, a small reverse saturation current appears which
causes an increase of the depletion region, which is the sensitive part of the
junction. Photodiodes can also be connected in a current mode using a fixed
bias voltage across the junction. The current mode is very linear over a wide
range.
Photo-diode Construction and Characteristics

When used as a light sensor, a photodiodes dark current (0 lux) is


about 10uA for geranium and 1uA for silicon type diodes. When light falls
upon the junction more hole/electron pairs are formed and the leakage
current increases. This leakage current increases as the illumination of the
junction increases. Thus, the photodiodes current is directly proportional to
light intensity falling onto the PN-junction. One main advantage of
photodiodes when used as light sensors is their fast response to changes in
the light levels, but one disadvantage of this type of photo device is the
relatively small current flow even when fully lit.
The following circuit shows a photo-current-to-voltage converter
circuit using an operational amplifier as the amplifying device. The output
voltage (Vout) is given as Vout = Ip × Rf and which is proportional to the light
intensity characteristics of the photodiode. This type of circuit also utilizes
the characteristics of an operational amplifier with two input terminals at
about zero voltage to operate the photodiode without bias. This zero-bias
op-amp configuration gives a high impedance loading to the photodiode
resulting in less influence by dark current and a wider linear range of the
photocurrent relative to the radiant light intensity. Capacitor C f is used to
prevent oscillation or gain peaking and to set the output bandwidth
(1/2πRC).

Photo-diode Amplifier Circuit

Photodiodes are very versatile light sensors that can turn its current flow
both "ON" and "OFF" in nanoseconds and are commonly used in cameras,
light meters, CD and DVD-ROM drives, TV remote controls, scanners, fax
machines and copiers etc, and when integrated into operational amplifier
circuits as infrared spectrum detectors for fibre optic communications,
burglar alarm motion detection circuits and numerous imaging, laser
scanning and positioning systems etc.
The Phototransistor

Photo-transistor

An alternative photo-junction device to the photodiode is the


Phototransistor which is basically a photodiode with amplification. The
Phototransistor light sensor has its collector-base PN-junction reverse
biased exposing it to the radiant light source. Phototransistors operate the
same as the photodiode except that they can provide current gain and are
much more sensitive than the photodiode with currents are 50 to 100 times
greater than that of the standard photodiode and any normal transistor can
be easily converted into a phototransistor light sensor by connecting a
photodiode between the collector and base.

Phototransistors consist mainly of a bipolar NPN Transistor with its


large base region electrically unconnected, although some phototransistors
allow a base connection to control the sensitivity, and which uses photons of
light to generate a base current which in turn causes a collector to emitter
current to flow. Most phototransistors are NPN types whose outer casing is
either transparent or has a clear lens to focus the light onto the base junction
for increased sensitivity.

Photo-transistor Construction and Characteristics


In the NPN transistor the collector is biased positively with respect to the
emitter so that the base/collector junction is reverse biased. therefore, with
no light on the junction normal leakage or dark current flows which is very
small. When light falls on the base more electron/hole pairs are formed in
this region and the current produced by this action is amplified by the
transistor. The sensitivity of a phototransistor is a function of the DC current
gain of the transistor. Therefore, the overall sensitivity is a function of
collector current and can be controlled by connecting a resistance between
the base and the emitter but for very high sensitivity opto coupler type
applications, Darlington phototransistors are generally used.
Photo-darlington

Photodarlington transistors use a second bipolar NPN transistor to


provide additional amplification or when higher sensitivity of a photo-detector
is required due to low light levels or selective sensitivity, but its response is
slower than that of an ordinary NPN phototransistor.

Photo Darlington devices consist of a normal phototransistor whose


emitter output is coupled to the base of a larger bipolar NPN transistor.
Because a Darlington transistor configuration gives a current gain equal to a
product of the current gains of two individual transistors, a photo-Darlington
device produces a very sensitive detector.

Typical applications of Phototransistors light sensors are in opto-


isolators, slotted opto switches, light beam sensors, fibre optics and TV type
remote controls, etc. Infrared filters are sometimes required when detecting
visible light.

Another type of photo-junction semiconductor light sensor worth a


mention is the Photo-thyristor. This is a light activated thyristor or Silicon
Controlled Rectifier, SCR that can be used as a light activated switch in AC
applications. However their sensitivity is usually very low compared to
photodiodes or phototransistors, as to increase their sensitivity to light they
are made thinner around the gate junction which in turn limits the amount of
current that they can switch. Then for higher current AC applications they are
used as pilot devices in opto-couplers to switch larger more conventional
thyristors.
CHAPTER – 9

DESCRIPTION ABOUT TIMER CHIP

The 555 Timer is a very cheap, popular and useful precision timing
device that can act as either a simple timer to generate single pulses or
long time delays, or as a relaxation oscillator producing stabilized
waveforms of varying duty cycles from 50 to 100%. The 555 timer chip is
extremely robust and stable 8-pin device that can be operated either as a
very accurate Monostable, Bistable or Astable Multivibrator to produce a
variety of applications such as one-shot or delay timers, pulse generation,
LED and lamp flashers, alarms and tone generation, logic clocks,
frequency division, power supplies and converters etc, in fact any circuit
that requires some form of time control as the list is endless.

The single 555 Timer chip in its basic form is a Bipolar 8-pin mini
Dual-in-line Package (DIP) device consisting of some 25 transistors, 2
diodes and about 16 resistors arranged to form two comparators, a flip-flop
and a high current output stage as shown below. As well as the 555 Timer
there is also available the NE556 Timer Oscillator which combines TWO
individual 555's within a single 14-pin DIP package and low power CMOS
versions of the single 555 timer such as the 7555 and LMC555 which use
MOSFET transistors instead.

A simplified "block diagram" representing the internal circuitry of the


555 timer is given below with a brief explanation of each of its connecting
pins to help provide a clearer understanding of how it works.
555 Timer Oscillator Block Diagram

Pin 1: Grounded Terminal: The ground (or common) pin is the most negative
supply potential of the device, which is normally connected to circuit
common (ground) when operated from positive supply voltages.

Pin 2: Trigger Terminal: This pin is the input to the lower comparator and is
used to set the latch, which in turn causes the output to go high. This is the
beginning of the timing sequence in mono-stable operation. Triggering is
accomplished by taking the pin from above to below a voltage level of
1/3V+(or, in general, one-half the voltage appearing at pin 5).

Pin 3: Output Terminal: Output of the timer is available at this pin. There are
two ways in which a load can be connected to the output terminal either
between pin 3 and ground pin (pin 1) or between pin 3 and supply pin (pin
8). The load connected between pin 3 and ground supply pin is called the
normally on load and that connected between pin 3 and ground pin is
called the normally off load.

Pin 4: Reset Terminal: To disable or reset the timer a negative pulse is


applied to this pin due to which it is referred to as reset terminal. When this
pin is not to be used for reset purpose, it should be connected to + V CC to
avoid any possibility of false triggering.

Pin 5: Control Voltage Terminal: The function of this terminal is to control the
threshold and trigger levels. Thus either the external voltage or a pot
connected to this pin determines the pulse width of the output waveform.
The external voltage applied to this pin can also be used to modulate the
output waveform. When this pin is not used, it should be connected to
ground through a 0.01 micro Farad to avoid any noise problem.

Pin 6: Threshold Terminal: This is the non-inverting input terminal of


comparator 1, which compares the voltage applied to the terminal with a
reference voltage of 2/3 VCC. The amplitude of voltage applied to this
terminal is responsible for the set state of flip-flop.

Pin 7: Discharge Terminal: This pin is connected internally to the collector of


transistor and mostly a capacitor is connected between this terminal and
ground. It is called discharge terminal because when transistor saturates,
capacitor discharges through the transistor. When the transistor is cut-off,
the capacitor charges at a rate determined by the external resistor and
capacitor.

Pin 8: Supply Terminal: A supply voltage of + 5 V to + 18 V is applied to this


terminal with respect to ground (pin 1).
The important features of the 555 timer are :
 It operates from a wide range of power supplies ranging from + 5 Volts to

+ 18 Volts supply voltage.


 Sinking or sourcing 200 mA of load current.
 The external components should be selected properly so that the timing
intervals can be made into several minutes Proper selection of only a few
external components allows timing intervals of several minutes along with
the frequencies exceeding several hundred kilo hertz.
 It has a high current output; the output can drive TTL.
 It has a temperature stability of 50 parts per million (ppm) per degree
Celsius change in temperature, or equivalently 0.005 %/ °C.
 The duty cycle of the timer is adjustable with the maximum power
dissipation per package is 600 mW and its trigger and reset inputs are
logic compatible.

The 555 Timers name comes from the fact that there are three 5kΩ
resistors connected together internally producing a voltage divider network
between the supply voltage at pin 8 and ground at pin 1. The voltage
across this resistive network holds the positive input of comparator two at
2/3Vcc and the positive input to comparator one at 1/3Vcc. The two
comparators produce an output voltage dependent upon the voltage
difference at their inputs which is determined by the charging and
discharging action of the externally connected RC network. The outputs
from both comparators are connected to the two inputs of the flip-flop
which in turn produces either a "HIGH" or "LOW" level output at Q based
on the states of its inputs. The output from the flip-flop is used to control a
high current output switching stage to drive the connected load producing
either a "HIGH" or "LOW" voltage level at the output pin.
The most common use of the 555 timer oscillator is as a simple
Astable oscillator by connecting two resistors and a capacitor across its
terminals to generate a fixed pulse train with a time period determined by
the time constant of the RC network. But the 555 timer oscillator chip can
also be connected in a variety of different ways to produce Mono-stable or
Bi-stable multi-vibrators as well as the more common Astable Multi-
vibrator.

The 555 has three operating modes:

 Mono-stable mode: in this mode, the 555 functions as a "one-shot"


pulse generator. Applications include timers, missing pulse detection,
bounce free switches, and touch switches, frequency divider, capacitance
measurement, pulse-width modulation (PWM) and so on.
 Astable – free running mode: the 555 can operate as an oscillator. Uses
include LED and lamp flashers, pulse generation, logic clocks, tone
generation, security alarms, pulse position modulation and so on.
 Bi-stable mode or Schmitt trigger: the 555 can operate as a flip-flop, if
the DIS pin is not connected and no capacitor is used. Uses include
bounce free latched switches.

The Mono-stable 555 Timer

The operation and output of the 555 Mono-stable is exactly the same
as that for the transistorized one we look at previously in the Mono-stable
Multi-vibrators tutorial. The difference this time is that the two transistors
have been replaced by the 555 timer device. Consider the 555 Mono-
stable circuit below.

Mono-stable 555 Timer


When a negative (0V) pulse is applied to the trigger input (pin 2) of
the Mono-stable configured 555 Timer oscillator, the internal comparator,
(comparator No1) detects this input and "sets" the state of the flip-flop,
changing the output from a "LOW" state to a "HIGH" state. This action in
turn turns "OFF" the discharge transistor connected to pin 7, thereby
removing the short circuit across the external timing capacitor, C1. This
allows the timing capacitor to start to charge up through resistor, R1 until
the voltage across the capacitor reaches the threshold (pin 6) voltage of
2/3Vcc set up by the internal voltage divider network. At this point the
comparators output goes "HIGH" and "resets" the flip-flop back to its
original state which in turn turns "ON" the transistor and discharges the
capacitor to ground through pin 7. This action also causes the output to
change its state back to the original stable "LOW" value awaiting another
trigger pulse to start the timing process over again. Then as before, the
Mono-stable Multi-vibrator has only ONE stable state.

The Mono-stable 555 Timer circuit triggers on a negative-going pulse


applied to pin 2 and this trigger pulse must be much shorter than the
output pulse width allowing time for the timing capacitor to charge and then
discharge fully. Once triggered, the 555 Mono-stable will remain in this
"HIGH" unstable output state until the time period set up by the R1.C1
network has elapsed. The amount of time that the output voltage remains
"HIGH" or at a logic "1" level, is given by the following time constant
equation.

Where, t is in seconds, R is in Ω's and C in Farads.

Bi-stable 555 Timer

As well as the one shot 555 Mono-stable configuration above, we can


also produce a Bi-stable (two stable states) device with the operation and
output of the 555 Bi-stable being similar to the transistorized one we look at
previously in the Bi-stable Multi-vibrators tutorial. The 555 Bi-stable is one of
the simplest circuits we can build using the 555 timer oscillator chip. This
bi-stable configuration does not use any RC timing network to produce an
output waveform so no equations are required to calculate the time period
of the circuit. Consider the Bi-stable 555 Timer circuit below.

Bi-stable 555 Timer (flip-flop)


The switching of the output waveform is achieved by controlling the
trigger and reset inputs of the 555 timer which are held "HIGH" by the two
pull-up resistors, R1 and R2. By taking the trigger input (pin 2) "LOW",
switch in set position, changes the output state into the "HIGH" state and
by taking the reset input (pin 4) "LOW", switch in reset position, changes
the output into the "LOW" state. This 555 timer circuit will remain in either
state indefinitely and is therefore bi-stable. Then the Bi-stable 555 timer is
stable in states, "HIGH" and "LOW". The threshold input (pin 6) is
connected to ground to ensure that it cannot reset the bi-stable circuit as it
would in a normal timing application.

Astable 555 Oscillator


In the 555 Oscillator above, pin 2 and pin 6 are connected together
allowing the circuit to re-trigger itself on each and every cycle allowing it to
operate as a free running oscillator. During each cycle capacitor, C charges
up through both timing resistors, R1 and R2 but discharges itself only
through resistor, R2 as the other side of R2 is connected to the discharge
terminal, pin 7. Then the capacitor charges up to 2/3Vcc (the upper
comparator limit) which is determined by the 0.693(R1+R2)C combination
and discharges itself down to 1/3Vcc (the lower comparator limit)
determined by the 0.693(R2.C) combination. This results in an output
waveform whose voltage level is approximately equal to Vcc - 1.5V and
whose output "ON" and "OFF" time periods are determined by the
capacitor and resistors combinations. The individual times required to
completing one charge and discharge cycle of the output is therefore given
as:

Astable 555 Oscillator Charge and Discharge


Times

Where, R is in Ω's and C in Farads.

When connected as an Astable multi-vibrator, the output from the 555


Oscillator will continue indefinitely charging and discharging between
2/3Vcc and 1/3Vcc until the power supply is removed. As with the mono-
stable multi-vibrator these charge and discharge times and therefore the
frequency are independent of the supply voltage. The duration of one full
cycle is therefore equal to the sum of the two individual times that the
capacitor charges and discharges added together and is given as:

555 Oscillator Cycle Time


The output frequency of oscillations can be found by inverting the
equation above for the total cycle time giving a final equation for the output
frequency of an Astable 555 Oscillator as:

555 Oscillator Frequency Equation

By altering the time constant of just one of the RC combinations, the


Duty Cycle better known as the "Mark-to-Space" ratio of the output
waveform can be accurately set and is given as the ratio of resistor R2 to
resistor R1. The Duty Cycle for the 555 Oscillator, which is the ratio of the
"ON" time divided by the "OFF" time is given by:

555 Oscillator Duty Cycle

The duty cycle has no units as it is a ratio but can be expressed as a


percentage (%). If both timing resistors, R1 and R2 are equal the output
duty cycle will be given as 2:1 or 33%.

Working Principle
Refer Block Diagram of 555 timer IC given above:

Comparator 1 has a threshold input (pin 6) and a control input (pin 5).
In most applications, the control input is not used, so that the control
voltage equals +2/3 VCC. Output of this comparator is applied to set (S)
input of the flip-flop. Whenever the threshold voltage exceeds the control
voltage, comparator 1 will set the flip-flop and its output is high. A high
output from the flip-flop saturates the discharge transistor and discharge
the capacitor connected externally to pin 7. The complementary signal out
of the flip-flop goes to pin 3, the output. The output available at pin 3 is
low. These conditions will prevail until comparator 2 triggers the flip-flop.
Even if the voltage at the threshold input falls below 2/3 VCC, that is
comparator 1 cannot cause the flip-flop to change again. It means that the
comparator 1 can only force the flip-flop’s output high.

To change the output of flip-flop to low, the voltage at the trigger


input must fall below + 1/3 Vcc. When this occurs, comparator 2 triggers
the flip-flop, forcing its output low. The low output from the flip-flop turns
the discharge transistor off and forces the power amplifier to output a high.
These conditions will continue independent of the voltage on the trigger
input. Comparator 2 can only cause the flip-flop to output low.

From the above discussion it is concluded that for the having low
output from the timer 555, the voltage on the threshold input must exceed
the control voltage or + 2/3 VCC. They also turn the discharge transistor on.
To force the output from the timer high, the voltage on the trigger input
must drop below +1/3 VCC. This also turns the discharge transistor off.

A voltage may be applied to the control input to change the levels at


which the switching occurs. When not in use, a 0.01 nano Farad capacitor
should be connected between pin 5 and ground to prevent noise coupled
onto this pin from causing false triggering.
Connecting the reset (pin 4) to a logic low will place a high on the
output of flip-flop. The discharge transistor will go on and the power
amplifier will output a low. This condition will continue until reset is taken
high. This allows synchronization or resetting of the circuit’s operation.
When not in use, reset should be tied to +VCC.
CHAPTER – 10

HARDWARE DETAILS

The IC’s and other important components used in this project work,
procured from the Hyderabad Electronics Market. The details or data
sheets of the IC’s are down loaded from the Internet. The following are
the web sites that can be browsed for collecting the data sheets.

1. www. Texas Instruments.com


2. www. National semiconductors.com
3. www. Fairchild semiconductors.com

The following are the IC’s and other important components used in
this project work

1. Arduino ATMEGA 2560 Micro-controller board


2. GSM Modem
3. Voltage regulators
4. LDR
5. 555 Timer Chip
6. Relays
7. BC 547 Transistor

The required PCB’S (Printed Circuit boards) for the project work
fabricated by SUN RISE CIRCUITS, Kushaiguda Industrial Estate,
Hyderabad. Kushaiguda Industrial Estate is very famous for fabricating the
PCB’s.
CHAPTER – 11

CONCLUSION AND REFERENCES

The project work is successfully designed tested and a demo unit is


fabricated. Since it is a demonstration unit, facility is provided only for
single phase line and manhole, but for real application number of sensors
for individual manholes may be used depending upon the area of the field.
To achieve this, the same system with enhanced technology and with
required modifications can be implemented. The LDR used for sensing the
natural light can be kept in a suitable glass container and it should be kept
inside the manhole.

This project is a cost effective, practical, eco-friendly and the safest


way to save energy and this system the light status information can be
accessed from anytime and anywhere. It clearly tackles the two problems
that world is facing today, saving of energy and also instant faulty light
detection, very efficiently. Initial cost and maintenance can be the
drawbacks of this project. With the advances in technology and good
resource planning the cost of the project can be cut down and also with the
use of good equipment the maintenance can also be reduced in terms of
periodic checks. The LEDs have long life, emit cool light, donor have any
toxic material and can be used for fast switching. For these reasons our
project presents far more advantages which can over shadow the present
limitations. Keeping in view the long term benefits and the initial cost would
never be a problem as the investment return time is very less. The project
has scope in various other applications like for providing lighting in
industries, campuses and parking lots of huge shopping malls. This can
also be used for surveillance in corporate campuses and industries.

In this project work the required power supply for the entire circuitry is
derived from the main source, since the circuitry to be installed at roads,
therefore this supply can be generated using solar energy. For this
purpose suitable solar panel can be utilized for charging the battery and
the stored energy from the battery can be utilized to generate required
power supply for the circuitry.

REFERENCES:

In order to select a suitable topic for the project, lots of references


are made. A part from selection, while designing circuits, lot of study
material is referred. The list is as follows:

Text Books:
1) Linear Integrated Circuits – By: D. Roy Choudhury, Shail Jain
2) Power Electronics - By: SEN
3) Digital Electronics – WILLIAM M. GOTHMANN
4) Electronic Devices & Circuits – ALLEN MOTTERSHEAD
5) The concepts and Features of Micro-controllers - By: Raj Kamal
6) The 8051 Micro-controller Architecture, programming & Applications
By: Kenneth J. Ayala
7) Programming and Customizing the 8051 Micro-controller By: Myke
Predko
8) The IC 555 Timer Applications Source book By: HOWARD M.
BERLIN
9) Electronic Circuit guide book – Sensors – By JOSEPH J.CARR

Journals:
(1) Electronic Design
(2) Electronics for you
(3) Electronics Text.
(4) Practical Electronics

You might also like