Sie sind auf Seite 1von 100

CHAPTER-1

INTRODUCTION
1.1) OVERVIEW:
Now a days use of human energy became very low as a technology
increases.GSM technology brought a revolution in human day to day life. In these days we
can observe 9 people in every 10 are using GSM mobiles. The main aim of this project is to
control the motor using GSM technology from anywhere in the world and to monitor the
status of motor (working/non working).
GSM technology has been used for communication between the system and the
user. The user can control the operation of the devices connected to the controller from
anywhere in the world. It is possible by sending a text message in a predefined format to the
GSM modem, whenever the user sends a valid SMS to the GSM modem, it reads the
message. If the text message is in the predefined format then the appropriate action will be
taken by the microcontroller. GSM modem can be controlled by the standard set of AT
(Attention) commands.
Here we are using the 8051 microcontroller, it is the heart of the project, it
controls overall devices in the circuit, It mainly consists of four ports.
1.2) OBJECTIVE OF THE PROJECT:
This project is related with Embedded System technology. The project is built
around the AT89C51 micro controller from Atmel. This micro controller provides all the
functionality of the display and wireless control. It also takes care of creating different
display effects for given text. The main objective of the project is to provide a system that
control the motor using gsm technology.

GSM based Motor Control


Page 1

1.3) AIM OF THE PROJJECT:


The main aim of this project is to design an efficient system that reduces manual
mechanical power and that performs parallel tasks using GSMtechnology.
In this project we can observe that devices like DC motor, stepper motor, AC
supply (bulb) and LED or buzzer can be controlled using gsm. It is possible by sending a text
message in a predefined format to the GSM modem, whenever the user sends a valid SMS to
the GSM modem, it reads the message. If the text message is in the predefined format then
the appropriate action will be taken by the microcontroller. GSM modem can be controlled
by the standard set of AT (Attention) commands.
The software we have used is Keil software with vision. This software is used
including Flash Magic. Using this software we have written the coding in Embedded C. This
code is written for interfacing LCD, for controlling the devices like DC motor, Stepper
motor, Bulb that uses AC supply and an LED.
1.4) ADVANTAGES & DISADVATAGES:
Advantages of gsm based motor controlling are as follows.

This system reduces manual mechanical power.

Utilizes new biometric technology.

Helps the user to perform the task from anywhere in the world.

Improves efficiency.

Performance of task is easy.

1.5) THEISIS ORGANISATION:


Chapter 1 deals with the Introduction and need for designing a system like gsm
based motor controlling and advantages and disadvantages of this system.
GSM based Motor Control
Page 2

Chapter 2 discusses the entire theoretical part and discusses the theory of the
components used like Microcontroller, gsm technology, and LCD.
Chapter 3 introduces the design aspects of the system that includes block diagram,
its description, and the hardware components used in the system along with their internal
structures. It also deals with the circuit diagram and description along with the design
considerations of the components.
Chapter 4 introduces the software development of the system including the logics
used in the design along with the algorithm, flowchart and source code with its description.
Chapter 5 shows the results for each design and describes the result.
Chapter 6 concludes the entire thesis along with its future scope, the conclusionitself
contains the applications of using this system and the need for using this system and the
future enhancements of the system.

GSM based Motor Control


Page 3

CHAPTER-2
THEORITICAL CHAPTER
2.1) INTRODUCTION:
Now a days use of human energy became very low as a technology increases.
GSM technology brought a revolution in human day to day life.The main aim of this project
is to control the motor using GSM technology from anywhere in the world and to monitor the
status of motor (working/non working).
GSM technology has been used for communication between the system and the
user. The user can control the operation of the devices connected to the controller from
anywhere in the world. It is possible by sending a text message in a predefined format to the
GSM modem, whenever the user sends a valid SMS to the GSM modem, it reads the
message. If the text message is in the predefined format then the appropriate action will be
taken by the microcontroller. GSM modem can be controlled by the standard set of AT
(Attention) commands.
Global system for mobile communication (GSM) is a globally accepted
standard for digital cellular communication. A GSM modem can be an external modem
device, such as the Wavecom FASTRACK Modem. Insert a GSM SIM card into this
modem, and connect the modem to an available serial port on your computer. A GSM
modem could also be a standard GSM mobile phone with the appropriate cable and software
driver to connect to a serial port on your computer.
The main aim of the project is to control the devices like motors, fans, bulbs,
A/Cs, etc from anywhere in the world by sending written message to the controller. By
doing this we can reduce the human loss and increase the efficiency. Within the less we
control the devices using gsm technology.
The modules used to develop this project are,

GSM based Motor Control


Page 4

2.2. MICRO CONTROLLER


8051 is one of the most popular microcontrollers in use today. Many derivative
microcontrollers have since been developed that are based onand compatible withthe
8051.Thus, the ability to program an 8051 is an important skill for anyone who plans to
develop products that will take advantage of microcontrollers. General-purpose
microprocessors contains No RAM No ROM No I/O ports Microcontroller has CPU
(microprocessor) RAM ROMI/O ports Timer ADC and other peripherals. The fixed amount
of on-chip ROM, RAM, and number of I/O ports makes them ideal for many applications in
which cost and space are critical In many applications, the space it takes, the power it
consumes, and the price per unit are much more critical considerations than the computing
power. r Science and Information Engineering
Intel introduced 8051, referred as MCS-51, in 1981.

The 8051 is an 8-bit processor

The CPU can work on only 8 bits of data at a time

The 8051 had128 bytes of RAM

4K bytes of on-chip ROM

Two timers

One serial port

Four I/O ports, each 8 bits wide

6 interrupt sources
The solution proposed doesn't contain any special components, like photo-diodes,

photo-transistors, or IR receiver ICs, only a couple if IR leds, an Op amp, a transistor and a


couple of resistors. In need, as the title says, a standard IR led is used for the purpose of
detection. Due to that fact, the circuit is extremely simple, and any novice electronics
hobbyist can easily understand and build it.
GSM based Motor Control
Page 5

2.3. RS 232 CONVERTER (MAX 232N)


This is the device, which is used to convert TTL/RS232 vice versa.
RS-232Protocol
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 terminal or computer and the DCE is the modem or other
communications device.

Voltage range
The standard voltage range on RS-232 pins is _15V to +15V. This voltage range
applies to all RS-232 signal pins. The total voltage swing during signal transmission can be
as large as 30V. In many cases, RS-232 ports will operate with voltages as low as _5V to
+5V. This wide range of voltages allows for better compatibility between different types
of equipment and allows greater noise margin to avoid interference. Because the voltage
swing on RS-232 lines is so large, the RS-232 signal lines generate a significant amount of
electrical noise.
It is important that this signal does not run close to high impedance
microphone lines or audio lines in a system. In cases where you must run these types of
signals nearby one another, it is important to make sure that all audio wires are properly
shielded.The main role of the RS232 chip is to convert the data coming for the 12-volt logic
to 5 volt logic and from 5 volt logic to 12 volt logic.
GSM based Motor Control
Page 6

2.4 Global System for Mobile Communication:


Global system for mobile communication (GSM) is a globally accepted standard
for digital cellular communication. A GSM modem can be an external modem device, such as
the Wavecom FASTRACK Modem. Insert a GSM SIM card into this modem, and connect
the modem to an available serial port on your computer. A GSM modem could also be a
standard GSM mobile phone with the appropriate cable and software driver to connect to a
serial port on your computer.
A dedicated GSM modem (external or PC Card) is usually preferable to a GSM
mobile phone. This is because of some compatibility issues that can exist with mobile
phones. This is because the mobile phone automatically processes these messages, without
forwarding them via the modem interface. Similarly some mobile phones will not allow you
to correctly receive SMS text messages longer than 160 bytes (known as concatenated
SMS or long SMS). This is because these long messages are actually sent as separate
SMS messages, and the phone attempts to reassemble the message before forwarding via the
modem interface
When you install your GSM modem, or connect your GSM mobile phone to the
computer, be sure to install the appropriate Windows modem driver from the device
manufacturer. To simplify configuration, the Now SMS/MMS Gateway will communicate
with the device via this driver. An additional benefit of utilizing this driver is that you can
use Windows diagnostics to ensure that the modem is communicating properly with the
computer.

2.5.Liquid Crystal Displays (LCD)


An LCD is a small low cost display. It is easy to interface with a microcontroller because of an embedded controller(the black blob on the back of the board). This
controller is standard across many displays(HD 44780) which means many microGSM based Motor Control
Page 7

controller(including the Arduino) have libraries that make displaying messages as easy as a
single line of code.

2.6. POWER SUPPLY


The power supply circuits built using filters, rectifiers, and then voltage
regulators. Starting with an ac voltage, a steady dc voltage is obtained by rectifying the ac
voltage, then filtering to a dc level, and finally, regulating to obtain a desired fixed dc
voltage. The regulation is usually obtained from an IC voltage regulator unit, which takes a
dc voltage and provides a somewhat lower dc voltage, which remains the same even if the
input dc voltage varies, or the output load connected to the dc voltage changes.

2.7 DC MOTOR:
DC motor is device that is controlled using this Global System for Mobile
comminication.This DC motor is a symbol to indicate that it is possible to control devices
like fans using this system. DC motor is the prototype showing that this GSM based motor
control.

2.8.CONCLUSION
Micro controller is the heart of total system as it controls all the devices
connected to it. Micro controller sends pulses to all the devices, which are connected to it
can be programed in any language i.e., in assembly or C or C++, depending upon the
user. In this flash memory is more compatible with others. In our design, this controller is
compatible and also reliable one. Here when the service number sent from the computer
gets matched with the meter number then the necessary operation gets performed.LCD is
connected to microcontroller port 2 of 8 data pins. Initially the previous month value is
displayed in LCD after the completion of operation the net value displayed. Two LEDs
are connected to the microcontroller for the indication purpose.

GSM based Motor Control


Page 8

CHAPTER-3
DESIGN ASPECTS
3.1.INTRODUCTION
The Hardware design aspects of the GSM based motor control system includes
the block diagram of the system and the design of each and every component of the system
along with its internal structure and pin diagrams of each and every Integrated Circuit used in
designing the system and the design considerations of each component. This is the chapter
that deals with the above aspects.
GSM technology has been used for communication between the system and the
user. The user can control the operation of the devices connected to the controller from
anywhere in the world. It is possible by sending a text message in a predefined format to the
GSM modem, whenever the user sends a valid SMS to the GSM modem, it reads the
message. If the text message is in the predefined format then the appropriate action will be
taken by the microcontroller. GSM modem can be controlled by the standard set of AT
(Attention) commands.
When you install your GSM modem, or connect your GSM mobile phone to the
computer, be sure to install the appropriate Windows modem driver from the device
manufacturer. To simplify configuration, the Now SMS/MMS Gateway will communicate
with the device via this driver. An additional benefit of utilizing this driver is that you can
use Windows diagnostics to ensure that the modem is communicating properly with the
computer.

GSM based Motor Control


Page 9

3.2.BLOCK DIAGRAM OF THE PROJECT


3.2.1.BLOCK DIAGRAM

GSM BASED
MOTOR

GSM
Anten
n

GSM
POWE
R
SUPPL

Micro
Controller
8051

SIM
Card
and
Networ
k

D.C
Motor

GSM ANTENNA:

GSM based Motor Control


Page 10

GSM Network
Provider

Fig 1:Block diagram of project

3.2.2 DESCRIPTION
The 8051 microcontroller is heart of the circuit. This miniproject works on the
8051 micro controller. The main function of the 8051 micro controller is it controls the over
all functions of the circuit.It is a 40 pin DIP package.It has 4 ports namely
port0,port1,port2,port3.Here we are using two ports P2,P3.
The other main module of the miniproject is GSM.GSM stands for Global
System for Mobile Communication.GSM module is a communication device.It requires 5V
DC power supply. A standard serial interface for PC, RS232C, requires negative logic, i.e.,
logic 1 is -3V to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TxD and RxD
pins of the microcontroller thus need a converter chip. A MAX232 chip has long been using
in many microcontrollers boards. Max-232 used for communicate our GSM module and
8051 controller.
The Motor Principle: when a current-carrying conductor is located in an external
magnetic field perpendicular to the conductor, conductor experiences a force perpendicular to
itself and to the external magnetic field.
Here we are using 5V power supply which is regulated from the 7805 voltage
regulator. Here we are using bridge rectifier, filter and regulator. Bridge rectifier is used for
converting A.C into pulsating D.C or it converts bidirectional current into uni directional
current. Filter is used for remove the a.c component present in the pulsating d.c. voltage
regulator is used for regulates the output voltage.

GSM based Motor Control


Page 11

The LCD is used for the purpose of displaying the words which we are given in the
program code. This code will be executed on microcontroller chip. By following the
instructions in code the LCD display the related words.

3.3. HARDWARE USED


The modules used for implementing this projects are,
1.POWER SUPPLY-Used for giving 12v and 5v power supply.
2.MICRO CONTROLLER-Used for controlling all these devices which are connected to it.
3.GSM- Used for sending and receiving information about motor.
4.RELAY-Uesed for automatic switch.
5.D.C MOTOR-Used for indicate the motor status.
6.LCD- Displaying the messages according to the commands.

3.4.POWER SUPPLY
3.4.1.CIRCUIT DIAGRAM AND INTRODUCTION

GSM based Motor Control


Page 12

Figure2: Power supply circuit,


Power supply unit consists of following units
i) Step down transformer
ii) Rectifier unit
iii) Input filter
iv) Regulator unit
v) Output filter
STEPDOWN TRANSFORMER:
The Step down Transformer is used to step down the main supply voltage from 230V AC to
lower value. This 230 AC voltage cannot be used directly, thus it is stepped down. The
Transformer consists of primary and secondary coils. To reduce or step downthe voltage, the
transformer is designed to contain less number of turns in its secondarycore. The output from
the secondary coil is also AC waveform. Thus the conversion fromAC to DC is essential.
This conversion is achieved by using the Rectifier Circuit/Unit.
RECTIFIER UNIT:
GSM based Motor Control
Page 13

The Rectifier circuit is used to convert the AC voltage into its corresponding DC voltage.
There are Half-Wave, Full-Wave and bridge Rectifiers available for this specific function.
The most important and simple device used in Rectifier circuit is the diode. The simple
function of the diode is to conduct when forward biased and not to conduct in reverse
bias.The Forward Bias is achieved by connecting the diodes positive with positive of the
battery and negative with batterys negative. The efficient circuit used is the Full wave
Bridge rectifier circuit. The output voltage of the rectifier is in rippled form, the ripples from
the obtained DC voltage are removed using other circuits available. The circuit used for
removing the ripples is called Filter circuit.

Fig 3: Bridge rectifier


INPUT FILTER:
Capacitors are used as filter. The ripples from the DC voltage are removed andpure DC
voltage is obtained. And also these capacitors are used to reduce the harmonics of the input
voltage. The primary action performed by capacitor is charging and discharging. It charges in
positive half cycle of the AC voltage and it will discharge innegative half cycle. So it allows
only AC voltage and does not allow the DC voltage. This filter is fixed before the regulator.
Thus the output is free from ripples.
REGULATOR UNIT:

GSM based Motor Control


Page 14

Fig 4:7805 Regulator


Regulator regulates the output voltage to be always constant. The output voltage is
maintained irrespective of the fluctuations in the input AC voltage. As and then the
ACvoltage changes, the DC voltage also changes. Thus to avoid this Regulators are sed.Also
when the internal resistance of the power supply is greater than 30 ohms, the outputgets
affected. Thus this can be successfully reduced here. The regulators are mainlyclassified for
low voltage and for high voltage. Further they can also be classified as:
i) Positive regulator
1---> input pin
2---> ground pin
3---> output pin
It regulates the positive voltage.
ii) Negative regulator
1---> ground pin
2---> input pin
3---> output pin
It regulates the negative voltage.
OUTPUT FILTER:
The Filter circuit is often fixed after the Regulator circuit. Capacitor is most often used asas
filter. The principle of the capacitor is to charge and discharge. It charges during the positive
half cycle of the AC voltage and discharges during the negative half cycle. So it allows only
AC voltage and does not allow the DC voltage. This filter is fixed after the Regulator circuit
to filter any of the possibly found ripples in the output received finally. Here we used 0.1F
capacitor. The output at this stage is 5V and is given to the Microcontroller.

3.5.MICRO CONTROLLER:
GSM based Motor Control
Page 15

8051 is one of the most popular microcontrollers in use today. Many derivative
microcontrollers have since been developed that are based onand compatible withthe
8051.Thus, the ability to program an 8051 is an important skill for anyone who plans to
develop products that will take advantage of microcontrollers. General-purpose
microprocessors contains No RAM No ROM No I/O ports Microcontroller has CPU
(microprocessor) RAM ROMI/O ports Timer ADC and other peripherals.

The fixed amount

of on-chip ROM, RAM, and number of I/O ports makes them ideal for many applications in
which cost and space are critical In many applications, the space it takes, the power it
consumes, and the price per unit are much more critical considerations than the computing
power
The 8051 is an 8-bit processor
The CPU can work on only 8 bits of data at a time
The 8051 had128 bytes of RAM
4K bytes of on-chip ROM
Two timers
One serial port
Four I/O ports, each 8 bits wide
6 interrupt sources

3.5.1 Internal structure


Fig 5 :8051 Micro controller internal structure
8051c is a 8bit microcontroller introduced by Intel Corporation in 1981 which comes in 40
pin dual inline package (DIP).
It has 4KB of inbuilt ROM i.e onchip program space.
It has 128bytes of inbuilt RAM space and if required external memory of 64KB can be
interfaced to the microcontroller.

GSM based Motor Control


Page 16

There are 4 parallel 8bit ports namely port 0, port 1, port 2 and port 3 which are
addressable as well as programmable.
It has an onchip crystal oscillator with crystal frequency 11.0592MHz (~12MHz).
It has full duplex serial I/O port having two pins namely TxD, RxD.
It has two 16bit timers namely Timer 0 and Timer 1 which can be used either as timer for
internal operation or as counter for external operation.
It has five interrupt sources. All of them are maskable as well as vector interrupts. They
are External Interrupt 0, Timer Interrupt 0, External Interrupt 1, Timer Interrupt 1, Serial Port
Interrupt.
The programming mode of this microcontroller consists of general purpose registers
(GPRs),
Special Purpose Registers (SPRs) and Special Function Registers (SFRs).
GSM based Motor Control
Page 17

The instruction set of 8051 c consists of more number of bit manipulations or boolean
variable manipulation group of instructions. The instructions are very much useful to
manipulate SFR bits and also port pins.

Register and Internal RAM organization:

8051 c provides two 8bit general purpose registers A (Accumulatr) and B.


It provides 4 special purpose registers 16bit Program Counter (PC), 8bit Stack Pointer
(SP), 16bit Data Pointer and 8bit Program Status Word (PSW).

GSM based Motor Control


Page 18

It also provides few Special Function Registers. They are TMOD, TCON, IE, IP, SBUF,
SCON, PCON.
The 128bytes onchip RAM of 8051 c is divided into three portions as given below.
o 00H 1FH : These 32bytes are arranged as 4 register banks namely Bank 0, Bank
1,Bank 2, Bank 3 where each bank consists of 8 registers namely R0 through R7.
o 20H 2FH : These 16bytes (128bits) are made available as bit-addressible.bytes.
o 30H 7FH : These 80 bytes are available as scratch-pad RAM bytes.

3.5.2 IC Pin diagram

Fig 6 :Pin diagram of 8051

GSM based Motor Control


Page 19

Power - Vcc, Vss


Reset - RST
Crystal - XTAL[1,2]
External device interfacing EA, ALE, PSEN, WR, RD
I/O Port P0[7;0], P1[7:0], P2[7:0], P3
P3 is shared with control lines
Serial I/O RxD, TxD,
external interrupts INT0, INT1
Counter control T0, T1
P0 and P2 are multiplexed with Address and Data bus

3.5.3 Design considerations

3.5.4 BASIC CIRCUIT -THAT MAKES 8051 WORKS

GSM based Motor Control


Page 20

Fig 7 : Basic circuit of 8051


EA/VP Pin: The EA on pin 31 is tied high to make the 8051 executes program from Internal
ROM
Reset Circuit: RESET is an active High input When RESET is set to High,
8051 goes back to the power on state.The 8051 is reset by holding the RST high for at least
two machine cycles and then returning it low.
Power-On Reset
- Initially charging of capacitor makes RST High
- When capacitor charges fully it blo

GSM based Motor Control


Page 21

Manual reset -closing the switch momentarily will make RST High.
Oscillator Circuit
The 8051 uses the crystal for precisely that: to synchronize its operation.Effectively, the
8051 operates using what are called "machine cycles." A single machine cycle isthe
minimum amount of time in which a single 8051 instruction can be executed. although many
instructions take multiple cycles. 8051 has an on-chip oscillator. It needs an external crystal
thats decides the operating frequency of the 8051.
Fig 2.3:circuit for crystal and TTL oscillator

This can be done in two ways,


The

crystal

is

connected

to

pins

18

and

19

with

stabilizing

capacitors.12

MHz(11.059MHz) crystal is often used and the capacitance ranges from 20pF to 40pF. The
oscillator can also be a TTL clock source connected with a NOT gate as shown.
How fast 8051 works ?
A cycle is, in reality, 12 pulses of the crystal. That is to say, if an instruction takes one
machine cycle to execute, it will take 12 pulses of the crystal to execute. Since we know the
crystal is pulsing 11,059,000 times per second and that one machine cycle is 12 pulses, we can
calculate how many instruction cycles the 8051 can execute per second:
11,059,000 / 12 = 921,583
GSM based Motor Control
Page 22

Why is such an oddball crystal frequency?


11.0592 MHz crystals are often used because it can be divided to give you exact clock rates
for most of the common baud rates for the UART,especially for the higher speeds (9600,
19200). Despite the "oddball" value, these crystals are readily available and commonly used
Using Ports for I/O Operation
8051 is TTL logic device. TTL logic has two levels: Logic "High" (1) and logic "Low" (0).
The voltage and current involved for the two levels are as follows:

Lev
el

Volta
ge

Current

High

Above
2.4V

Virtually
current flow

Low

no

1.6mA
Sinking
current from TTL
Below OF MICRO CONTROLLER
FEATURES
input to ground
0.9V
(Depends on logic
8K Bytes of In-System
Programmable (ISP) Flash Memory
family)

Endurance: 1000 Write/Erase Cycles


4.0V to 5.5V Operating Range
256 x 8-bit Internal RAM
32 Programmable I/O Lines
Full Duplex UART Serial Channel

3.5.5.Pin Description
Port 0
GSM based Motor Control
Page 23

Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can
sink eight TTL inputs. When 1sare written to port 0 pins, the pins can be used as high
impedance inputs. Port 0 may also be configured to be the multiplexed low order
address/data bus during accesses to external program and data memory. In this mode P0 has
internal pullups.Port 0 also receives the code bytes during Flash programming, and outputs
the code bytes during program verification. External pull-ups are required during program
verification.
Port 1

Port 1 is an 8-bit bi-directional I/O port with internal pullups.The Port 1 output
buffers can sink/source four TTL inputs.When 1s are written to Port 1 pins they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are
externally being pulled low will sourcecurrent (IIL) because of the internal pullups.Port 1
also receives the low-order address bytes during Flash programming and verification.

Port 2

Port 2 is an 8-bit bi-directional I/O port with internal pull-ups.The Port 2 output
buffers can sink/source four TTL inputs.When 1s are written to Port 2 pins they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are
externally being pulled low will sourcecurrent (IIL) because of the internal pull-ups.
Port 3

Port 3 is an 8-bit bi-directional I/O port with internal pullups.The Port 3 output
buffers can sink/source four TTL inputs.When 1s are written to Port 3 pins they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are
externally being pulled low will sourcecurrent (IIL) because of the pull up port 3 also serves

GSM based Motor Control


Page 24

the functions of various special features of the AT89C51 as listed below: Port 3 also receives
some control signals for Flash programming and verification.
RST
Reset input. A high on this pin for two machine cycles whilethe oscillator is running
resets the device.
ALE/PROG
Address Latch Enable output pulse for latching the low byte of the address during
accesses to external memory. This pin is also the program pulse input (PROG) during
Flashprogramming.In normal operation ALE is emitted at a constant rate of 1/6the oscillator
frequency, and may be used for external timing or clocking purposes. Note, however, that one
ALE
PSEN
Program Store Enable is the read strobe to external programmemory.When the
AT89C51 is executing code from external program memory, PSEN is activated twice each
machine cycle, except that two PSEN activations are skipped during each access to external
data memory.
EA/VPP
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.Note,
however, that if lock bit 1 is programmed, EA will be internally latched on reset.EA should
be strapped to VCC for internal programexecutions.This pin also receives the 12-volt
programming enable voltage(VPP) during Flash programming, for parts that require12-volt
VPP.
XTAL1
GSM based Motor Control
Page 25

Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2
Generating the frequencies and Output from the inverting oscillator amplifier.
Oscillator & Clock Circuits:
The heart of the 8051 is the circuitry that generates the clock pulse by
which all internal operations are synchronized. Pins XTAL1 and XTAL2 are
provided for connecting a resonant network to form an oscillator. Typically, a
quartz crystal and capacitors are employed, as shown in Figure. The crystal
frequency is the basic internal clock frequency of the microcontroller. The
manufactures make available 8051 designs that can run at specified maximum
and minimum frequencies, typically 1 megahertz to 24 megahertz. Minimum
frequencies imply that some internal memories are dynamic and must always
operate above a minimum frequency or data will be lost.

3.6. MAX-232
Introduction
A standard serial interface for PC, RS232C, requires negative logic, i.e., logic 1 is -3V to
-12V and logic 0 is +3V to +12V. To convert TTL logic, say, TxD and RxD pins of the
microcontroller thus need a converter chip. A MAX232 chip has long been using in many
microcontrollers boards. It is a dual RS232 receiver / transmitter that meets all RS232
specifications while using only +5V power supply. It has two onboard charge pump voltage
converters which generate +10V to -10V power supplies from a single 5V supply. It has four
level translators, two of which are RS232 transmitters that convert TTL/CMOS input levels

GSM based Motor Control


Page 26

into +9V RS232 outputs. The other two level translators are RS232 receivers that convert
RS232 input to 5V.
Typical MAX232 circuit is shown below.

Fig 8: pin diagram of MAX232

Features of MAX 232:

Meets or exceeds TIA/EIA-232-F and ITU recommendation V.28.

Operates with a single 5V power supply with 1F Charge pump capacitors.

Operates up to 120 kbits/s.

Two drivers and two receivers.

30V input levels.

Low supply current. Typically 8mA.

ESD protection exceeds JESD 22 2000 V Human body model

GSM based Motor Control


Page 27

Circuit connections:
A standard serial interfacing for PC, RS232C, requires negative logic, i.e., logic '1' is -3V
to -12V and logic '0' is +3V to +12V. To convert TTL logic, say, TxD and RxD pins of the uC
chips thus need a converter chip. A MAX232 chip has long been using in many uC boards. It
provides 2-channel RS232C port and requires external 10uF capacitors. Carefully check the
polarity of capacitor when soldering the board. A DS275 however, no need external capacitor
and smaller. Either circuit can be used without any problems.

GSM based Motor Control


Page 28

The MAX232 from maxim was the first IC which in one package contains the necessary
drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic.
It became popular, because it just needs one voltage (+5V) and generates the necessary RS232 voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of
circuitry. Circuitry designers no longer need to design and build a power supply with three
voltages (e.g. -12V, +5V, and +12V), but could just provide one +5V power supply, e.g. with
the help of a simple 78x05 voltage converter.
RS 232
RS-232 (Recommended standard-232) is a standard interface approved by the
Electronic Industries Association (EIA) for connecting serial devices. In other words, RS-232
is a longestablished standard that describes the physical interface and protocol for relatively
low-speed serial data communication between computers and related devices. An industry
trade group, the Electronic Industries Association (EIA), defined it originally for
teletypewriter devices. In 1987, the EIA released a new version of the standard and changed
the name to EIA-232-D. Many people, however, still refer to the standard as RS-232C, or just
RS- 232. RS-232 is the interface that your computer uses to talk to and exchange data with
GSM based Motor Control
Page 29

your modem and other serial devices. The serial ports on most computers use a subset of the
RS- 232C standard.
RS232 on DB9 (9-pin D-type connector)

Figure: 9-Pin D-type connector


There is a standardized pinout for RS232 on a DB9 connector, as shown
below

3.6.2.Signal Description
GSM based Motor Control
Page 30

TxD: - This pin carries data from the computer to the serial device
RXD: - This pin carries data from the serial device to the computer
DTR signals: - DTR is used by the computer to signal that it is ready to communicate with
the serial device like modem. In other words, DTR indicates to the Dataset (i.e., the modem
or DSU/CSU) that the DTE (computer) is ON.

MAX 232
The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to
signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual
driver/receiver and typically converts the RX, TX, CTS and RTS signals .
A standard serial interface for PC, RS232C, requires negative logic, i.e., logic 1 is -3V
to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TxD and RxD pins of the
microcontroller thus need a converter chip. A MAX232 chip has long been using in many
microcontrollers boards.

Micro controller
This microcontroller had 128 bytes of RAM, 4K bytes of on-chip ROM, two timers, one
serial port, and four ports (each 8-bits wide) all on a single chip. At the time it was also
referred to as a "system on a chip." The 8051 is an 8-bit processor, meaning that the CPU can
work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces
to be processed by the CPU. The 8051 has a total of four I/O ports, each 8 bits wide
Limitations of RS-232
RS-232 has some serious shortcomings as an electrical interface.
Firstly, the interface presupposes a common ground between the DTE and DCE. This is a
reasonable assumption where a short cable connects a DTE and DCE in the same room, but
with longer lines and connections between devices that may be on different electrical busses,

GSM based Motor Control


Page 31

this may not be true. We have seen some spectacular electrical events causes by "uncommon
grounds".
Secondly, a signal on a single line is impossible to screen effectively for noise. By screening
the entire cable one can reduce the influence of outside noise, but internally generated noise
remains a problem. As the baud rate and line length increase, the effect of capacitance
between the cables introduces serious crosstalk until a point is reached where the data itself is
unreadable.
Using low capacitance cable can reduce crosstalk. Also, as it is the higher frequencies
that are the problem, control of slew rate in the signal (i.e., making the signal more rounded,
rather than square) also decreases the crosstalk. The original specifications for RS-232 had
no specification for maximum slew rate.
Voltage levels with respect to ground represent the RS 232 signals. There is a wire for each
signal, together with the ground signal (reference for voltage levels). This interface is useful
for point-to-point communication at slow speeds. For example, port COM1 in a PC can be
used for a mouse, port COM2 for a modem, etc. This is an example of point-to-point
communication: one port, one device. Due to the way the signals are connected, a common
ground is required. This implies limited cable length - about 30 to 60 meters maximum.
(Main problems are interference and resistance of the cable.) Shortly, RS 232 was designed
for communication of local devices, and supports one transmitter and receiver.

3.7. GSM MODEM


Global system for mobile communication (GSM) is a globally accepted
standard for digital cellular communication. GSM is the name of a standardization group
established in 1982 to create a common European mobile telephone standard that would
formulate specifications for a pan-European mobile cellular radio system operating at 900
MHz. It is estimated that many countries outside of Europe will join
partnership.

GSM based Motor Control


Page 32

the GSM

A GSM modem can be an external modem device, such as the Wavecom


FASTRACK Modem. Insert a GSM SIM card into this modem, and connect the modem
to an available serial port on your computer. A GSM modem can be a PC Card installed in
a notebook computer, such as the Nokia Card Phone. A GSM modem could also be a
standard GSM mobile phone with the appropriate cable and software driver to connect to
a serial port on your computer. Phones such as the Nokia 7110 with a DLR-3 cable, or
various Ericsson phones, are often used for this purpose.
A dedicated GSM modem (external or PC Card) is usually preferable to a
GSM mobile phone. This is because of some compatibility issues that can exist with
mobile phones. For example, if you wish to be able to receive inbound MMS messages
with your gateway, and you are using a mobile phone as your modem, you must utilize a
mobile phone that does not support WAP push or MMS. This is because the mobile phone
automatically processes these messages, without forwarding them via the modem
interface. Similarly some mobile phones will not allow you to correctly receive SMS text
messages longer than 160 bytes (known as concatenated SMS or long SMS). This is
because these long messages are actually sent as separate SMS messages, and the phone
attempts to reassemble the message before forwarding via the modem interface
When you install your GSM modem, or connect your GSM mobile phone to the
computer, be sure to install the appropriate Windows modem driver from the device
manufacturer. To simplify configuration, the Now SMS/MMS Gateway will communicate
with the device via this driver. An additional benefit of utilizing this driver is that you can
use Windows diagnostics to ensure that the modem is communicating properly with the
computer

GSM based Motor Control


Page 33

Fig 10: GSM modem


Now SMS/MMS gateway can simultaneously support multiple modems, provided
that your computer hardware has the available communications port resources
Global System for Mobile Communications (GSM) modems are specialized types of
modems that operate over subscription based wireless networks, similar to a mobile
phone. A GSM modem accepts a Subscriber Identity Module (SIM) card, and basically
acts like a mobile phone for a computer. Such a modem can even be a dedicated mobile
phone that the computer uses for GSM network capabilities. A GSM modem is a wireless
modem that works with a GSM wireless network. A wireless modem behaves like a dialup modem. The GSM modem can be an external device or a PC Card / PCMCIA Card.
Typically, an external GSM modem is connected to a computer through a serial cable or a
USB cable.
It is a
Most Popular Mobile Technology
Launch -1991by Radio linja in Finland
Frequencies - 900/1800MHz
Range Global
GSM based Motor Control
Page 34

Interface Subscriber Identity Module


Services SMS, MMS, GPRS, EDGE

3.7.1 AT Commands :
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. With the extended AT commands, you can do things like:
*

Reading, writing and deleting SMS messages.

* Sending SMS messages.


* Reading, writing and searching phone book entries.
AT commands features:
Line settings: A serial link handler is set with the following default values. Autobaud, 8
bits data, 1 stop bit, no parity, flow control.
Command line: Commands always start with AT (which means attention) and finish
with a <CR>character. .

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 (ASCII 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
(09,AF).
Syntax :Command syntax in text mode : AT+CMGS= <da> [ ,<toda> ] <CR>

GSM based Motor Control


Page 35

Delete message +CMGD


This command is used to delete one or several messages from preferred message
storage (BM SMS CB RAM storage, SM SMSPP storage SIM storage or SR SMS
Status-Report storage).
Syntax : Command syntax :AT+CMGD=<Index> [.<DelFlag>]

GSM based Motor Control


Page 36

3.8 Relay:
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 most have double throw
(changeover)
shown

in

switch contacts as
the

diagram.

Fig 11: Relay internal diagram

GSM based Motor Control


Page 37

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 coil of a relay passes a relatively large current, typically 30mA for a 12V relay,
but it can be as much as 100mA for relays designed to operate from lower voltages. Most ICs
(chips) cannot provide this current and a transistor is usually used to amplify the small IC
current to the larger value required for the relay coil. The maximum output current for the
popular 555 timer IC is 200mA so these devices can supply relay coils directly without
amplification.
Relays are usuallly SPDT or DPDT but they can have many more sets of switch
contacts, for example relays with 4 sets of changeover contacts are readily available. For
further information about switch contacts and the terms used to describe them please see the
page on switches. Most relays are designed for PCB mounting but you can solder wires
directly to the pins providing you take care to avoid melting the plastic case of the relay.
The supplier's catalogue should show you the relay's connections. The coil will be
obvious and it may be connected either way round. Relay coils produce brief high voltage
'spikes' when they are switched off and this can destroy transistors and ICs in the circuit. To
prevent damage you must connect a protection diode across the relay coil.
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. There is one set of contacts (SPDT) in the foreground and
another behind them, making the relay DPDT.
The relay's switch connections are usually labelled COM, NC and NO:

COM = Common, always connect to this, it is the moving part of the switch.

GSM based Motor Control


Page 38

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.

Protection diodes for relays


Transistors and ICs must be protected from the brief high voltage produced when a relay coil
is switched off. The diagram shows how a signal diode (eg 1N4148) is connec 'backwards'
across the relay coil to provide this protection.

Relays and transistors compared


Like relays, transistors can be used as an electrically operated switch. For switching
small DC currents (< 1A) at low voltage they are usually a better choice than a relay.
However, transistors cannot switch AC (such as mains electricity) and in simple circuits they
are not usually a good choice for switching large currents (> 5A). In these cases a relay will
be needed, but note that a low power transistor may still be needed to switch the current for
the relay's coil! The main advantages and disadvantages of relays are listed below:

Advantages of relays:

Relays can switch AC and DC, transistors can only switch DC.

Relays can switch higher voltages than standard transistors.

Relays are often a better choice for switching large currents (> 5A).

GSM based Motor Control


Page 39

Relays can switch many contacts at once.

Disadvantages of relays:

Relays are bulkier than transistors for switching small currents.

Relays cannot switch rapidly (except reed relays), transistors can switch many times
per second.

Relays use more power due to the current flowing through their coil.

Relays require more current than many ICs can provide, so a low power transistor
may be needed to switch the current for the relay's coil.

3.9 DC Motor:
The Motor Principle: when a current-carrying conductor is located in an
external magnetic field perpendicular to the conductor, the conductor experiences a force
perpendicular to itself and to the external magnetic field.
The right-hand rule for force on a conductor can be used to determine the direction
of the force experienced on the conductor: if the rightthumb points in the direction of the
current in the conductor and the fingers of the right hand point in the direction of the external
magnetic field, then the force on the conductor is directed
outward from the palm of the right hand.
The motor principle is used to form a precise definition of ampere. 1 ampere is the
amount of current flowing through two straight parallel conductors 1 meter apart in a vacuum
which produces a force 2 10-7 newtons per meter of conductor. Analog electric meters (i.e.,
galvanometers, ammeters, voltmeters) operate on the motor principle. Electric motors are an
important application of the motor principle. An electric motor consists of a permanent
external field magnet (stator) and a coiled conducting ammeter (rotor) which is free to rotate
GSM based Motor Control
Page 40

within the field magnet. Brushes and a commutator (designed differently if A.C. or D.C.
current is supplied to the armature) connect the armature to an external voltage source. The
speed of rotation of a motor depends on the amount of current flowing through it, the number
of coils on the armature, the strength of the field magnet, the permeability of the armature,
and the mechanical load connected to the shaft.
FIG 12: D.C Motor Internal diagram

Direct current (DC) motors are widely used to generate motion in a variety of
products. Permanent magnet DC (direct current) motors are enjoying increasing popularity in
applications requiring compact size, high torque, high efficiency, and low power
consumption.
In a brushed DC motor, the brushes make mechanical contact with a set of electrical
contacts provided on a commutator secured to an armature, forming an electrical circuit
between the DC electrical source and coil windings on the armature. As the armature rotates
on an axis, the stationary brushes come into contact with different sections of the rotating
commutator.

GSM based Motor Control


Page 41

Permanent magnet DC motors utilize two or more brushes contacting a commutator


which provides the direct current flow to the windings of the rotor, which in turn provide the
desired magnetic repulsion/attraction with the permanent magnets located around the
periphery of the motor.
The brushes are conventionally located in brush boxes and utilize a U-shaped spring
which biases the brush into contact with the commutator. Permanent magnet brushless dc
motors are widely used in a variety of applications due to their simplicity of design, high
efficiency, and low noise. These motors operate by electronic commutation of stator windings
rather than the conventional mechanical commutation accomplished by the pressing
engagement of brushes against a rotating commutator.
A brushless DC motor basically consists of a shaft, a rotor assembly equipped with
one or more permanent magnets arranged on the shaft, and a stator assembly which
incorporates a stator component and phase windings. Rotating magnetic fields are formed by
the currents applied to the coils.
The rotator is formed of at least one permanent magnet surrounded by the stator,
wherein the rotator rotates within the stator. Two bearings are mounted at an axial distance to
each other on the shaft to support the rotor assembly and stator assembly relative to each
other. To achieve electronic commutation, brushless dc motor designs usually include an
electronic controller for controlling the excitation of the stator windings.
The direct current (DC) motor is one of the first machines devised to convert
electrical power into mechanical power. Permanent magnet (PM) direct current convert
electrical energy into mechanical energy through the interaction of two magnetic fields. One
field is produced by a permanent magnet assembly, the other field is produced by an
electrical current flowing in the motor windings. These two fields result in a torque which
tends to rotate the rotor. As the rotor turns, the current in the windings is commutated to
produce a continuous torque output. The stationary electromagnetic field of the motor can

GSM based Motor Control


Page 42

also be wire-wound like the armature

or can be made up of permanent magnets.

In either style (wound-field or permanent magnet) the commutator. acts as half of a


mechanical switch and rotates with the armature as it turns. The commutator is composed of
conductive segments (called bars), usually made of copper, which represent the termination
of individual coils of wire distributed around the armature. The second half of the mechanical
switch is completed by the brushes. These brushes typically remain stationary with the
motor's housing but ride (or brush) on the rotating commutator. As electrical energy is passed
through the brushes and consequently through the armature a torsional force is generated as a
reaction between the motor's field and the armature causing the motor's armature to turn. As
the armature turns, the brushes switch to adjacent bars on the commutator. This switching
action transfers the electrical energy to an adjacent winding on the armature which in turn
perpetuates the torsional motion of the armature.

Permanent magnet (PM) motors are probably the most commonly used DC motors, but there
are also some other type of DC motors(types which use coils to make the permanent
magnetic field also) .DC motors operate from a direct current power source. Movement of
the magnetic field is achieved by switching current between coils within the motor. This
action is called "commutation". Very many DC motors (brush-type) have built-in
commutation, meaning that as the motor rotates, mechanical brushes automatically
commutate coils on the rotor. You can use dc-brush motors in a variety of applications. A
simple, permanent-magnet dc motor is an essential element in a variety of products, such as
toys, servo mechanisms, valve actuators, robots, and automotive electronics. There are
several typical advantages of a PM motor. When compared to AC or wound field DC motors,
PM motors are usually physically smaller in overall size and lighter for a given power rating.
Furthermore, since the motor's field, created by the permanent magnet, is constant, the
relationship between torque and speed is very linear. A PM motor can provide relatively high
torque at low speeds and PM field provides some inherent self-braking when power to the
GSM based Motor Control
Page 43

motor is shutoff. There are several disadvantages through, those being mostly being high
current during a stall condition and during instantaneous reversal. Those can damage some
motors or be problematic to control circuitry. Furthermore, some magnet materials can be
damaged when subjected to excessive heat and some loose field strength if the motor is
disassembled.
High-volume everyday items, such as hand drills and kitchen appliances, use a dc
servomotor known as a universal motor. Those universal motors are series-wound DC
motors, where the stationary and rotating coils are wires in series. Those motors can work
well on both AC and DC power. One of the drawbacks/precautions about series-wound DC
motors is that if they are unloaded, the only thing limiting their speed is the windage and
friction

losses.

Some

can

literally

tear

themselves

apart

if

run

unloaded.

A brushless motor operates much in the same way as a traditional brush motor.
However, as the name implies there are no brushes (and no commutator). The mechanical
switching function, implemented by the brush and commutator combination in a brush-type
motor, is replaced by electronic switching in a brushless motor. In a typical brushless motor
the electromagnetic field, created by permanent magnets, is the rotating member of the motor
and is called a rotor. The rotating magnetic field is generated with a number of
electromagnets commutatated with electronics switches (typically transistors or FETs) in a
right order at right speed. In a brushless motor, the trick becomes to know when to switch the
electrical energy in the windings to perpetuate the rotating motion. This is typically
accomplished in a brushless-type motor by some feedback means designed to provide an
indication of the position of the magnet poles on the rotor relative to the windings. A hall
effect device (HED) is a commonly used means for providing this positional feedback. In
some applications brushless motors are commutated without sensors or with the use of an
encoder for positional feedback. A brushless motor is often used when high reliability, long
life and high speeds are required. The bearings in a brushless motor usually become the only
parts to wear out. In applications where high speeds are required (usually above 30,000
RPM) a brushless motor is considered a better choice (because as motor speed increases so
does the wear of the brushes on traditional motors). A brushless motor's commutation control
can easily be separated and integrated into other required electronics, thereby improving the
GSM based Motor Control
Page 44

effective power-to-weight and/or power-to-volume ratio. A brushless motor package (motor


and commutation controller) will usually cost more than a brush-type, yet the cost can often
be made up in other advantages. For example, in applications where sophisticated control of
the motor's operation is required. Brushless motors are seen nowadays in very many
computer application, they for example rotate normal PC fans, hard disks and disk drives.
Sometimes the rotation direction needs to be changed. In normal permanent magnet
motors, this rotation is changed by changing the polarity of operating power (for example by
switching from negative power supply to positive or by inter-changing the power terminals
going to power supply). This direction changing is typically implemented using relay or a
circuit called an H bridge. There are some typical
characteristics on "brush-type" DC motors.

When a DC motor is straight to a battery (with no controller), it draws a large surge


current when connected up. The surge is caused because the motor, when it is turning, acts as
a generator. The generated voltage is directly proportional to the speed of the motor. The
current through the motor is controlled by the difference between the battery voltage and the
motor's generated voltage (otherwise called back EMF). When the motor is first connected up
to the battery (with no motor speed controller) there is no back EMF. So the current is
controlled only by the battery voltage, motor resistance (and inductance) and the battery
leads. Without any back emf the motor, before it starts to turn, therefore draws the large surge
current. When a motor speed controller is used, it varies the voltage fed to the motor.
Initially, at zero speed, the controller will feed no voltage to the motor, so no current flows.
As the motor speed controller's output voltage increases, the motor will start to turn. At first
the voltage fed to the motor is small, so the current is also small, and as the motor speed
controller's voltage rises, so too does the motor's back EMF. The result is that the initial
current surge is removed, acceleration is smooth and
fully under control.
GSM based Motor Control
Page 45

Motor speed control of DC motor is nothing new. A simplest method to control the
rotation speed of a DC motor is to control it's driving voltage. The higher the voltage is, the
higher speed the motor tries to reach. In many applications a simple voltage regulation would
cause lots of power loss on control circuit, so a pulse width modulation method (PWM)is
used in many DC motor controlling applications. In the basic Pulse Width Modulation
(PWM) method, the operating power to the motors is turned on and off to modulate the
current to the motor. The ratio of "on" time to "off" time is what determines the speed of the
motor. When doing PWM controlling, keep in mind that a motor is a low pass device. The
reason is that a motor is mainly a large inductor. It is not capable of passing high frequency
energy, and hence will not perform well using high frequencies. Reasonably low frequencies
are required, and then PWM techniques will work. Lower frequencies are generally better
than higher frequencies, but PWM stops being effective at too low a frequency. The idea that
a lower frequency PWM works better simply reflects that the "on" cycle needs to be pretty
wide before the motor will draw any current. A higher PWM frequency will work fine if you
hang a large capacitor across the motor or short the motor out on the "off" cycle The reason
for this is that short pulses will not allow much current to flow before being cut off. Then the
current that did flow is dissipated as an inductive kick - probably as heat through the fly-back
diodes. The capacitor integrates the pulse and provides a longer, but lower, current flow
through the motor after the driver is cut off. There is not inductive kick either, since the
current flow isn't being cut off. Knowing the low pass roll-off frequency of the motor helps to
determine an optimum frequency for operating PWM. Try testing your motor with a square
duty cycle using a variable frequency, and then observe the drop in torque as the frequency is
increased. This technique can help determine the roll off point as far as
power efficiency is concerned.

Besides "brush-type" DC motors, there is another DC motor type: brushless DC


motor. Brushless DC motors rely on the external power drive to perform the commutation of
GSM based Motor Control
Page 46

stationary copper winding on the stator. This changing stator field makes the permanent
magnet rotor to rotate. A brushless permanent magnet motor is the highest performing motor
in terms of torque / vs. weight or efficiency. Brushless motors are usually the most expensive
type of motor. Electronically commutated, brush-less DC motor systems are widely used as
drives for blowers and fans used in electronics, telecommunications and industrial equipment
applications. There is wide variety of different brush-less motors for various applications.
Some are designed to to rotate at constant speed and the speed of some can be controlled by
varying the voltage applied to them. Some brushless DC motors have a built-in tachometer
which gives out pulses as the motor rotates. In general, users select brush-type DC motors
when low system cost is a priority, and brushless motors to fulfill other requirements. Brush
type DC motors are used in very many battery powered appliances. Brushless DC motors are
commonly used in applications like DC powered fans and disk drive rotation motors.

3.10 LIQUID CRYSTAL DISPLAY(LCD):


GND

+5v VDD

15

16

2x16 Liquid Crystal Display


4

6
RSR/wwwwow
En

10 11

12 13 14

D0 0D6
D1 D2 D3 D4 D5 D6 D7
0
Figure 13 :.pin diagram of lcd

A liquid crystal display (LCD) is a thin, flat display device made up of any
number of color or monochrome pixels arrayed in front of a light source or reflector. Each
pixel consists of a column of liquid crystal molecules suspended between two transparent
GSM based Motor Control
Page 47

electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to each
other. Without the liquid crystals between them, light passing through one would be blocked
by the other.
FEATURES:
Display construction16 Characters * 2 Lines
BacklightLED(B/5.0V)
Viewing direction6 oclock
Operating temperature Indoor
Driving voltage Single power
Driving method1/16 duty,1/5 bias
Type COB (Chip On Board)
Number of data line8-bit parallel
Connector pin
PIN DESCRIPTION:

Fig 14:lcd internal connections

GSM based Motor Control


Page 48

This is basically a 2x16 lcd the type of LCD used here is of specification JHD 162A seriesIt
consists of 16 pins .each pin had its own purpose as explained below

CONTROL LINES:
EN:
Line is called "Enable." This control line is used to tell the LCD that you are sending it data.
To send data to the LCD bring EN high (1) and wait for the minimum amount of time
required by the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0)
again.
RS:
GSM based Motor Control
Page 49

Line is the "Register Select" line. When RS is low (0), the data is to be treated as a command
or special instruction (such as clear screen, position cursor, etc.). When RS is high (1), the
data being sent is text data which sould be displayed on the screen. For example, to display
the letter "T" on the screen you would set RS high.
RW:Line is the "Read/Write" control line. When RW is low (0), the information on the data
bus is being written to the LCD. When RW is high (1), the program is effectively querying
(or reading) the LCD. Only one instruction ("Get LCD status") is a read command

Vcc, Vss, VEE :


While Vcc and Vss provide +5v and ground, respectively, Vee is used for controlling
LCD contrast.
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.

3.11 CONCLUSION:
The block diagram of GSM based motor control is explained along with its
description including the hardware components used in the design of the system along with
their internal structures, IC pin diagrams, design considerations, circuit diagram and
description. Thus we can conclude that the hardware designing of the entire system is
explained.

GSM based Motor Control


Page 50

CHAPTER 4
SOFTWARE IMPLEMENTATION
4.1.INTRODUCTION
Embedded system is the combination of software and hardware. Through
software, the hardware is controlled. So the software has equal importance with the
hardware. In this project we used KEIL software for developing the code and proload for
dumping the source code in to the microcontroller. KIEL software develop the .c file and
then it adds some supporting files then iot is converted into execute file i.e .exe file. This
.exe file is converted into hex file before dumping into the microcontroller. For simulating
the circuit be used proteus software. In this software we have to draw schematic circuit
diagram and then the programme is dumped into the microcontroller. Thus through the
protous software we can easily simulate and the results are
The Keil 8052 compiler package includes uVision2 which is an Integrated
Development Environment (IDE) along with all the utilities you may need to create
embedded application programs for the MicroController family. Keil is a cross compiler. So

GSM based Motor Control


Page 51

first we have to understand the concept of compilers and cross compilers. After then we shall
learn how to work with keil.

Concept of compiler:
Compilers are programs used to convert a High Level Language to object code.
Desktop compilers produce an output object code for the underlying microprocessor, but not
for other microprocessors. I.E the programs written in one of the HLL like C will compile
the code to run on the system for a particular processor like x86 (underlying microprocessor
in the computer). For example compilers for Dos platform is different from the Compilers for
Unix platform
The advantage of interpreters is that they can execute a program immediately.
Secondly programs produced by compilers run much faster than the same programs executed
by an interpreter. However compilers require some time before an executable program
emerges. Now as compilers translate source code into object code, which is unique for each
type of computer, many compilers are available for the same language.

Working with keil:


To open keil software click on start menu then program and then select keil2 (or
any other version keil3 etc. here the discussion is on keil2 only). Following window will
appear on your screen.

GSM based Motor Control


Page 52

you can see three different windows in this screen. 1) project work space window 2) editing
window 3) output window.
Project workspace window is for showing all the related files connected with
your project. Editing window is the place where you will edit the codeOutput window will
show the output when you compile or build or run your project.
Now to start with new project follow the steps

click on project menu and select new project

you will be asked to create new project in specific directory

just move to your desired directory and there create a new folder for your project
named "first". Here I am creating new project in d:\keil2\myprojects\first as shown in
figure

GSM based Motor Control


Page 53

give the name of project as "test". By default it will be saved as *.v2 extension.

now you will be asked to chose your target device for which you want to write the
program.

scroll down the cursor and select generic from list. expand the list and select 8051 (all
variants)

when you click OK, you will be asked to add startup code and file to your project
folder. click yes. Now on your screen expand target1 list fully. You will see following
window.

GSM based Motor Control


Page 54

now click on file menu and select new file. editor window will open. Now you can
start writing your code.

as you start writing program in C, same way here also you have to first include the
header file. Because our target is 8051 our header file will be "reg51.h"

after including this file. just right click on the file and select open document
<reg51.h>. The following window will appear

GSM based Motor Control


Page 55

If you scroll down cursor you will see that all the SFRs like P0-P3, TCON, TMOD,
ACC, bit registers and byte registers are already defined in this header file. so one can
directly use these register names in coding

now you can write your program same as c language starting with void main()

After completing the code save the file in project folder with ".c" extension.

Now right click on "source group 1" in project workspace window. select "add files to
source group 1"

select the C file you have created and click add button

GSM based Motor Control


Page 56

you will see that the c file has been added in source group

Now to compile the program from project menu select "build target". In the output
window you will see the progress

If there is any compilation error then target will not be created. Remove all the errors
and again build the target till you find "0 Error(s)"

Now you are ready to run your program. from debug menu select "start/stop debug
session"

You will see your project workspace window now shows most of the SFRs as well as
GPRs r0-r7. Also one more window is now opened named "watches". in this window
you can see different variable values.

to add variable in watch window go to "watch#1" tab. then type F2 to edit and type
the name of your variable

If you want to see the output on ports go to peripheral menu and select I/O ports.
Select the desire port. you can give input to port pins by checking or unchecking any
check box. here the check mark means digit 1 and no check mark means 0. the output
on the pin will be shown in same manner

GSM based Motor Control


Page 57

to run the program you can use any of the option provided "go", "step by step", "step
forward", "step ove" etc.

now after testing your program you need to down load this program on your target
board that is 8051. for this you have to create hax file

to create hex file first stop debug session. Again you will be diverted to project
workspace window.

right click on "target 1" and select "option for target 1". Following window will
appear.

GSM based Motor Control


Page 58

select output tag and check "create hex file" box

now when you again build your program you will see the message in output window
"hex file is created".

in your project folder you can see the hex file with same name of your project as
"test.hex".

this file you can directly load in 8051 target board and run the application on actual
environment.

So here the procedure to create a project in keil for 8051 micro controller has been
described. To see some sample programs for 8051 in keil just go through the link "sample
programs in keil" so that you can get the idea how to write a program for 8051 in keil C.

GSM based Motor Control


Page 59

4.2 VARIOUS LOGICS USED


The various logics used in design of Voice Based Home Automation system are as follows.
Logic to interface an LCD to AT89C51 microcontroller
Logic to control the devices using microcontroller.
The logic that is used to interface the LCD includes LCD initialization, writing
data, a delay logic and setting of LCD commands.
The logic that is used to control the devices using the microcontroller checks
whether the spelled voice matches with the memory location in which the recorded voice is
stored. If matching occurs the corresponding device will be controlled.
4.2.1 LOGIC 1: Logic that is used to interface the LCD with the

microcontroller.

The logic that is used to interface the LCD with the microcontroller includes
LCD initialization initially and then the lcd is to be cleared, then the commands are set to set
the address of the display and then a delay function is used to generate some delay. As per the
command the display occurs. This is the logic that is used to interface the LCD to the
microcontroller.
4.2.2 LOGIC 2: Logic that is used to control the devices.
The logic that is used to control the devices using the microcontroller is
given with the memory locations in which the messages are stored. A conditional statement
while is used to check whether the sent message matches with the memory location in which
the messages are stored. If matching occurs the motor will be controlled.

GSM based Motor Control


Page 60

4.3) LOGIC 1:

The logic that is used to interface the LCD includes LCD initialization,
writing data, a delay logic and setting of LCD commands.
4.3.1) ALGORITHM:
The algorithm that shows LOGIC 1 is as shown below.
1. Start
2. Initialize the LCD
3. Clear the display
4. Set LCD address or command
5. Write character to the LCD or string to the LCD
6. Set command byte and data byte.
7. Set some delay using Delay function.
8. For RS low or high enable RS as low and enable write.
9. For EN low generate enable pulse.
10. For EN high pull up enable pulse.
11. For RW high set Read mode.
12. Configure Port 1 to Input port.
GSM based Motor Control
Page 61

13. Display the data.


14. End

4.3.2) FLOW CHART FOR LOGIC 1:

GSM based Motor Control


Page 62

Fig 15: Flow chart for logic 1

GSM based Motor Control


Page 63

Fig 15 Flow Chart of LCD interfacing with microcontroller

GSM based Motor Control


Page 64

4.3.3) SOURCE CODE:


Code for interfacing LCD with 8051 microcontroller.
//===============================================
//LCD PROTOTYPES
void Delay();
void lcd_init();

//lcd initialisation

void lcd_clear();

//clear display

void lcd_cmd(unsigned char);


void lcd_char(unsigned char);
void lcd_print(unsigned char *);
sbit RS=P3^7;

//set the lcd address or command


//write the character to LCD
//write the string to LCD
//RESET

sbit RW

=P3^4;

//READ/WRITE

sbit EN

=P3^6;

//ENABLE

#define

LCD P2

DATA7 TO P2
unsigned char i;
//===============================================
void Delay()
{
unsigned char i,j;
for(i=0;i<15;i++)
for(j=0;j<100;j++);
}
//===============================================
void lcd_init()
{
lcd_cmd(0x38);
lcd_cmd(0x01);
GSM based Motor Control
Page 65

//DATA0-

lcd_cmd(0x0C);
lcd_cmd(0x06);
lcd_cmd(0x80);
}
//===============================================
void lcd_clear(void)
{
lcd_cmd(0x01);
lcd_cmd(0x80);
}
//===============================================
//THIS IS THE FUNCTION FOR WRITE THE DATAS IN COMMAND REG
void lcd_cmd(unsigned char cmd)
{
Delay();
LCD

=cmd;

RS

=0;

RW

=0;

EN

=1;

for(i=0;i<200;i++);
EN

=0;

for(i=0;i<200;i++);
}
//===============================================
//THIS IS THE FUNCTION FOR DISPLAY THE CHARACTER ON LCD
void lcd_char(unsigned char ch)
{
LCD

=ch;

RS

=1;

RW

=0;

GSM based Motor Control


Page 66

EN

=1;

for(i=0;i<200;i++);
EN

=0;

for(i=0;i<200;i++);
}
//===============================================
//THIS IS THE FUNCTION FOR DISPLAY THE STRING ON LCD
void lcd_print(unsigned char *str)
{
while(*str!='\0')
{
LCD

=*str;

RS

=1;

RW

=0;

EN

=1;

Delay();
EN

=0;

str++;
}
}
4.3.4 DESCRIPTION:
The logic that is used to interface the LCD with the microcontroller includes
LCD initialization initially and then the lcd is to be cleared, then the commands are set to set
the address of the display and then a delay function is used to generate some delay. As per the
command the display occurs. Configure port 1 as input port. This is the logic that is used to
interface the LCD to the microcontroller. Thus the logic that is used to interface the LCD to
the microcontroller can be explained.

GSM based Motor Control


Page 67

4.4) LOGIC 2:
The logic that is used to control the devices using the microcontroller is given
with the memory locations in which the messages are stored. A conditional statement while is
used to check whether the sent message matches with the memory location in which the
messages are stored. If matching occurs the motor will be controlled.
4.4.1) ALGORITHM:
1. Start
2. Include the LCD source code to this code.
3. Assign MOTOR at P1.1.
4. Generate some delay using Delay Function.
5. Initially set MOTOR=0.
6. Print GSM based Motor Control on the LCD.
7. Generate some delay of 100ns using delay function.
8. While MOTOR = 1,clear the LCD and print MOTOR ON on the
LCD, Give some delay and go to start.
9. Check if MOTOR= 0 clear the LCD and print MOTOR OFF on the
LCD, Give some delay and go to start.
10. End

GSM based Motor Control


Page 68

FLOW CHARTFOR LOGIC 2:

GSM based Motor Control


Page 69

GSM based Motor Control


Page 70

Give some delay using delay function and the de

While
MOTOR=1

ret

MOTOR =1, Clear the display & m

Print MOTORON on on LC

While MOTOR=0

MOTOR =0, Clear the display & m

Print MOTOR OFF

End

GSM based Motor Control


Page 71

4.4.3) SOURCE CODE:


Code for Controlling of devices:
Code for controlling Start
the devices using microcontroller:
#include <AT89X51.H>
#include <LCD_8_BIT.H>
Include the LCD source code using header file.

#include <UART.H>
#include <GSM.H>

Assign MOTOR at P1.1


//===============================================

unsigned char interruptno[14]=0;


//===============================================

Generate some delay using delay function.

main()
{
Initially
set MOTOR = 0.
unsigned
char i,ch;

DEV1 = 0;
// DEV2 = 0;
uart_init();
Print GSM based Motor Control
lcd_init();
lcd_clear();
lcd_print("

GSM Based");

lcd_cmd(0xC0);
GSM based Motor Control
Page 72

lcd_print("Motor Control");
Delay1(400);
GSM_Init();
lcd_clear();
lcd_print("

GSM Based");

lcd_cmd(0xC0);
lcd_print("Motor Control");
Delay1(400);
while(1)
{
RI=0;
ch=0;
while(!RI);
RI=0;
for(i=0;i<13;i++)
{
while(!RI);
interruptno[i]=SBUF;
if(interruptno[i]=='M')
ch=1;
GSM based Motor Control
Page 73

RI=0;
}
if(ch)
{
while(!RI);
SlotNo=SBUF;
RI=0;
Readmessage();
}
}
}
//GSM..//
#include <string.H>
//===============================================
void GSM_init(void);
void Modem_send(unsigned char *);
void Readmessage(void);
void Delete_msg(void);
void sendbyte(unsigned char *);
void sendslot(unsigned char);
void compare(unsigned char *);
void send_sms(unsigned char *,unsigned char *);
//===============================================
unsigned char dat[8]=0;
GSM based Motor Control
Page 74

unsigned char number[14]=0;


unsigned char SlotNo;
//===============================================
sbit DEV1 = P1^1;
//===============================================
void Delay1(unsigned int itime)
{
unsigned int i,k=0;
for(i=0;i<itime;i++)
for(k=0;k<1000;k++);
}
//===============================================
void GSM_Init(void)
{
Modem_send("AT");
lcd_clear();
lcd_print("AT");
Delay1(100);
Modem_send("ATE0");
lcd_clear();
lcd_print("ATE0");
Delay1(100);
Modem_send("AT+CSMS=0");
lcd_clear();
lcd_print("AT+CSMS=0");
Delay1(100);
Modem_send("AT+IPR=9600");
lcd_clear();
lcd_print("AT+IPR=9600");
Delay1(100);
GSM based Motor Control
Page 75

Modem_send("AT+CMGF=1");
lcd_clear();
lcd_print("AT+CMGF=1");
Delay1(100);
Modem_send("AT&W");
lcd_clear();
lcd_print("AT&W");
Delay1(100);
Modem_send("AT+CNMI=2,1,0,0,0");
lcd_clear();
lcd_print("AT+CNMI=2,1,0,0,0");
Delay1(100);
lcd_clear();
lcd_print("GSM Initialized");
Delay1(100);
}
//===============================================
void Modem_send(unsigned char *ch)
{
unsigned char cha;
while(*ch)
{
SBUF = *ch;
while(TI == 0);
TI = 0;
ch++;
}
Enter();
TI = 0;
RI = 0;
GSM based Motor Control
Page 76

while(1)
{
while(RI == 0);
RI = 0;
cha = SBUF;
if(cha == 'O');
while(RI == 0);
RI = 0;
cha = SBUF;
if(cha == 'K')
break;
SBUF = 'A';
while(TI == 0);
TI = 0;
SBUF = '/';
while(TI == 0);
TI = 0;
}
TI = 0;
RI = 0;
}
//===============================================
void sendbyte(unsigned char *str)
{
while(*str!='\0')
{
SBUF=(*str++);
while(!TI);
TI=0;
GSM based Motor Control
Page 77

}
}
//===============================================
void sendslot(unsigned char slot)
{
SBUF=slot;
while(!TI);
TI=0;
}
//===============================================
void Readmessage(void)
{
unsigned char no=0;
unsigned char i,cha='X';
no=SlotNo;
lcd_clear();
lcd_print("Message Received");
Delay1(500);
lcd_clear();
lcd_print("SlotNo:");
lcd_char(no);
Delay1(500);
lcd_clear();
lcd_print("Message Reading");
Delay1(500);
sendbyte("AT+CMGR=");
sendslot(no);
Enter();
while(SBUF!=',')
GSM based Motor Control
Page 78

{
while(!RI);
RI=0;
}
while(SBUF!='+')
{
while(!RI);
RI=0;
}
for(i=0;i<12;i++)

// NUMBER READING

{
while(!RI);
number[i] = SBUF;
RI=0;
}
number[i] = '\0';
while(SBUF!='+')
{
while(!RI);
RI=0;
}
for(i=0;i<5;i++)
{
while(!RI);
RI=0;
}
for(i=0;i<8;i++)
{
GSM based Motor Control
Page 79

// MSG READING

while(!RI);
dat[i]=SBUF;
RI=0;
}
dat[i] = '\0';
lcd_clear();
lcd_print(number);
Delay1(600);
lcd_clear();
lcd_print(dat);
Delay1(600);
compare(dat);
Delete_msg();
}
//===============================================
void Delete_msg(void)
{
unsigned char cha = 'X';
unsigned char no;
no=SlotNo;
sendbyte("AT+CMGD=");
sendslot(SlotNo);
Enter();
while(1)
{
while(RI == 0);
cha = SBUF;
RI = 0;
if(cha == 'O');
while(RI == 0);
GSM based Motor Control
Page 80

cha = SBUF;
RI = 0;
if(cha=='K')
break;
SBUF = 'A';
while(TI == 0);
TI = 0;
SBUF = '/';
while(TI == 0);
TI = 0;
}
}
//===============================================
void compare(unsigned char *mesg)
{
if(!strcmp(mesg,"MOTOR ON"))
{
lcd_clear();
lcd_print("MOTOR ON");
DEV1=1;
send_sms("AT+CMGS=\"9505666395\"","Motor On");
Delay1(500);
}
else if(!strcmp(mesg,"MOTOROFF"))
{
lcd_clear();
lcd_print("MOTOR OFF");
DEV1=0;
send_sms("AT+CMGS=\"9505666395\"","Motor Off");
Delay1(500);
GSM based Motor Control
Page 81

}
else
{
lcd_clear();
lcd_print("Wrong Code");
send_sms("AT+CMGS=\"9505666395\"","Wrong Code");
Delay1(500);
}
}//===============================================
void send_sms(unsigned char *No,unsigned char *str)
{
unsigned char ch='X';
while(*No)
{
SBUF=*No;
while(TI==0);
TI=0;
No++;
}
Enter();
while(ch!='>')
{
while(RI==0);
ch=SBUF;
RI=0;
}
while(*str)
{
SBUF=*str;
GSM based Motor Control
Page 82

while(TI==0);
TI=0;
str++;
}
RI=0;
TI=0;
SBUF=0x1A;
while(TI==0);
TI=0;
RI=0;
}
//LCD..//
//===============================================
//LCD PROTOTYPES
void Delay();
void lcd_init();

//lcd initialisation

void lcd_clear();

//clear display

void lcd_cmd(unsigned char);


void lcd_char(unsigned char);
void lcd_print(unsigned char *);
sbit RS=P3^7;

//set the lcd address or command


//write the character to LCD
//write the string to LCD
//RESET

sbit RW

=P3^4;

//READ/WRITE

sbit EN

=P3^6;

//ENABLE

#define

LCD P2

DATA7 TO P2
unsigned char i;
//===============================================
void Delay()
{
GSM based Motor Control
Page 83

//DATA0-

unsigned char i,j;


for(i=0;i<15;i++)
for(j=0;j<100;j++);
}
//===============================================
void lcd_init()
{
lcd_cmd(0x38);
lcd_cmd(0x01);
lcd_cmd(0x0C);
lcd_cmd(0x06);
lcd_cmd(0x80);
}
void lcd_clear(void)
{
lcd_cmd(0x01);
lcd_cmd(0x80);
}
//THIS IS THE FUNCTION FOR WRITE THE DATAS IN COMMAND REG
void lcd_cmd(unsigned char cmd)
{
Delay();
LCD

=cmd;

RS

=0;

RW

=0;

EN

=1;

for(i=0;i<200;i++);
EN

=0;

for(i=0;i<200;i++);
}
GSM based Motor Control
Page 84

//THIS IS THE FUNCTION FOR DISPLAY THE CHARACTER ON LCD


void lcd_char(unsigned char ch)
{
LCD

=ch;

RS

=1;

RW

=0;

EN

=1;

for(i=0;i<200;i++);
EN

=0;

for(i=0;i<200;i++);
}
//THIS IS THE FUNCTION FOR DISPLAY THE STRING ON LCD
void lcd_print(unsigned char *str)
{
while(*str!='\0')
{
LCD

=*str;

RS

=1;

RW

=0;

EN

=1;

Delay();
EN

=0;

str++;
}
}
//UART..//

void uart_init(void)
{
SCON = 0x50;
GSM based Motor Control
Page 85

//Mode 1..8 bit data,..1 stop bit,..1 start bit

TMOD = 0x20;

//Timer 1....Mode 2...8 bit Auto Reload

TL1 = 0xFD;
TH1 = 0xFD;

//Baud Rate 9600

TR1 = 1;
}
void Enter(void)
{
SBUF = 0x0A;
while(TI == 0);
TI = 0;
SBUF = 0x0D;
while(TI == 0);
TI = 0;
}

4.4.4.DESCRIPTION:
The logic that is used to control the devices using the microcontroller is
given with the memory locations in which the messages are stored. A conditional statement
while is used to check whether the sent message matches with the memory location in which
the messages are stored. If matching occurs the motor will be controlled.
We control the motor by sending a message of MOTOR ON for switch on the
motor and MOTOR OFF for switch off the motor and getting status of the motor to owner of
the motor by placing the mobile number in the coding.
4.5) CONCLUSION:
The software development of Voice Based home Automation system is
designed along with the algorithms, flowcharts and source code with its description. Thus
software design of the system is explained.

GSM based Motor Control


Page 86

CHAPTER 5
RESULTS
5.1 INTRODUCTION:
Now a days use of human energy became very low as a technology increases.GSM
technology brought a revolution in human day to day life
GSM technology has been used for communication between the system and the
user. The user can control the operation of the devices connected to the controller from
anywhere in the world. It is possible by sending a text message in a predefined format to the
GSM modem, whenever the user sends a valid SMS to the GSM modem, it reads the
message. If the text message is in the predefined format then the appropriate action will be
taken by the microcontroller. GSM modem can be controlled by the standard set of AT
(Attention) commands.
The main aim of the project is to control the motor from anywhere in the world by
sending a message to the controller that is already stored in the controller, by comparing the
messages coming to the controller by string comparison concept used in embeddedc
language.this is the basic c language in embedded systems. In this process the controller
checks the message is MOTOR ON or MOTOR OFF. If motor=1 the motor will be on and
the motor=0 the motor will be off state. By doing this not only the motor any device we can
control by sending the message.

GSM based Motor Control


Page 87

5.2 CIRCUIT DIAGRAM

5.3.DESCRIPTION

Fig 17: Circuit diagram of project

The 8051 microcontroller is heart of the circuit. This miniproject works on the 8051 micro
controller. The main function of the 8051 micro controller is it controls the over all functions
of the circuit.It is a 40 pin DIP package.It has 4 ports namely port0,port1,port2,port3.Here we
are using two ports P2,P3.
GSM based Motor Control
Page 88

The other main module of the miniproject is GSM.GSM stands for Global
System for Mobile Communication.GSM module is a communication device.It requires 5V
DC power supply. A standard serial interface for PC, RS232C, requires negative logic, i.e.,
logic 1 is -3V to -12V and logic 0 is +3V to +12V. To convert TTL logic, say, TxD and RxD
pins of the microcontroller thus need a converter chip. A MAX232 chip has long been using
in many microcontrollers boards. Max-232 used for communicate our GSM module and
8051 controller.
The Motor Principle: when a current-carrying conductor is located in an external
magnetic field perpendicular to the conductor, conductor experiences a force perpendicular to
itself and to the external magnetic field.
Here we are using 5V power supply which is regulated from the 7805 voltage
regulator. Here we are using bridge rectifier, filter and regulator. Bridge rectifier is used for
converting A.C into pulsating D.C or it converts bidirectional current into uni directional
current. Filter is used for remove the a.c component present in the pulsating d.c. voltage
regulator is used for regulates the output voltage.
The LCD is used for the purpose of displaying the words which we are given in the
program code. This code will be executed on microcontroller chip. By following the
instructions in code the LCD display the related words.

GSM based Motor Control


Page 89

5.4.Photograph of Hardware Kit

GSM based Motor Control


Page 90

Fig 18 : Photograph of hardware kit

5.5.DESCRIPTION:
Now a days use of human energy became very low as a technology increases.GSM
technology brought a revolution in human day to day life
GSM technology has been used for communication between the system and the
user. The user can control the operation of the devices connected to the controller from
anywhere in the world. It is possible by sending a text message in a predefined format to the
GSM modem, whenever the user sends a valid SMS to the GSM modem, it reads the
message. If the text message is in the predefined format then the appropriate action will be
taken by the microcontroller. GSM modem can be controlled by the standard set of AT
(Attention) commands.
The main aim of the project is to control the motor from anywhere in the world by
sending a message to the controller that is already stored in the controller, by comparing the
messages coming to the controller by string comparison concept used in embeddedc
language.this is the basic c language in embedded systems. In this process the controller
checks the message is MOTOR ON or MOTOR OFF. If motor=1 the motor will be on and
the motor=0 the motor will be off state. By doing this not only the motor any device we can
control by sending the message.

GSM based Motor Control


Page 91

CHAPTER-6
CONCLUSION&FUTURE SCOPE TO WORK
6.1.CONCLUSION
Now a days use of human energy became very low as a technology increases.GSM
technology brought a revolution in human day to day life. This project is to control the motor
from anywhere in the world by sending a message to the controller that is already stored in
the controller, by comparing the messages coming to the controller by string comparison
concept used in embeddedc language.this is the basic c language in embedded systems. In
this process the controller checks the message is MOTOR ON or MOTOR OFF. If motor=1
the motor will be on and the motor=0 the motor will be off state. By doing this not only the
motor any device we can control by sending the message.

6.2. FUTURE SCOPE


In future we can implement automatic door opening and door locking system by
sending a message by using GSM technology.

GSM based Motor Control


Page 92

BIBLOGRAPHY
Reference Books:
The 8051 Microcontroller and Embedded Systems

-Muhammad Ali Mazidi

The 8051 Micro-controller

- Ayala

Programming and customizing the 8051

- Myke Predko

Websites:
www.atmel.com
www.analogicgroup.com
www.microcontroller.com
www.google.com
www.gsmworld.com

GSM based Motor Control


Page 93

APPENDIX

GSM based Motor Control


Page 94

GSM based Motor Control


Page 95

GSM based Motor Control


Page 96

GSM based Motor Control


Page 97

GSM based Motor Control


Page 98

GSM based Motor Control


Page 99

GSM based Motor Control


Page 100

Das könnte Ihnen auch gefallen