Professional Documents
Culture Documents
INTRODUCTION
Consider the basic electrical parameters. That electrical parameters are all
controlled by wired system but the recent trend the wireless communication is
replaced by wired system which was very messy and difficult to setup how ever,
the existing wireless system can cover up to certain range of area that is limited
by the range of wireless module being used. This paper introduces the
conceptual understanding and strategy of GSM standard to be deployed in any
environment. GSM will provide unlimited range of communication for the
system as long as there are intermediate nodes that will pass the data from one
node to another until it reaches the destination. Prototype systems of electrical
device switching are built utilizing GSM based sensor network to present an
insight for its practical implementation in smart home concept.
1
3.1 POWER SUPPLY SECTION
2
The transformer output is given to rectifier, where the AC signal is
converted into DC signal. Than the rectifier, output is given to filter because the
rectifier output has the noise signal. This noise signal is filtered by capacitor.
The capacitor output is given regulator IC, where the capacitor output voltage is
regulated and maintaining as constant voltage. This constant DC voltage is
supply to our component.
Power transformer:
Its job is either to step up or (mostly) step down the ac supply voltage to
suit the requirement at the solid-state electronic device and circuit fed by the DC
power supply. It also provides isolation from the supply line an important safety
consideration.
T1
1 5
230V,
single phase, 9V
4 8
AC supply
TRANSFORMER
3
The transformer selection not only depends on voltage. But current are taken to
be account there different circuit are used. They are transducer, microcontroller,
driver circuit, MAX 232 and relays. The transformer rates as 230-15V. The step-
down transformer rated as 230-15V, 1A.
3.1.3.Rectifier circuit: -
Here we are using full wave convectional type rectifier as shown in fig.
Filter (Capacitor filter): - +V
IN4001 IN4001
AC IN DC OUT
IN4001 IN4001
GND
4
capacitor voltage is not able to follow the charge as it can discharge only at a
rate determined by (CRL) time constant. In case of light load when (R L ) is large,
the capacitor would discharge only a little before the voltage in the ripple is
triangular in nature with the ripple constant being inversely proportional to (C )
& (RL ).
Ripple can be reduced by increasing (C ) for a given value of (R L ). For
heavy load when RL is small even a large capacitance value may not be able to
provide ripple within acceptable limits. Ripple factor (r ) can be expressed by
+V +V
1000/25V
GN GN
D D
3.1.4.Regulators: -
Its main function is to keep terminal voltage of the DC supply constant even
when AC input voltage to transformer varies
The power supply circuits suffer from the drawback that, their DC output
voltage changes with changes in load or input voltage. Such power supply is
called unregulated power supply. Regulated power supply can be obtained by
using a voltage regulator circuit. A regulator is an electronic control circuit,
which is capable of providing a nearly constant DC output voltage even when
5
these vary in load or input voltage. Regulators are of two types, linear &
switching regulator, which are also available in integrated circuit form.
IC Voltage Regulator: -
Current limiting
Self-protection against over temperature
Remote control operation over a wide range of
input voltage and feedback current Limiting.
Types of IC Regulators: -
Design: -
Vfixed = 5V
R1 = R2 = 1KΩ
IQ =2mA
Vout = 5+(5/1 + 5) * 1
Vout = 15V
1 3
+V IN LM7805 OUT VCC
GND
7
2
10/25V
GND GND
Fixed negative linear voltage regulator: -
Vout =5+((9+1)/1)
Vout =15V
8
Thus output voltage of IC 7905 regulator can be adjusted any
where between –5 to –15V. By using external resistances R 1 & R2 . The circuit
diagram is shown in fig.
1 3
+V IN LM7905 OUT VCC
GND
2
10/25V 0
GND GND
Power consumption
NAME OF
VOLT AMP POWER
CIRCUITS
Depending on Depending on
Micro controller +5V
I/O lines I/O lines
GSM module +12, +5V
MAX 232 +5V
CIRCUIT DIAGRAM
U1
LM7805C/TO220
1 3
IN OUT VCC
D1 D2
GND
9V 0V
2
0
C1 C2
D3 D4
GND
9
5.GSM (GLOBAL SYSTEM FOR MOBILES)
5.1 INTRODUCTON
Basic commands are AT commands that do not start with "+". For
example, D (Dial), A (Answer), H (Hook control) and O (Return to online data
state) are basic commands.
Extended commands are AT commands that start with "+". All
GSM AT commands are extended commands. For example, +CMGS (Send
SMS message), +CMGL (List SMS messages) and +CMGR (Read SMS
messages) are extended commands.
10
5.2Application Of GSM
CONNECTION DIAGRAM
Supply Input
The product requires AC supply of 9 V with 1 Amp current rating for
proper Operation.
GSM Serial
This RS 232 serial port can be connected to computer or any serial port
for communicating with the product using AT commands. Default Port Speed is
9600 bps.
11
BLOCK DIAGRAM:
12
4. MICROCONTROLLER 8051
4.1INTRODUCTION
8051
13
• 8051 contains four I/O ports (P0 - P3)
IMPORTANT PINS:
• PSEN (out): Program Store Enable, the read signal for external program
memory (active low).
• ALE (out): Address Latch Enable, to latch address outputs at Port0 and
Port2
• EA (in): External Access Enable, active low to access external program
memory locations 0 to 4K
• RXD,TXD: UART pins for serial I/O on Port 3
• XTAL1 & XTAL2: Crystal inputs for internal oscillator.
PORT DESCRIPTION:
Port 0: Port 0 is an 8-bit open drain bidirectional port. As an open drain
output port, it can sink eight LS TTL loads. Port 0 pins that have 1s written to
them float, and in that state will function as high impedance inputs. Port 0 is also
the multiplexed low-order address and data bus during accesses to external
memory. In this application it uses strong internal pull-ups when emitting 1s.
Port 0 emits code bytes during program verification. In this application, external
pull-ups are required.
Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. Port
1 pins that have 1s written to them are pulled high by the internal pull-ups, and
in that state can be used as inputs. As inputs, port 1 pins that are externally being
pulled low will source current because of the internal pull-ups.
14
Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pullups. Port
2 emits the high-order address byte during accesses to external memory that use
16-bit addresses. In this application, it uses the strong internal pullups when
emitting 1’s.
SIGNALS – OPERATION:
• Vcc(pin 40):
• GND(pin 20):ground
– power-on reset.
– active low.
The ALE pin is used for de-multiplexing the address and data by
connecting to the G pin of the 74LS373 latch.
16
Types of Memory
17
External code memory is program memory that resides off the chip. This
is often in the form of an external EPROM.
External RAM resides off-chip. This is often in the form of standard static
RAM or flash RAM.
Code Memory
This is the memory that holds the actual 8051 program. It is limited to
64K size. Code memory may be found on-chip, either burned into the
microcontroller as ROM or EPROM. Code may also be stored completely off-
chip in an external ROM or more commonly, an external EPROM. Flash RAM
is also another popular method of storing a program. Various combinations of
these memory types may also be used--that is to say, it is possible to have 4K of
code memory on-chip and 64k of code memory off-chip in an EPROM. When
the program is stored on-chip the 64K maximum is often reduced to 4k, 8k, or
16k. This varies depending on the version of the chip that is being used. Each
version offers specific capabilities and one of the distinguishing factors from
chip to chip is how much ROM/EPROM space the chip has.
External RAM
This refers to random access memory found off-chip. This memory has
slower access time than on-chip RAM. For example, to increment an Internal
RAM location by 1 requires only 1 instruction and 1 instruction cycle. To
increment a 1-byte value stored in External RAM requires 4 instructions and 7
instruction cycles. In this case, external memory is 7 times slower! While
Internal RAM is limited to 128 bytes (256 bytes with an 8052), the 8051
supports 64K external RAM.
18
registers exist in the address range of 80h through FFh. Each SFR has an address
(80h through FFh) and a name. The following table lists the symbols, names and
addresses of the 8051 SFRs.
Accumulator:
The Accumulator is used as a general register to accumulate the results of
a large number of instructions. It can hold an 8-bit (1-byte) value and is the most
versatile register the 8051 has due to the shear number of instructions that make
use of the accumulator. More than half of the 8051’s 255 instructions manipulate
or use the accumulator in some way.
For example, if you want to add the number 10 and 20, the resulting 30
will be stored in the Accumulator. Once you have a value in the Accumulator
you may continue processing the value or you may store it in another register or
in memory.
Auxiliary registers:
The auxiliary registers are a set of eight registers that are named R0, R1,
etc. up to R7.These registers are used in many operations. To continue with the
above example, perhaps you are adding 10 and 20. The original number 10 may
be stored in the Accumulator whereas the value 20 may be stored in, say,
register R4. To process the addition you would execute the command.
The Program Counter (PC) is a 2-byte address that tells the 8051 where
the next instruction to execute is found in memory. When the 8051 is initialized
PC always starts at 0000h and is incremented each time an instruction is
executed. It is important to note that PC isn’t always incremented by one. Since
some instructions require 2 or 3 bytes the PC will be incremented by 2 or 3 in
these cases. The Program Counter is special in that there is no way to directly
modify its value. That is to say, you can’t do something like PC=2430h. On the
19
other hand, if you execute LJMP 2340h you’ve effectively accomplished the
same thing.
The Stack Pointer, like all registers except DPTR and PC, may hold an 8-
bit (1-byte) value. The Stack Pointer is used to indicate where the next value to
be removed from the stack should be taken from. When you push a value onto
the stack, the 8051 first increments the value of SP and then stores the value at
the resulting memory location.
When you pop a value off the stack, the 8051 returns the value from the memory
location indicated by SP, and then decrements the value of SP. This order of
operation is important. When the 8051 is initialized, SP will be initialized to
07h. If you immediately push a value onto the stack, the value will be stored in
Internal RAM address 08h. First the 8051 will increment the value of SP (from
07h to 08h) and then will store the pushed value at that memory address (08h).
SP is modified directly by the 8051 by six instructions: PUSH, POP, ACALL,
LCALL, RET, and RETI. It is also used intrinsically whenever an interrupt is
triggered.
4.4 FEATURES:
20
3.2 EXTERNAL DRIVERS
The microcontroller generates the control signals for activate the relays.
But this signal is not sufficient to drive the relays. Because the microcontroller
I/O lines has 0.25mA for drive current only. But the drive relays required
100mA. So we have to use power booster circuit. This power booster circuit is
called as driver circuit. There are two types of driver circuits available. These are
called as voltage driver circuit and current driver circuit. Here the current driver
circuits are used.
3.2.1 ULN2803
3.2.1.1 INTRODUCTION
21
of lamps, relays, printer hammers or other similar loads for a broad range of
computer, industrial, and consumer applications. All devices feature open-
collector outputs and freewheeling clamp diodes for transient suppression. The
ULN2803 is designed to be compatible with standard TTL families while the
ULN2804 is optimized for 6 to 15volt high-level CMOS or PMOS.
3.2.1.2.PIN DIAGRAM:
22
3.2.1.3.OPERATON OF ULN 2803:
The output of the ULN2803 is "inverted". This means that a HIGH at the
input becomes a LOW at the corresponding output line. eg If the printer port line
connected to pin 1 goes HIGH, pin 18 on the ULN2803 will go LOW (switch
off).
To operate the ULN2803 board an external power supply (not exceeding
maximum ratings) needs to be connected to the +VIN connection terminal and
the positive terminal for the lamp. The negative terminal connects to the
channel. When the I/O 24 module the connection to the lamp activates the
channel will go low causing the lamp to turn on. The circuit can be modified to
activate relays, solenoids etc.
3.2.1.4.APPLICATIONS:
• Power Switching
• On/Off Control
• Home Automation
• Relays, Motors
• Solenoids, Solenoid valves
• Lamps etc
23
3.2.2 ULN2003
3.2.2.1 INTRODUCTION
The ULN2003 is a monolithic high voltage and high current Darlington
transistor arrays. It consists of seven NPN Darlington pairs that feature high-
voltage outputs with common-cathode clamp diode for switching inductive
loads. The collector-current rating of a single Darlington pair is 500mA. The
Darlington pairs may be paralleled for higher current capability. Applications
include relay drivers, hammer drivers, lamp drivers, display drivers (LED gas
discharge), line drivers, and logic buffers.
The ULN2003 has a 2.7kW series base resistor for each Darlington pair
for operation directly with TTL or 5V CMOS devices.
Ideally suited for interfacing between low-level logic circuitry and
multiple peripheral power loads, the Series ULN2003 high-voltage, high-current
Darlington arrays feature continuous load current ratings to 500 mA for each of
the seven drivers.
At an appropriate duty cycle depending on ambient temperature and
number of drivers turned ON simultaneously, typical power loads totaling over
230 W (350 mA x 7, 95 V) can be controlled. Typical loads include relays,
solenoids, stepping motors, magnetic print hammers, multiplexed LED and
incandescent displays, and heaters. All devices feature open-collector outputs
with integral clamp diodes. The ULN2003A/L and ULN2023A/L have series
input resistors selected for operation directly with 5 V TTL or CMOS.
These devices will handle numerous interface needs — particularly those
beyond the capabilities of standard logic buffers. The ULN2004A/L and
ULN2024A/L have series input resistors for operation directly from 6 to 15 V
CMOS or PMOS logic outputs.
24
The ULN2003A/L and ULN2004A/L are the standard Darlington arrays.
The outputs are capable of sinking 500 mA and will withstand at least 50 V in
the OFF state. Outputs may be paralleled for higher load current capability. The
ULN2023A/L and ULN2024A/L will withstand 95 V in the OFF state.
These Darlington arrays are furnished in 16-pin dual in-line plastic
packages (suffix “A”) and 16-lead surface-mountable SOICs (suffix “L”). All
devices are pinned with outputs opposite inputs to facilitate ease of circuit board
layout. All devices are rated for operation over the temperature range of -20°C to
+85°C. Most (see matrix, next page) are also available for operation to -40°C; to
order, change the prefix from “ULN” to “ULQ”.
25
LOGIC DIAGRAM:
3.2.2.3 OPERATION:
The output of microcontroller is not enough to drive the devices. So we
need some external drivers to drive the devices, that means the output current of
the microcontroller is 25mA, why we use this driver circuit means actually a
small dc motor current rating is 100mA .Here the ULN2003 is give the constant
current rating to the dc motor. The current rating level is 100mA. This
ULN2003 is used to drive up to 500mA level.
3.2.2.4 FEATURES:
500mA rated collector current (Single output)
High-voltage outputs: 50V
Inputs compatible with various types of logic.
Relay driver application.
Transient-Protected Outputs
26
Dual In-Line Plastic Package or Small-Outline IC Package.
3.3 RELAY SECTION
3.3.1 INTRODUCTION
27
energized, then the movement opens the contacts and breaks the connection,
and vice versa if the contacts were open.
When the current to the coil is switched off, the armature is returned by a
force, approximately half as strong as the magnetic force, to its relaxed position.
When a current flows through the coil, the resulting magnetic field attracts
an armature that is mechanically linked to a moving contact.
If the coil is energized with DC, a diode is frequently installed across the
coil, to dissipate the energy from the collapsing magnetic field at deactivation,
which would otherwise generate a spike of voltage and might cause damage to
circuit components. If the coil is designed to be energized with AC, a small
copper ring can be crimped to the end of the solenoid. This "shading ring"
creates a small out-of-phase current, which increases the minimum pull on the
armature during the AC cycle.
28
3.3.3 Applications
Isolate the controlling circuit from the controlled circuit when the
two are at different potentials, for example when controlling a
mains-powered device from a low-voltage switch. The latter is
often applied to control office lighting as the low voltage wires are
easily installed in partitions, which may be often moved as needs
change. Room occupancy detectors may also control them in an
effort to conserve energy,
29
8. PROGRAM:
#include<reg52.h>
#include<stdio.h>
#define FS 0x38 //Function Set: 8-bit, 2 Line, 5x7 Dots
#define DONCON 0x0E //Display on Cursor on
#define EM 0x06 //Entry Mode
#define DOFCOF 0x08 //Display Off Cursor Off (clearing display
without clearing DDRAM content)
#define DONCOF 0x0C //Display on Cursor off
#defineDONCB 0x0F //Display on Cursor blinking
#define SEDL 0x18 //Shift entire display left
#define SEDR 0x1C //Shift entire display right
#define MCLBOC 0x10 //Move cursor left by one character
#define MCRBOC 0x14 //Move cursor right by one character
#define CD 0x01 //Clear Display (also clear DDRAM
content)
sbit option1 = P2^7;
sbit option2 = P2^6;
sbit speed1 = P1^0;
sbit speed2 = P1^1;
sbit speed3 = P1^3;
sbit onoff = P2^5;
30
sbit lcd_rs = P3^5;
sbit lcd_rw = P3^6;
sbit lcd_en = P3^7;
void delay(unsigned long count);
void transmit_d(unsigned char *P);
void transmit(unsigned char *P);
void transmit1(unsigned char *P);
void introut(void);
unsigned char data serialdata;
unsigned char code att[]={"AT"};
unsigned char code setsms[]={"AT+CSMS=0"};
unsigned char code setmem[]={"AT+CPMS=\"SM\""};
unsigned char code setmod[]={"AT+CMGF=1"};
unsigned char code mes_indicate[]={"CMTI"};
//{"AT+CMGR=1"}; CMTI: "SM",2
unsigned char code read[]={"AT+CMGR=1"};
unsigned char code delet1[]={"AT+CMGD=1"};
unsigned char code delet2[]={"AT+CMGD=2"};
unsigned char code delet3[]={"AT+CMGD=3"};
unsigned char code l1on[]={"LT1ON"};
unsigned char code l1of[]={"LT1OF"};
unsigned char code l2on[]={"LT2ON"};
unsigned char code l2of[]={"LT2OF"};
unsigned char code spds[]={"SPDSL"};
unsigned char code spdm[]={"SPDME"};
unsigned char code spdo[]={"SPDOF"};
unsigned char code spdf[]={"SPDFA"};
unsigned char code low[]={" POWER TRIP DUE TO LOW VOLTAGE "};
unsigned char code high[]={" POWER TRIP DUE TO HIGH VOLTAGE "};
31
unsigned char code light1on[]={" YOUR LIGHT1 WAS ON "};
unsigned char code light1of[]={" YOUR LIGHT1 WAS OFF "};
unsigned char code light2on[]={" YOUR LIGHT2 WAS ON "};
unsigned char code light2of[]={" YOUR LIGHT2 WAS OFF "};
unsigned char code slow[]={" YOUR MOTOR RUNS IN 25 RPM "};
unsigned char code medium[]={" YOUR MOTOR RUNS IN 60 RPM "};
unsigned char code off[]={" YOUR MOTOR IS OFF "};
unsigned char code fast[]={" YOUR MOTOR RUNS IN 90 RPM "};
unsigned char code sendnum[]={"AT+CMGS=\"9790367571\""};
unsigned char data temp[30];
bit comp_bit=0;
unsigned char bit1=0;
unsigned char bit2=0;
unsigned char bit3=0;
int i,j;
unsigned char data z;
void transmit_d(unsigned char *p) //FUNCTION TO TRANSMIT DATA
{
unsigned char i;
TR1=1; // TIMER1 RUN
for(i=0;*p!='\0';i++)
{
SBUF=*p; // SEND THE ARRAY 'TEMP'
*p++;
while(TI==0)
{}
TI=0;
}
SBUF=0X0D; // INDICATE END OF COMMAND
32
TR1=0;
delay(4000);
}
void transmit1(unsigned char *p) // FUNCTION TO TRANSMIT DATA
{
unsigned char i;
TR1=1; // TIMER1 RUN
for(i=0;*p!='\0';i++)
{
SBUF=*p; // SEND THE ARRAY 'TEMP'
*p++;
while(TI==0)
{}
TI=0;
}
SBUF=0X1A; // INDICATE END OF MESSAGE 'ctrl+z'
TR1=0;
delay(4000);
}
void sendsms(void)
{
transmit_d(setsms);
transmit_d(setmod);
transmit_d(sendnum);
}
void sendsms1(void)
{
transmit_d(setsms);
transmit_d(setmod);
33
}
void delay(unsigned long count)
{
unsigned long int i;
for(i=0;i<count;i++);
}
void receive()
{
TR1=1;
while(RI==0) {}
serialdata=SBUF; // COPY TO 'serialdata'
RI=0; TR1=0;
}
void receive1(unsigned char n)
{
unsigned char i;
TR1=1;
for(i=0;i<n;i++)
{
while(RI==0) {}
temp[i]=SBUF; // COPY TO 'temp'
RI=0;
}
TR1=0;
temp[i]='\0';
}
void str_cpy(unsigned char *p,unsigned char *p1)
{
while(*p1!='\0')
34
{
*p=*p1;
*p++;*p1++;
}
p='\0';
}
str_comp(unsigned char *p,unsigned char *p1)
{
comp_bit=0;
while(*p1!='\0')
{
if(*p==*p1)comp_bit=1;
else
{
comp_bit=0;
break;
}
*p++;*p1++;
}
return (comp_bit);
} //char temp[25]= "LCD TEST PROGRAM SUCCESS";
void lcd_cmd (unsigned char value)
{ //lcd command
lcd_rs=0; lcd_rw=0; lcd_en=0;
P0 = value;
lcd_en=1;
delay(200);
lcd_en=0;
} // end of lcd_cmd
35
void lcd_dat (unsigned char value)
{ // send lcd data
lcd_rs=1; lcd_rw=0; lcd_en=0;
P0 = value;
lcd_en=1;
delay(200);
lcd_en=0;
} // end of lcd_dat
void init_lcd ()
{
/* following sequence is essential for initialization of lcd*/
lcd_cmd(FS);
delay(50);
lcd_cmd(FS);
delay(6);
lcd_cmd(FS);
delay(1500);
lcd_cmd(DOFCOF); //display off
lcd_cmd(DONCOF); //display on
lcd_cmd(EM); //entry mode set
} // end of init_lcd
36
lcd_dat(str[j]) ; // data to lcd
}
lcd_cmd(0xc0) ; // display on
for(j = 16 ; j < 32 ; j ++) // second line
{
lcd_dat(str[j]) ; // data to lcd
}
} // end of disp_lcd
/* You can copy all above functions and use it in your program as
demonstrated here */
/* end of LCD functions */
37
}
void main()
{
P1=0x00;
P2=0x00;
SP=0x40;
TMOD=0x20;
TH1=0xFD;
SCON=0x50;
TR1=1;
init_lcd() ; // initialize LCD
disp_lcd(" GSM BASED DEVICE CONTROL ") ; // display the string on LCD
delay(3000);
EX0 = 1;
EX1 = 1;
EA = 1;
transmit_d(att);transmit_d(att);
transmit_d(att);delay(5000);
transmit_d(delet1);delay(5000);
transmit_d(delet2);delay(5000);
speed3=0;speed2=0;speed1=0;
while(1)
{
transmit_d(att);
transmit_d(att);
transmit_d(delet1);delay(5000);
transmit_d(delet2);delay(5000);
receive();
while(serialdata!='+') receive();
38
receive1(5);
str_comp(temp,mes_indicate);delay(4000);
if(comp_bit==1)
{
delay(10000);
transmit_d(read);
receive();
while(serialdata!=0x0A) receive();receive();
while(serialdata!=0x0A) receive();
receive1(5);
delay(5000); transmit_d(temp);
str_comp(temp,l1on);
if(comp_bit==1)
{
option1=1;
disp_lcd(" DEVICE STATUS LIGHT1 WAS ON ") ;
// display the string on LCD
delay(3000);
sendsms(); transmit1(light1on); delay(10000);
}
else
{
str_comp(temp,l1of);
if(comp_bit==1)
{
option1=0;
disp_lcd(" DEVICE STATUS LIGHT1 WAS OFF ") ;
// display the string on LCD
delay(3000);
39
sendsms(); transmit1(light1of); delay(10000);
else
{
str_comp(temp,l2on);
if(comp_bit==1)
{
option2=1;
disp_lcd(" DEVICE STATUS LIGHT2 WAS ON ") ;
// display the string on LCD
delay(3000);
sendsms(); transmit1(light2on); delay(10000);
}
else
{
str_comp(temp,l2of);
if(comp_bit==1)
{
option2=0;
disp_lcd(" DEVICE STATUS LIGHT2 WAS OFF ") ;
// display the string on LCD
delay(3000);
sendsms(); transmit1(light2of); delay(10000);
}
else
{
40
str_comp(temp,spds);
if(comp_bit==1)
{
onoff=1;delay(500);
speed1=1;speed2=speed3=0;
disp_lcd(" SPEED STATUS 25 RPM ") ;
// display the string on LCD
delay(3000);
sendsms(); transmit1(slow); delay(10000);
}
else
{
str_comp(temp,spdo);
if(comp_bit==1)
{onoff=0;delay(500);
disp_lcd(" MOTOR OFF ") ; // display the string on LCD
delay(3000);
sendsms(); transmit1(off); delay(10000);
}
else
{
str_comp(temp,spdm);
if(comp_bit==1)
{
onoff=1;delay(500);
speed2=1;speed1=speed3=0;
disp_lcd(" SPEED STATUS 60 RPM");// display the string on LCD
delay(3000);
sendsms(); transmit1(medium); delay(10000);
41
}
else
{
str_comp(temp,spdf);
if(comp_bit==1)
{
onoff=1;delay(500);
speed3=1;speed2=speed1=0;
disp_lcd(" SPEED STATUS 90 RPM") ;//display the string on LCD
delay(3000);
sendsms(); transmit1(fast); delay(10000);
//sendsms1(); transmit1(fast); delay(10000);
}
} }}}}
delay(5000);
}
else
{
transmit_d(delet1);delay(5000);
transmit_d(delet2);delay(5000);
transmit_d(delet3);delay(5000);
}
}
}
42
6. LCD DISPLAY(Liquid Crystal Display)
DESCRIPTION
The JHD162A dot-matrix liquid crystal display controller and driver LSI
displays alphanumeric, and symbols. It can be configured to drive a dot-matrix
liquid crystal display under the control of a 4- or 8-bit microprocessor. Since all
the functions such as display RAM, character generator, and liquid crystal
driver, required for driving a dot-matrix liquid crystal display are internally
provided on one chip, a minimal system can be interfaced with this
controller/driver.
A single JHD162A can display up to one 8-character line or two 8-
character lines.
The JHD162A character generator ROM is extended to generate 208 5X8
dot character fonts and 32 5X10 dot character fonts for a total of 240 different
character fonts.
The low power supply (2.7V to 5.5V) of the JHD162A is suitable for any
portable battery-driven product requiring low power dissipation.
Features
5 x 8 and 5 x 10 dot matrix possible
Low power operation support:
2.7 to 5.5V
Wide range of liquid crystal display driver power
43
3.0 to 11V
Liquid crystal drive waveform
A (One line frequency AC waveform)
Correspond to high speed MPU bus interface
2 MHz (when VCC = 5V)
4-bit or 8-bit MPU interface enabled
80 x 8-bit display RAM (80 characters max.)
9,920-bit character generator ROM for a total of 240 character fonts
208 character fonts (5 x 8 dot)
32 character fonts (5 x 10 dot)
BLOCK DIAGRAM
DB0
DB7 LCD SEG80
DB7 CONTROLLER IC
RS
R/
WE
VSS COM16 LCD PANEL
VDD 16 CHARACTERS X 2 LINES
VO
Data can be written to the LCD only on the falling edge of the enable pin.
Thismeans that the data will displayed only after the enable pin is taken high and
then taken low. This must be repeated for each data or command that is sent to
the LCD.
44
It is necessary to use delays between sending each instruction. This is
necessary, since if the second instruction arrives while the first one is still being
executed, then the execution time will far exceed the normal execution time.
The LCD provides a busy flag, which indicates whether the LCD is busy
performing an operation or whether it is ready to accept instructions.
This method can be used instead of using delay loops, since delay provided is
random at most and not optimized.
PIN DETAILS:
Pin
Symbol Level Description
NO.
1 VSS 0V Ground
2 VDD 5.0V Supply voltage for logic
3 VO --- Input voltage for LCD
4 RS H/L H : Data, L : Instruction code
5 R/W H/L H : Read mode, L : Write mode
6 E H, H L Chip enable signal
7 DB0 H/L Data bit 0
8 DB1 H/L Data bit 1
9 DB2 H/L Data bit 2
10 DB3 H/L Data bit 3
11 DB4 H/L Data bit 4
12 DB5 H/L Data bit 5
13 DB6 H/L Data bit 6
14 DB7 H/L Data bit 7
15 NC --- No Connection
45
16 NC --- No Connection
INTERFACE PIN CONNECTIONS:
The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines.
The number on data lines depends on the mode of operation. If operated in 8-bit
mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if
operated in 4-bit more than 4 data lines + 3 control lines i.e. 7 lines are required.
How do we decide which mode to use? It’s simple if you have sufficient data
lines you can go for 8 bit mode & if there is a time constrain i.e. display should
be faster then we have to use 8-bit mode because basically 4-bit mode takes
twice as more time as compared to 8-bit mode.
When R/W is low (0), the information on the data bus is being written to
the LCD. When RW is high (1), the program is effectively reading from the
46
LCD. Most of the times there is no need to read from the LCD so this line can
directly be connected to Gnd thus saving one controller line.
The ENABLE pin is used to latch the data present on the data pins. A
HIGH - LOW signal is required to latch the data. The LCD interprets and
executes our command at the instant the EN line is brought low. If you never
bring EN low, your instruction will never be executed.
7. MAX232:
INTRODUCTION:
The MAX 232 is a dual RS-232 receiver/transmitter that meets all EAI
RS232c specifications whole using only a +5v power supply. It has 2 onboard
charge pump voltage converter which generate +10v and -10v power supplies
from a single 5v power supply. It has four level translators, two of which are
RS232 transmitters that converter TTL\CMOS input levels into +9V RS232
outputs. The other two level translators are RS232 receiver that convert RS232
inputs to 5V. TTL\CMOS output level. It is a serial communicating device it is
used to is the convert TTL Logic (Transistor Transistor Logic) to
CMOS(Complementary Metal-Oxide Semiconductor) Logic.
47
CAPACITOR VALUE
PIN.NO NAME PURPOSE SIGNAL VOLTAGE
OF MAX232
48
16 VCC Power supply +5V see above
49
9.PRINCIPLE OF OPERATION:
Our project consists of three sections the first section is ON/OFF
control, the second section is speed control and the last section is power tripping
circuit.
ON/OFF control and speed control are having individual unique code.
Here the working of power tripping circuit is depends upon the input voltage
level.
Actually we did this project in house hold application, so the normal input
voltage level is 230V. Whenever the input voltage level is crossing the limits,
below170V or above 250V that time the power tripping circuit is trip the total
power supply.
ON/OFF control and the speed control sections are controlled by sending
a sms through mobile phone by using GSM (Global System For Mobile)
communication. Here the GSM device is act as a transmitter/receiver circuit. It is
activated by external power supply.
One of the key features of GSM is the Subscriber Identity Module (SIM),
commonly known as a SIM card. The SIM is a detachable smart card containing
the user's subscription incodeion and phonebook. This allows the user to retain
his or her incodeion after switching handsets. Alternatively, the user can also
change operators while retaining the handset simply by changing the SIM.
50
Here the mobile phone and the GSM device are working in digital I/O.
Actually GSM device is working in ASCII and Hexa code. But the data’s are
transferred from mobile phone to GSM in ASCII code because of easy to
understand.
But the microcontroller is working in binary code. Here the binary code is
converted from ASCII code by GSM.
All the control operations have been done by predefined program which is
available in the microcontroller.
In this operation the sms will be transferred from mobile to GSM and GSM
to MICROCONTROLLER vice versa. Then the MICROCONTROLLER will
compare the status of received SMS with predefined program which has been
accumulated already. If both the unique codes are same the ON/OFF control will
be executed.
This section consists three types of speed controls (low, medium, high),
having individual unique codes. The sms will be passed from mobile phone to
GSM and then GSM will transfer it to MICROCONTROLLER. The
MICROCONTROLLER will compare the status of received SMS with
predefined program and speed control will be executed when the comparisons
are same.
51
10.CONCLUSION:
The main scope of this project is VERY innovative. Under present days
the electrical devices are controlled by using switches and remote control. It is
an attempt the electrical devices are controlled by sending a sms through
mobile phone by using GSM (Global service for mobile) communication device.
This is very useful to develop the knowledge about the communication devices.
So, we can implement this project in commercial purpose.
52
11. BIBLIOGRAPHY:
53