Anda di halaman 1dari 63

CONTENTS

1. INTRODUCTION

2. BLOCK DIAGRAM

3. WORKING PRINCIPLE

4. COMPONENTS REQUIRED

5. PROGRAM

6. PROCEDURE TO INSTALL KIEL SOFT WARE

7. ESTIMATED COST OF PROJECT

8. ADVANTAGES

9. DISADVANTAGES

10. APPLICATIONS

11. CONCLUSION

12. BIBLOGRAPHY
1.INTRODUCTION:

A transformer is a device which transfers electrical energy from one circuit to another
through inductively coupled conductors—the transformer's coils. A varying current in
the first or primary winding creates a varying magnetic flux in the transformer's core
and thus a varying magnetic field through the secondary winding. This varying
magnetic field induces a varying electromotive force (EMF) or "voltage" in the
secondary winding. This effect is called mutual induction.

If a load is connected to the secondary, an electric current will flow in the secondary
winding and electrical energy will be transferred from the primary circuit through the
transformer to the load. In an ideal transformer, the induced voltage in the secondary
winding (Vs) is in proportion to the primary voltage (Vp), and is given by the ratio of
the number of turns in the secondary (Ns) to the number of turns in the primary (Np)
as follows:

\FRAC{V_\TEXT{S}}{V_{\TEXT{P}}} = \FRAC{N_\TEXT{S}}{N_\TEXT{P}}

By appropriate selection of the ratio of turns, a transformer thus allows an alternating


current (AC) voltage to be "stepped up" by making Ns greater than Np, or "stepped
down" by making Ns less than Np.

Our project consists of the LCD-enabled applications where line engineer is alerted
on LCD when transformer shuts down. Each transformer is equipped with
microcontroller interfaced to central LCD control system. When any relay of
transformer is triggered, error message is shown on LCD display
2.BLOCK DIAGRAM:
3.WORKING PRINCIPLE:

All fault alert relays inside transformer are interfaced to microcontroller which in turn
is interfaced to GSM modem. When there is fault in transformer, relays inside
transformer are triggered, Microcontroller detects the triggered relay and SMS is sent
with fault description to line engineer.
4.COMPONENTS REQUIRED

HARDWARE REQUIRMENTS:

1. GSM modem.
2. 89c051 microcontroller.
3. 8051 PCB.
4. Interfacing buses (interfacing wires).
5. Ferric chloride (FeCl3) to make PCB.
6. Power Supply components.
7. IC programmer.
8. Relay
9. Windows PC.

SOFTWARE REQUIRMENTS:

1. Keil software.
2. Eagle software for PCB design
3. Flash magic to program microcontroller.

5.PROGRAM

#include <reg51.h>
#include "main"
#include "delay.c"
#include "lcd.c"
#include "i2c.c"
#include "gsm.c"
#include "ps2.c"

void main(void)
{
unsigned char k,error_message[10];
initApplication ();
while(1){
decodePs2KeyboardData();
if(relay1==0||relay2==0||relay3==0||relay4==0||relay5==0||relay6==0||
relay7==0||relay8==0){
if(relay1==0){
view_address=0;
}else if(relay2==0){
view_address=1;
}else if(relay3==0){
view_address=2;
}else if(relay4==0){
view_address=3;
}else if(relay5==0){
view_address=4;
}else if(relay6==0){
view_address=5;
}else if(relay7==0){
view_address=6;
}else if(relay8==0){
view_address=7;
}
IE=0x00;

recv_data_from_i2c(view_address*FILE_SIZE+RELAY_MESSAGE_ADDRE
SS,FILE_SIZE);
strncpy(error_message,rtc_recv_val,10);
recv_data_from_i2c(PHONE_NUMBER_COUNTER,1);
view_address=rtc_recv_val[0];
for(k=0;k<view_address;k++){
sending_sms=1;
recv_data_from_i2c(k*FILE_SIZE+PHONE_NUMBER_ADDRESS,FILE_SIZ
E);
strcpy(command,SEND_MESSAGE_AT_CMD);
strncat(command,rtc_recv_val,10);
strcat(command,"\"\r");
strncat(command,error_message,10);
sendGsmCommand(command);
SBUF=26;
}
lcd_clear();
lcd_string("SMS SENT");
del_5s();
IE=INTERRUPT;
}
}
}

void initApplication(){
TMOD=0x20;
TH1=0xFD;
TR1=1;
SCON=0x50;
TL1 = 0XFD;
RI=0;
IE=INTERRUPT;
TCON=0xFF;
lcd_init();
lcd_clear();
lcd_string("INITIALIZING GSM MODEM WAIT...");
ps2Keyboard_init();
sendGsmCommand(STOP_ECHO);
sendGsmCommand(RECIEVE_MESSAGE_AT_CMD);
lcd_clear();
lcd_string("TRANSFORMER FAULT ALERT SMS");
is_phone_number=0;
is_tab=0;
relay1=1;
relay2=1;
relay3=1;
relay4=1;
relay5=1;
relay6=1;
relay7=1;
relay8=1;
}

#include<string.h>
#include "ps2.h"

void ps2Keyboard_init(){
data_packet=0;
display_counter=0;
data_counter=0;
buffer_counter=0;
name_buffer_length=0;
packet_count_to_recieve=55;
KEYBOARD_CLK=1;
KEYBOARD_DATA=1;
}

void decodePs2KeyboardData(){
unsigned char k;

if(buffer_counter>display_counter){
if(buffer[display_counter]!=0xE0)
{
packet_count_to_recieve=33;
switch(buffer[display_counter])
{
case 0x66:
//lcd_string("BACK SPACE");
if(name_buffer_length!=0){
name_buffer_length--;
lcd_cmd(0x80+name_buffer_length);
lcd_data(' ');
lcd_cmd(0x80+name_buffer_length);
}
break;
case 0x0D:
//lcd_string("TAB");
lcd_clear();
if(is_tab==0 ||view_address==0){
is_tab=1;

recv_data_from_i2c(PHONE_NUMBER_COUNTER,1);
view_address=rtc_recv_val[0];
if(view_address==0){
lcd_string("NO PHONE NUMBERS EXIST");
break;
}
}
recv_data_from_i2c((view_address-
1)*FILE_SIZE+PHONE_NUMBER_ADDRESS,FILE_SIZE);
for(k=0;k<10;k++){
lcd_data(rtc_recv_val[k]);
}
view_address--;
break;
case 0x58:
//lcd_string("CAPS");
lcd_clear();
if(is_tab==1 ||view_address==0){
is_tab=0;
view_address =0;
}

recv_data_from_i2c(view_address*FILE_SIZE+RELAY_MESSAGE_ADDRE
SS,FILE_SIZE);
switch(view_address)
{
case 0:
lcd_string(" RELAY 1 ");
break;
case 1:
lcd_string(" RELAY 2 ");
Break;
case 2:
lcd_string(" RELAY 3 ");
break;
case 3:
lcd_string(" RELAY 4 ");
break;
case 4:
lcd_string(" RELAY 5 ");
break;
case 5:
lcd_string(" RELAY 6 ");
break;
case 6:
lcd_string(" RELAY 7 ");
break;
case 7:
lcd_string(" RELAY 8 ");
break;
case 8:
lcd_string(" RELAY 9 ");
break;
case 9:
lcd_string(" RELAY 10 ");
break;
case 10:
lcd_string(" RELAY 11 ");
break;
case 11:
lcd_string(" RELAY 12 ");
break;
case 12:
lcd_string(" RELAY 13 ");
break;
case 13:
lcd_string(" RELAY 14 ");
break;
case 14:
lcd_string(" RELAY 15 ");
break;
case 15:
lcd_string(" RELAY 16 ");
break;
}
lcd_nextline();
if(rtc_recv_val[0]==0){
lcd_string("NO ERROR MESSAGE");
}else{
for(k=0;k<10;k++){
lcd_data(rtc_recv_val[k]);
}
}
view_address++;
if(view_address>15){
view_address=0;
}
break;
case 0x76:
//lcd_string("ESC");
initApplication();
break;
case 0x05:
//lcd_string("F1");
lcd_clear();
lcd_string("PLEASE ENTER PHONE NUMBER");
name_buffer_length=0;
keybaord_data_length=10;
is_phone_number=1;
break;
case 0x06:
//lcd_string("F2");
view_address--;
lcd_clear();
lcd_string("ENTER MESSAGE FOR RELAY ");
lcd_display_bcd(view_address+1);
name_buffer_length=0;
keybaord_data_length=10;
is_phone_number=0;
resetBuffer();
break;
case 0x04
7.Keil uVision v 8.12 - C51 version - How to install
-----------------------------------------------------
1) Install Keil software with c51v812.exe
a) Press Next
b) Accept the license -> Next
c) Destination folder: C:\Keil -> Next
d) Fill the form with any name -> Next
e) Wait the installation
f) Finish

2) Copy the file l51.dll to the folder


C:\Keil\C51\BIN
Overwrite the existing l51.dll file

3) Execute uVision 3 from the Start Menu


Or the Desktop
Go to File -> License Management...
Copy the Computer ID field (CID)

6) Execute the license generator


licgen-v32.exe

7) In the MCU type, choose 51


In the right list, choose Prof. Developers Kit
In the bellow list, choose With computer ID code
Select the V2 item
Select External CID code
Paste the previously copied CID
Press Generate
Copy the generated LIC0= field
Ignore the SN= field

8) Go to the License Management of uVision


Paste the license generated with the licgen
in the New License ID Code (LIC) field
Press Add Lic
Press Close
9) Exit from uVision

10) Exit from license generator


11) Enjoy!
Micro controller AT89S52
The AT89C52 is a low-power, high-performance CMOS 8-bit
microcomputer with 8K bytes of Flash programmable and erasable read only
memory (PEROM). The on-chip Flash allows the program memory to be
reprogrammed in-system or by a Conventional nonvolatile memory
programmer.
FIGURE:PIN DISCRIPTION OF IC 89S52
Features:
• Compatible with MCS-51™ Products
• 8K Bytes of In-System Reprogrammable Flash Memory
• Endurance: 1,000 Write/Erase Cycles
• Fully Static Operation: 0 Hz to 24 MHz
• Three-level Program Memory Lock
• 256 x 8-bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-bit Timer/Counters
• Eight Interrupt Sources
• Full Duplex Serial port.
• On chip oscillator and clock circuitry.
• Low-power Idle and Power-down Modes.

Pin Description:

VCC - Supply voltage.

GND - Ground.

Port 0 - Port 0 is an 8-bit open drain bi-directional I/O port


pin 32 to 39

Port 1 - Port 1 is an 8-bit bi-directional I/O port with internal pullups


Pin no 1 to 8

Port 2 - Port 2 is an 8-bit bi-directional I/O port with internal pullups


Pin no 21 to 28
Port 3 - Port 3 is an 8-bit bi-directional I/O port with internal pullups
Pin no 10 to17.

RST - Reset input. A high on this pin for two machine cycles while the
oscillator is running resets the device.

ALE/PROG - Address Latch Enable is an 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 Flash programming.

PSEN - Program Store Enable is the read strobe to external program


memory. When the AT89C52 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. EA should be strapped to VCC
for internal program executions.

This pin also receives the 12-volt programming enable voltage (VPP)
during Flash programming when 12-volt programming is selected.
XTAL1 - Input to the inverting oscillator amplifier and input to the internal
clock operating circuit.

XTAL2 - Output from the inverting oscillator amplifier

AT89S52 MICROCONTROLLER

FEATURES :

> Internal Timers/Event Counters

> 2-Level Interrupt Priority Structure

> 32 I/O Lines (Four 8-Bit Ports)

> 64K Program Memory Space

> Security Features Protects EPROM Parts Against Software Piracy

> Boolean Processor

> Bit-Addressable RAM

> Programmable Full Duplex Serial Channel

> 111 Instructions (64 Single-Cycle)

> 64K Data Memory Space


Block Diagram of AT89S52
Internal Block Diagram of AT89S52
Types of Memory:

The 8051 has three very general types of memory. To effectively program the
8051 it is necessary to have a basic understanding of these memory types.
• On-Chip Memory refers to any memory (Code, RAM, or other) that
physically exists on the microcontroller itself. On-chip memory can be of
several types, but we'll get into that shortly.
• External Code Memory is code (or program) memory that resides off-
chip. This is often in the form of an external EPROM.
• External RAM is RAM memory that resides off-chip. This is often in the
form of standard static RAM or flash RAM.

FIGURE Memory Types


• Code Memory

Code memory is the memory that holds the actual 8051 program that is to
be run. This memory is limited to 64K and comes in many shapes and
sizes: Code memory may be found

• External RAM

As an obvious opposite of Internal RAM, the 8051 also supports


what is called External RAM. As the name suggests, External RAM is any
random access memory which is found off-chip.. 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! What External
RAM loses in speed and flexibility it gains in quantity. While Internal
RAM is limited to 128 bytes the 8051 supports External RAM up to 64K.

Microcontroller connection to RS232:


The microcontroller has two pins that are used specifically for transferring
and receiving data serially. These two pins are called TxD and RxD and are the
part of the port 3 group(P3.0 and P3.1).Pin 11 of 89S52 (P3.1) is assigned to
TxD and Pin 10(P3.0) is designated as RxD. These pins are TTL compatible;
therefore they require a line driver to make them RS232 compatible. One such
line driver is MAX232.
The MAX232 converts from RS232 voltage levels to TTL voltage levels,
and vice versa.One advantage of the MAX232 is that it uses a +5V power source
which is same as the source voltage for the 89S52.
Inside MAX 232

The T1in pin is the TTL side and is connected to TxD of the microcontroller,
while the T1out is the RS232 side that is connected to the RxD pin of the RS232
DB coonector.The R1in (pin 13)is the RS232 side that is connected to the TxD
pin of the RS232 DB-connector, and R1out (pin 12)is the TTL side that is
connected to the RxD pin of the microcontroller. MAX 232 requires 4 capacitors
ranging from 1 to 22 micro farad. The most widely used is 22 micro farad.
it’s connection to 89s52

Serial Pin outs (D25 and D9 Connectors)

MAX 232
The MAX232 is a dual driver/receiver that includes a capacitive voltage
generator to supply RS 232 voltage levels from a single 5V supply. Each
receiver converts RS 232 inputs to 5V TTL/CMOS levels. Each driver converts
TTL/CMOS input levels into RS 232 levels.
Pin out of MAX 232
FIGURE 2.8

Function Table for each driver Function Table for each


receiver

Input Output
Tin Tout
L H

H L
TABLE 2.6
Serial communication using MAX 232
FIGURE 2.9

Liquid Crystal Display


In recent years the LCD is finding widespread use replacing LEDs This
is due to following reasons
1) The declining prices of LCDs
2) The ability to display numbers, characters and graphics. This is in contrast
to LEDs, which are limited to numbers and few characters.
3) Incorporation of a refreshing controller in to LCD, there by relieving the
CPU of the task of refreshing the LCD. In contrast LCD must be
refreshed by CPU to keep displaying the data.

LCD display

The internal structure of LCD module:


LCD is connected to the microcontroller through the controller
interface. LCD has an internal memory which stores the lookup table for all the
characters. Any ASCII value of a character that is passed to the LCD module is
compared with the lookup table in the memory and that value is displayed
Internal structure of LCD module.
Interfacing LCD with microcontroller
Interfacing LCD with microcontroller is very easy task. You just have to
know the proper LCD programming algorithm. LCD used here has HD44780u
dot matrix LCD controller. LCD module has 8-bit data interface and control
pins. One can send data as 8-bit or in pair of two 4-bit nibbles.

To display any character on LCD micro controller has to send its ASCII
value to the data bus of LCD. For e.g. to display 'AB' microcontroller has to
send two hex bytes 41h and 42h respectively. LCD display used here is having
16x2 size. It means 2 lines each with 16 characters.
Internal block diagram

FIGURE 2.6
Internal Block Diagram of LM 7805

Pin out of LM 7805 (TO – 220 PACKAGE)

1. INPUT

2. GROUND

3. OUTPUT

FIGURE 2.7
SOFTWARE REQUERMENT
Introduction to keil µVision3
The µVision3 IDE is a Windows-based software development platform
that combines a robust editor, project manager, and make facility. µVision3
integrates all tools including the C compiler, macro assembler, linker/locator,
and HEX file generator. The µVision3 IDE offers numerous features and
advantages that help you quickly and successfully develop embedded
applications. They are easy to use and are guaranteed to help you achieve your
design goals.
Features
1) The µVision3 Simulator is the only debugger that completely simulates all

on-chip peripherals.
2) Simulation capabilities may be expanded using the Advanced Simulation
Interface (AGSI).
3) µVision3 incorporates project manager, editor, and debugger in a single
environment.
4) The µVision3 Device Database automatically configures the development
tools for the target microcontroller.
5) The µVision3 IDE integrates additional third-party tools like VCS, CASE,
and FLASH/Device Programming.
6) The ULINK USB-JTAG Adapter supports both Debugging and Flash
programming with configurable algorithm files.
7) Identical Target Debugger and Simulator User Interface.
8) The Code Coverage feature of the µVision3 Simulator provides statistical
analysis of your program's execution.

Embedded C:

When designing software for a smaller embedded system with the 8051, it
is very common place to develop the entire product using assembly code. With
many projects, this is a feasible approach since the amount of code that must be
generated is typically less than 8 kilobytes and is relatively simple in nature. If a
hardware engineer is tasked with designing both the hardware and the software,
he or she will frequently be tempted to write the software in assembly language.

POWER SUPPLY UNIT


The circuit needs two different voltages, +5V & +12V, to work.
These dual voltages are supplied by this specially designed power supply. [6]
The power supply, unsung hero of every electronic circuit, plays very
important role in smooth running of the connected circuit. The main object of
this ‘power supply’ is, as the name itself implies, to deliver the required amount
of stabilized and pure power to the circuit.
The stabilization of DC output is achieved by using the three terminal
voltage regulator IC. This regulator IC comes in two flavors: 78xx for positive
voltage output and 79xx for negative voltage output. For example 7812 gives
+12V output and 7912 gives -12V stabilized output. These regulator ICs have
in-built short-circuit protection and auto-thermal cutout provisions. If the load
KIA 78xx
Series

1 2 3
current is very high the IC needs ‘heat sink’ to dissipate the internally generated
power. [6]

Fig 3.1: Voltage Regulator IC


KIA 78xx
REGULATED POWER S CIRCUIT DIAGRAM OF
+5V & +12V FULL WAVE UPPLY
IC1 IC1
7812 780 +12V
D 5
1
1 9
V
A C D E +5V

C C
C C
2 3
1 4

D
2
1

COMPONENTS LIST
SEMICONDUCTORS
IC1 7812 Regulator IC 1
IC2 7805 Regulator IC 1
D1& D2 1N4007 Rectifier Diodes 2

CAPACITORS
C1 1000 µf/25V Electrolytic 1
C2 to C4 0.1µF Ceramic Disc type 3

MISCELLANEOUS
X1 230V AC Pri,14-0-14 1Amp Sec Transformer 1

CIRCUIT DESCRIPTION
A DC power supply which maintains the output voltage constant
irrespective of AC. mains fluctuations or load variations is known as regulated
DC. power supply. It is also referred as full-wave regulated power.
Supply as it uses two diodes with the transformer. This laboratory power supply
offers excellent line and load regulation and output voltages of +5V & +12 V at
output currents up to one ampere.
1. Step-down Transformer: The transformer rating is 230V AC at Primary
and 12-0-12V, 1Ampers across secondary winding. This transformer has a
capability to deliver a current of 1Ampere, which is more than enough to drive
any electronic circuit or varying load. The 12VAC appearing across the
secondary is the RMS value of the waveform and the peak value would be 12 x
1.414 = 16.8 volts. This value limits our choice of rectifier diode as 1N4007,
which is having PIV rating more than 16Volts [6]
2. Rectifier Stage: The two diodes D1 & D2 are connected across the
secondary winding of the transformer as a full-wave rectifier. During the
positive half-cycle of secondary voltage, the end A of the secondary winding
becomes positive and end B negative. This makes the diode D1 forward biased
and diode D2 reverse biased. Therefore diode D1 conducts while diode D2 does
not. During the negative half-cycle, end A of the secondary winding becomes
negative and end B positive. Therefore diode D2 conducts while diode D1 does
not. Note that current across the centre tap terminal is in the same direction for
both half-cycles of input AC. voltage. Therefore, pulsating DC. Is obtained at
point ‘C’ with respect to Ground.[6]
3. Filter Stage: Here Capacitor C1 is used for filtering purpose and connected
across the rectifier output. It filters the AC. components present in the rectified
DC. and gives steady DC. voltage. As the rectifier voltage increases, it charges
the capacitor and also supplies current to the load. When capacitor is charged to
the peak value of the rectifier voltage, rectifier voltage starts to decrease. As the
next voltage peak immediately recharges the capacitor, the discharge period is of
very small duration. Due to this continuous charge-discharge-recharge cycle
very little ripple is observed in the filtered output. Moreover, output voltage is
higher as it remains substantially near the peak value of rectifier output voltage.
This phenomenon is also explained in other form as: the shunt capacitor offers a
low reactance path to the AC. components of current and open circuit to DC.
component. During positive half cycle the capacitor stores energy in the form of
electrostatic field. During negative half cycle, the filter capacitor releases stored
energy to the load.
4. Voltage Regulation Stage: Across the point ‘D’ and Ground there is
rectified and filtered DC. In the present circuit KIA 7812 three terminal voltage
regulator IC is used to get +12V and KIA 7805 voltage regulator IC is used to
get +5V regulated DC. output. In the three terminals, pin 1 is input i.e., rectified
& filtered DC. is connected to this pin. Pin 2 is common pin and is grounded.
The pin 3 gives the stabilized DC. output to the load. The circuit shows two
more decoupling capacitors C2 & C3, which provides ground path to the high
frequency noise signals. Across the point ‘E’ and ‘F’ with respect to ground +5V
& +12V stabilized or regulated DC output is measured, which can be connected
to the required circuit.[6]
BUFFER AND DRIVER

BUFFER CIRCUIT

The BUFFER IC used is IC 4050 which is a voltage amplifier; its a non-


inverting buffer. A buffer doesn’t change the logical state and it also provides
an extra voltage drive.
This 16-pin DIL packaged IC 4050
IC4050
Acts as Buffer as-well-as a Converter. The 1
Vcc 16

input signals may be of 2.5 to 5V digital 2 15

TTL compatible or DC analogue the IC 3 14

gives constant output voltage. The IC acts as


4 13
buffer and provides isolation to the main
5 12
circuit from varying input signals. Here the IC
is use to increase the voltage. It acts as a 6 11

voltage amplifier. 7 10

8 Vss 9

DRIVER CIRCUIT
The driver circuit is used to enhance the current handling capacity in the circuit.
Moreover its acts as a driving circuit for the relays. The IC ULN 2004 is used,
this IC consist of an array of emitter-follower circuits.

Fig 3.4: Basic Darlington Pair Circuit


Normally to turn on a transistor the base input voltage of the transistor
will need to be greater that 0.7V. As two transistors are used in Darlington Pair
this value is doubled. Therefore the base voltage will need to be greater than
0.7V x 2 = 1.4V. [8]
The output current Ic = total gain (β) * input current.
The DRIVER IC used is ULN 2004. [8]
PIN DESCRIPTION

The UTC ULN2004 are high-voltage, high-current Darlington drivers comprised


of NPN Darlington pairs. All units feature integral clamp diodes for switching
inductive loads. Applications include relay, hammer, lamp and display (LED)
drivers. [9]

3.2.4 FEATURES OF IC ULN2004

• Output current (single output): 500mA (MAX.)


• High sustaining voltage output: 50V (MIN.)
• Output clamp diodes
• Inputs compatible with various types of logic. [9]

CIRCUIT DIAGRAM OF BUFFER


+ AND DRIVER CIRCUIT
I 1 I
C C
1
2 2
+V V
4 D1 v C 2 N N N N
CC 0 1N / /
1 5 V C 9 0 / /
O
414 O
3 20 10 O O
N N N
8 1 64 N
/ / /
6 1 /
5 4 2 C C C
I 5 C
7 6 1
3C 4
1 11
9 0 4 32
1
1
2 U
5
1
1
1 1 L 12
From RF/IR 4 5 N 1
8
Receiver stage G
N 2
D 0
0
4
Fig 3.7: Circuit Diagram of Buffer and Driver
RELAYS

INTRODUCTION

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


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

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


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

The 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 usually 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. 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 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.

Figure 6.2 Relay showing coil and switches


The relay's switch connections are usually labeled COM, NC and NO:

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

switch.
 NC = Normally Closed, COM is connected to this when the relay coil

is off.
 NO = Normally Open, COM is connected to this when the relay coil

is on.
 Connect to COM and NO if you want the switched circuit to be on

when the relay coil is on.


 Connect to COM and NC if you want the switched circuit to be on

when the relay coil is off.

CHOOSING A RELAY

 Physical size and pin arrangement : If you are choosing a relay for

an existing PCB you will need to ensure that its dimensions and pin
arrangement are suitable.
 Coil voltage : The relay's coil voltage rating and resistance must suit

the circuit powering the relay coil. Many relays have a coil rated for a
12V supply but 5V and 24V relays are also readily available. Some
relays operate perfectly well with a supply voltage which is a little
lower than their rated value.
 Coil resistance: The circuit must be able to supply the current

required by the relay coil. You can use Ohm's law to calculate the
current: Relay coil current = supply voltage / coil resistance

The relay's switch connections are usually labeled COM, NC and NO:

• COM = Common, always connect to this; it is the moving part of the


switch.
• NC = Normally Closed, COM is connected to this when the relay coil is off.
• NO = Normally Open, COM is connected to this when the relay coil
is on.

Figure 3.14: Circuit Symbol of Relay

• 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.
We need to consider several features when choosing a relay:
• Physical size and pin arrangement
If you are choosing a relay for an existing PCB you will need to
ensure that its dimensions and pin arrangement are suitable. You should find
this information in the supplier's catalogue.

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
or high voltages (such as mains electricity) and they are not usually a good
choice for switching large currents (> 5A).
Advantages of relays:
• Relays can switch AC and DC, transistors can only switch DC.
• Relays can switch high voltages, transistors cannot.
• Relays are a better choice for switching large currents (> 5A).
• 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.
GSM (GLOBAL SYSTEM FOR MOBILE
COMMUNICATION)

TECHNICAL DETAILS

Global System for Mobile communications is the most popular


standard for mobile phones in the world. Its promoter, the GSM Association,
estimate that 82% of the global mobile market uses the standard. GSM is
used by over 2 billion people across more than 212 countries and territories.
Its ubiquity makes international roaming very common between mobile
phone operators, enabling subscribers to use their phones in many parts of
the world.

GSM has used a variety of voice codecs to squeeze 3.1 kHz audio into
between 5.6 and 13 kbit/s. Originally, two codecs, named after the types of
data channel they were allocated, were used, called Half Rate (5.6 kbit/s)
and Full Rate (13 kbit/s). These used a system based upon linear predictive
coding (LPC). In addition to being efficient with bit rates, these codecs also
made it easier to identify more important parts of the audio, allowing the air
interface layer to prioritize and better protect these parts of the signal.

The modulation used in GSM is Gaussian minimum-shift keying (GMSK), a


kind of continuous-phase frequency shift keying. In GMSK, the signal to be
modulated onto the carrier is first smoothed with a Gaussian low-pass filter
prior to being fed to a frequency modulator, which greatly reduces the
interference to neighboring channels (adjacent channel interference).
SUBSCRIBER IDENTITY MODULE (SIM)

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 information and phonebook. This allows
the user to retain his or her information after switching handsets.
Alternatively, the user can also change operators while retaining the handset
simply by changing the SIM. Some operators will block this by allowing the
phone to use only a single SIM, or only a SIM issued by them; this practice
is known as SIM locking, and is illegal in some countries.

A subscriber can usually contact the provider to remove the lock for a
fee, utilize private services to remove the lock, or make use of ample
software and websites available on the Internet to unlock the handset
themselves. While most web sites offer the unlocking for a fee, some do it
for free. The locking applies to the handset, identified by its International
Mobile Equipment Identity (IMEI) number, not o the account (which is
identified by the SIM card). It is always possible to switch to another (non-
locked) handset if such a handset is available.
GSM MODEMS

A modem is a communication device that converts binary into analog


acoustic signals for transmission over telephone lines and converts these
acoustics signals back into binary form at the receiving end. Conversion to
analog signal is known as modulation; conversion back to binary signal is
known as demodulation.

In the terminology used in the RS-232C communication standard,


modems are DCEs, which mean the connected at one end to a DTE (e.g.
computer) device. Low-speed modems are designed to operate
asynchronously. Each data frame conforms an asynchronous transmission
mechanism.

High-speed modems as well as leased-lines modems use synchronous


transmission. The two modems use a common time base and operate
continuously at substantially the same frequency and the phase relationship
by circuit that monitors the connection.

A half-duplex modem must alternately send and received signals.


Half-duplex allows more of the channel bandwidth to be put to use but slows
data communications.

A full-duplex modem can simultaneously handle two signals using


two carriers to transmit and receive data. Each carrier uses a half of the
bandwidth available to it and its modulation.

ASK is not used For data communications because it is very


susceptible to electrical noise interference. Low-speed modems use FSK,
higher speed modems use PSK, and the very high speed modems use a
conjunction of ASK and PSK.

The SMS/MMS Gateway requires a connection to an SMSC (Short


Messaging Service Centre) to interface with SMS and MMS networks.

An SMSC connection can consist of one or more of the following:

• GSM Modem – A GSM modem or phone connected to a PC serial


port (or to a USB port with an appropriate modem driver).
• SMPP (Short Message Peer to Peer Protocol) – A TCP/IP connection
over the internet or a private network to a service that supports v3.3 or
v3.4 of the SMPP protocol.
• UCP/EMI (Universal Computer Protocol/ External Machine Interface)
– A TCP/IP connection over the internet or a private network to a
service that supports v3.5 or v4.0 of the UCP/EMI protocol.
• HTTP (Hyper Text Transfer Protocol, e.g., the standard protocol for
the “web”) – A TCP/IP connection over the internet or private
network to a service that accepts SMS messages via an HTTP “GET”
based protocol allows you to chain multiple Now SMS/MMS
Gateways together.)

NOKIA 3310: GSM modems


A GSM modem can be an external modem device. 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 card installed in a notebook 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. Phones such as the Nokia 3310, 7110 with a F-bus, M-bus, DLR-
3 cable, or various Ericsson phones are often used for this purpose.

Figure 3.17: F-Bus Connection

The very popular Nokia 3310 has the F/M Bus connection under the
battery holder. This is a bit of a pain to get to and requires a special cable to
make the connection.The right picture above shows the 4 gold pads used for
the F and M Bus. The left picture shows the F-Bus cable connected to my
Nokia 3310.

Figure 3.18: F- Bus and the modem


GSM (Global System for Mobile communication) is a digital mobile
telephony system that is widely used in Europe and other parts of the world.
GSM uses a variation of time division multiple access TDMA) and is the
most widely used of the three digital wireless telephony technologies
(TDMA, GSM, and CDMA). GSM digitizes and compresses data, then
sends it down a channel with two other streams of user data, each in its own
time slot. It operates at either the 900 MHz or 1800 MHz frequency band.

Mobile services based on GSM technology were first launched in


Finland in 1991. Today, more than 690 mobile networks provide GSM
services across 213 countries and GSM represents 82.4% of all global
mobile connections. According to GSM World, there are now more than 2
billion GSM mobile phone users worldwide. GSM World references China
as "the largest single GSM market, with more than 370 million users,
followed by Russia with 145 million, India with 83 million and the USA
with 78 million users."

Since many GSM network operators have roaming agreements with


foreign operators, users can often continue to use their mobile phones when
they travel to other countries. SIM cards (Subscriber Identity Module)
holding home network access configurations may be switched to those will
metered local access, significantly reducing roaming costs while
experiencing no reductions in service.

GSM, together with other technologies, is part of the evolution of


wireless mobile telecommunications that includes High-Speed Circuit-
Switched Data (HCSD), General Packet Radio System (GPRS), Enhanced
Data GSM Environment (EDGE), and Universal Mobile
Telecommunications Service.

DEFINITION
Global System for Mobile (GSM) is a second generation cellular
standard developed to cater voice services and data delivery using digital
modulation.
GSM IN WORLD

GSM IN INDIA

WORKING OF GSM MODEM


Sending SMS Messages from a microcontroller using a GSM Modem:
A GSM modem is a wireless modem that works with GSM wireless
networks. A wireless modem is similar to a dial-up modem. The main
difference is that a wireless modem transmits data through a wireless
network whereas a dial-up modem transmits data through a copper telephone
line. Most mobile phones can be used as a wireless modem.
To send SMS messages, first place a valid SIM card into a GSM
modem, which is then connected to microcontroller by RS232 cable. After
connecting a GSM modem to a microcontroller, you can control the GSM
modem by sending instructions to it. The instructions used for controlling
the GSM modem are called AT commands. GSM modems support a
common set of standard AT commands. In addition to this common set of
standard AT commands, GSM modems support an extended set of AT
commands. One use of the extended AT commands is to control the sending
and receiving of SMS messages.
The following table lists the AT commands that are related to the
writing and sending of SMS messages:

AT command Meaning
+CMGS Send message
+CMSS Send message from storage
+CMGW Write message to memory
+CMGD Delete message
+CMGC Send command
+CMMS More messages to send
Table 8.1 GSM AT Commands

One way to send AT commands to a GSM modem is to use a


program. A program's function is like this:
It sends the characters you typed to the GSM modem. It then displays
the response it receives from GSM modem on the screen.
Below shows a simple example that demonstrates how to use AT
commands.

AT
OK
AT+CMGF=1
OK
AT+CMGW="+85291234567"
> A simple demo of SMS text messaging.
+CMGW: 1
OK
AT+CMSS=1
+CMSS: 20
OK
Here is a description of what is done in the above example:
Line 1: "AT" is sent to the GSM modem to test the connection. The GSM
modem sends back the result code "OK" (line 2), which means the
connection between the program and the GSM modem works fine.
Line 3: The AT command +CMGF is used to instruct the GSM modem to
operate in SMS text mode. The result code "OK" is returned (line 4), which
indicates the command line "AT+CMGF=1" has been executed successfully.
If the result code "ERROR" is returned, it is likely that the GSM modem
does not support the SMS text mode. To confirm, type "AT+CMGF=?" in
the program. If the response is "+CMGF: (0, 1)" (0=PDU mode and 1=text
mode), then SMS text mode is supported. If the response is "+CMGF: (0)",
then SMS text mode is not supported.
Line 5 and 6: The AT command +CMGW is used to write an SMS text
message to the message storage of the GSM modem . "+85291234567" is
the recipient mobile phone number.
Line 7: "+CMGW: 1" tells us that the index assigned to the SMS text
message is 1. It indicates the location of the SMS text message in the
message storage.
Line 9: The result code "OK" indicates the execution of the AT command
+CMGW is successful.
Line 10: The AT command +CMSS is used to send the SMS text message
from the message storage of the GSM modem. "1" is the index of the SMS
text message obtained from line 7.
Line 11: "+CMSS: 20" tells us that the reference number assigned to the
SMS text message is 20.
Line 13: The result code "OK" indicates the execution of the AT command
+CMSS are successful.
By using the above procedure message is sent by the GSM modem.
8.3 Characteristics of GSM Standard:
 Fully digital system using 900,1800 MHz frequency band.
 TDMA over radio carriers(200 KHz carrier spacing.
 8 full rate or 16 half rate TDMA channels per carrier.
 User/terminal authentication for fraud control.
 Encryption of speech and data transmission over the radio path.
 Full international roaming capability.
 Low speed data services (upto 9.6 Kb/s).
 Compatibility with ISDN.
 Support of Short Message Service (SMS).
8.4 Advantages of GSM over Analog system:
 Capacity increases.
 Reduced RF transmission power and longer battery life.
 International roaming capability.
 Better security against fraud (through terminal validation and user
authentication).
 Encryption capability for information security and privacy.
 Compatibility with ISDN, leading to wider range of service.
GSM Applications:
 Mobile telephony.
 GSM-R.
 Value Added Services.
 Telemetry System
• Fleet management.
• Automatic meter reading.
• Toll Collection.
• Remote control and fault reporting of DG sets.

SMS: SMS is an area where the modem can be used to provide features like:
• Pre-stored SMS transmission
• These SMS can be transmitted on certain trigger events in an automation
system
• SMS can also be used in areas where small text information has to be sent.
The transmitter can be an automation system or machines like vending
machines, collection machines or applications like positioning systems
where the navigator keeps on sending SMS at particular time intervals
• SMS can be a solution where GSM data call or GPRS services are not
available [21]

Fig 5.1 : Basic Architecture of GSM Module


8.ESTIMATED COST
SI.NO PARTICULARS UNIT QUANTITY RATE AMOUNT
RS.PS RS.PS
1 PROJECT KIT NO 1 11,000 11,000
a) GSM MODEM
b) LCD DISPLAY
c) POWER SUPPLY
d) RELAYS
e) PCB BOARD
f) IC 89s52(MC)
g) SIM
h) PATCH CHARDS
2 MODEL
a) PLY WOOD (1.9ft*1.9ft) FT 1 500 500
b) FIBER SHEETS(8ft*8ft) FT 1 895 895
c) TRANSFORMERS (12-0-12) NO 2 250 1000
d) RADIUM
i) RED (5cm*5cm) CM 1 50 50
ii) GREEN (5cm*5cm) CM 1 30 30
iii) WHITE (5cm*5cm) CM 1 20 20
iv) BLACK (6cm*2ft) CM*FT 1 100 100
e) MORBEL SHEETS A4 10 5 50
f) GLASS DEADING (10mm) METER 2 10 20
TOTAL AMOUNT 13,665 13,665

GRAND TOTAL AMOUNT OF OUR PROJECT IS=13,665/-


9.ADVANTAGES
• Power scheduling time can be reduced.
• Wastage of power can be reduced.
• Line engineer can easily know for which transformer fault has
occurred.
• Line engineer can easily know what fault has occurred to
transformer.
• The main advantage of this project is gsm modem because it helps
to send the fault description sms to line engineer.

10.DISADVANTAGES
• When network fails this project can’t work.
• The main disadvantage is trouble shooting of transformer
is not possible.
.

11.APPLICATIONS
• We can implement this project
• It is a real time application
• It can used in distributer transformer
• It is used in power transformer
• It is used in agriculture
11.CONCLUSION

By conducting this project we concluded that this project is a real time


application and we can implement this project. By this we alerted the line
engineer by faults occurred in the transformer. We can reduce the human
power and also we can reduce the line engineer work.

12.BIBLOGRAPHY
1. Asha Mehrotra, “Artech House - GSM System Engineering”, Artech
House, Inc.
Boston, London (1997)
2. Gwenaël Le Bodic, “Mobile Messaging Technologies and Services: SMS,
EMS
and MMS”, Second Edition, John Wiley & Sons, Ltd. (2005)
3. Kevin Collins, “PLC Programming for Industrial Automation”, Exposure
Publishing (2006)
4. L. A. Bryan, E. A. Bryan , “Programmable Controllers, theory and
implementation”, Second Edition, An Industrial Text Company Publication,
Atlanta • Georgia • USA (1997)
5. Unitronics, a global company, a designer, developer, producer & marketer
of
Programmable logic Controllers, http://www.unitronics.com/
6. GSMA, association that represents the interests of the worldwide mobile
communications industry,
http://www.gsmworld.com/technology/index.htm

Anda mungkin juga menyukai