1. INTRODUCTION
2. BLOCK DIAGRAM
3. WORKING PRINCIPLE
4. COMPONENTS REQUIRED
5. PROGRAM
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}}
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
Pin Description:
GND - Ground.
RST - Reset input. A high on this pin for two machine cycles while the
oscillator is running resets the device.
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.
AT89S52 MICROCONTROLLER
FEATURES :
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.
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
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
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
Input Output
Tin Tout
L H
H L
TABLE 2.6
Serial communication using MAX 232
FIGURE 2.9
LCD display
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
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.
1 2 3
current is very high the IC needs ‘heat sink’ to dissipate the internally generated
power. [6]
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
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.
INTRODUCTION
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.
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
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:
TECHNICAL DETAILS
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.
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
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.
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
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
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]
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
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