Professional Documents
Culture Documents
INTRODUCTION
INTRODUCTION
Objective
The objective of this project is to pay the Electricity Bill through
SMS.
Scope
CHAPTER-II
WORKING CONCEPT
2. PROPOSED WORK
2.3MICROCONTROLLER
Microcontroller is a general purpose device, which integrates a number
of the components of a microprocessor system on to single chip. It has inbuilt
CPU, memory and peripherals to make it as a mini computer. A microcontroller
combines on to the same microchip:
Microcontrollers are
Smaller in size
Consumes less power
Inexpensive
2.4INTRODUCTION TO PIC
The microcontroller that has been used for this project is from PIC series. PIC
microcontroller is the first RISC based microcontroller fabricated in CMOS
(complimentary metal oxide semiconductor) that uses separate bus for
instruction and data allowing simultaneous access of program and data memory.
2.4.1PIC (16F877)
• Watchdog Timer (WDT) with its own on-chip RC Oscillator for reliable
operation
• Programmable code-protection
• Low-power consumption:
2.4.2.2PERIPHERAL FEATURES
2.4.3.1 SPECIFICATIONS
DATA DATA
DEVICE PROGRAM FLASH
MEMORY EEPROM
PIC
8K 368 Bytes 256 Bytes
16F877
Table2.1
Note
input when used in the Parallel Slave Port mode (for interfacing to a
microprocessor bus).
Note :
input when used in the Parallel Slave Port mode (for interfacing to a
microprocessor bus).
Some pins for these I/O ports are multiplexed with an alternate function
for the peripheral features on the device. In general, when a peripheral is
enabled, that pin may not be used as a general purpose I/O pin.
The TRISA register controls the direction of the RA pins, even when
they are being used as analog inputs. The user must ensure the bits in the
TRISA register are maintained set when using them as analog inputs.
2.5.2 PORT A FUNCTION
Table 2.3
Table 2.4
2.6.1Explanation:
This circuit relates to measure the energy consumption through Digital energy
meter. Here we are taken the output from digital energy meter and given to the
4N35 opto coupler IC input. Where the opto coupler is nothing but isolation
circuit. That is AC Line Digital logic isolator, which useful in AC line detection
over short circuit prevention. 4N37 (short) consists of a gallium arsenide
infrared emitting diode coupled with a silicon phototransistor in a dual in−line
package. In that IC output will be always low. When input comes from energy
meter gives logic high as output. If this IC output is low means the output of
BC547 is High, so the LED behind that operation is in Off condition also the
input given to controller also low. When the output of 4N37 is high means the
output of BC547 is Low, so the LED behind that operation is in On condition
also the input given to controller also high. Like this whenever the input comes
from digital energy meter, the LED on board will glow, also the input to
controller is changing their logic from high to low. Otherwise the output of
circuit remains high condition. The output logic is inverted through 74LS04
which is placed on the circuit at final point. So through the logic changes we
can measure the unit of consumption
2.7GSM MODULE
The network behind the GSM system seen by the customer is large
and complicated in order to provide all of the services which are required. It is
divided into a number of sections and these are each covered in separate
articles. The growth of cellular telephone systems took off in the early 1980s,
particularly in Europe. The lack of a technological standardization prompted the
European Conference of Postal and Telecommunications Administrations
(CEPT) to create the Groupe Special Mobile (GSM) in 1982 with the objective
of developing a standard for a mobile telephone system that could be used
across Europe.
The Base Station Subsystem (the base stations and their controllers).
The Network and Switching Subsystem (the part of the network most
similar to a fixed network). This is sometimes also just called the core
network.
The GPRS Core Network (the optional part which allows packet based
Internet connections).
All of the elements in the system combine to produce many GSM
services such as voice calls and SMS.
Voice calls
Voice calls are not an application area to be targeted. In future if interfaces like
a microphone and speaker are provided for some applications.
SMS
2.10.1 GSM Data Calls: Data calls can be made using this modem. Data calls
can be made to a normal PSTN modem/phone line also (even received). Data
calls are basically made to send/receive data streams between two units either
PC’s or embedded devices.
2.10.2Applications
You data size per transaction should be small like 1-3 lines. e.g. banking
transaction data, sales/purchase data, consignment tracking data, updates. These
small but important transaction data can be sent through SMS messaging which
cost even less then a local telephone call or sometimes free of cost worldwide.
Hence with negligible cost you are able to send critical information to your head
office located anywhere in the world from multiple points. You can also transfer
faxes, large data through GSM but this will be as or more costly compared to
landline networks.
If you have multiple data collections points situated all over your city,
state, country or worldwide you will benefit the most. The data can be sent from
multiple points like your branch offices, business associates, warehouses, agents
with devices like GSM modems connected to PCs, GSM electronic terminals
and Mobile phones. Many a times some places like warehouses may be situated
at remote location may not have landline or internet but you will have GSM
network still available easily.
2.10.3.3High uptime:
If your business require high uptime and availability GSM is best suitable
for you as GSM mobile networks have high uptime compared to landline,
internet and other communication mediums. Also in situations where you
expect that someone may sabotage your communication systems by cutting
wires or taping landlines, you can depend on GSM wireless communication.
2.10.3.4Large transaction volumes:
A serial link handler is set with the following default values (factory settings)
autobaud, 8 bits data, 1 stop bit, no parity, and RTS/CTS flow control.
Use the +IPR, +IFC and +ICF commands to change these settings.
2.10.4.2Command line
Commands always start with AT (which means Attention) and finish with a
<CR> character.
Responses start and end with <CR><LF>, except for the ATV0 DCE response
format) and the ATQ1 (result code suppression) commands.
- If command syntax is correct but with some incorrect parameters, the +CME
ERROR: <Err> or +CMS ERROR: <SmsErr> strings are returned with
different error codes.
-If the command line has been performed successfully, an OK string is returned.
Description:
The <address> field is the address of the terminal to which the message is sent.
To send the message, simply type, <ctrl-Z> character (ASCII 26). The text can
contain all existing characters except <ctrl-Z> and <ESC> (ASCII 27).
This command can be aborted using the <ESC> character when entering text.
AT+CMGS= <length><CR>
a) Any read or write of PORTB. This will end the mismatch condition.
b) Clear flag bit RBIF. A mismatch condition will continue to set flag bit RBIF.
Reading PORTB will end the mismatch condition, and allow flag bit RBIF to be
cleared. The interrupt on change feature is recommended for wake-up on key
depression operation and operations where PORTB is only used for the interrupt
on change feature.
Polling of PORTB is not recommended while using the interrupt on
change feature. This interrupt on mismatch feature, together with software
configurable pull-ups on these four pins, allow easy interface to a keypad and
make it possible for wake-up on key depression
Table 2.5
2.12RELAY
2.12.1Explanation
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 animated picture shows a working relay with its
coil and switch contacts. You can see a lever on the left being attracted by
magnetism when the coil is switched on. This lever moves the switch contacts.
There is one set of contacts (SPDT) in the foreground and another behind them,
making the relay DPDT.
The relay's switch connections are usually labeled COM, NC and NO:
This circuit is designed to control the load. The load may be motor or
any other load. The load is turned ON and OFF through relay. The relay ON
and OFF is controlled by the pair of switching transistors (BC 547). The relay is
connected in the Q2 transistor collector terminal. A Relay is nothing but
electromagnetic switching device which consists of three pins. They are
Common, Normally close (NC) and Normally open (NO).
Microcontroller or PC
1 on off off
0 off on on
2.12.3 Applications
Relays are used to realize logic functions. They play a very important
role in providing safety critical logic.
Relays are used to provide time delay functions. They are used to time
the delay open and delay close of contacts.
Relays are used to control high voltage circuits with the help of low
voltage signals. Similarly they are used to control high current circuits
with the help of low current signals.
They are also used as protective relays. By this function all the faults
during transmission and reception can be detected and isolated.
2.13ALARM
2.13.1 Buzzer:
Often these units were anchored to a wall or ceiling and used the ceiling
or wall as a sounding board. Another implementation with some AC-connected
devices was to implement a circuit to make the AC current into a noise loud
enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm
speaker. Nowadays, it is more popular to use a ceramic-based piezoelectric
sounder like a Sonalert which makes a high-pitched tone. Usually these were
hooked up to "driver" circuits which varied the pitch of the sound or pulsed the
sound on and off.
The circuit is designed to control the buzzer. The buzzer ON and OFF is
controlled by the pair of switching transistors (BC 547). The buzzer is
connected in the Q2 transistor collector terminal.
When high pulse signal is given to base of the Q1 transistors, the transistor is
conducting and close the collector and emitter terminal so zero signals is given
to base of the Q2 transistor. Hence Q2 transistor and buzzer is turned OFF state.
Microcontroller or PC
1 on off off
0 off on on
2.14 RS232 COMMUNICATION
2.14.1 EXPLANATION
The standard does not define bit rates for transmission, although the standard
says it is intended for bit rates lower than 20,000 bits per second. Many modern
devices can exceed this speed (38,400 and 57,600 bit/s being common, and
115,200 and 230,400 bit/s making occasional appearances) while still using RS-
232 compatible signal levels.Details of character format and transmission bit
rate are controlled by the serial port hardware, often a single integrated circuit
called a UART that converts data from parallel to serial form. A typical serial
port includes specialized driver and receiver integrated circuits to convert
between internal logic levels and RS-232 compatible signal levels.
2.14.3Circuit working Description:
In this circuit the MAX 232 IC used as level logic converter. The
MAX232 is a dual driver/receiver that includes a capacive voltage generator to
supply EIA 232 voltage levels from a single 5v supply. Each receiver converts
EIA-232 to 5v TTL/CMOS levels. Each driver converts TLL/CMOS input
levels into EIA-232 levels.
2.15.1DESCRIPTION:
2.16.1Applications
SOFTWARE TOOLS
3.SOFTWARE TOOLS
3.1MPLAB
3.1.2 IC PROG
PRO MATE II may be used with MPLAB IDE running under supported
Windows OS's (see Read me for PRO MATE II.txt for support list), with the
command-line controller PROCMD or as a stand-alone programmer
3.1.3COMPILER-HIGH TECH C
The PIC start plus development system from microchip technology provides
the product development engineer with a highly flexible low cost
microcontroller design tool set for all microchip PIC micro devices. The pic
start plus development system includes PIC start plus development programmer
and MPLAB IDE.
The PIC start plus programmer gives the product developer ability to program
user software in to any of the supported microcontrollers. The PIC start plus
software running under MPLAB provides for full interactive control over the
programmer.
3.3POWER SUPPLY
3.3.1BLOCK DIDGRAM
A regulator circuit removes the ripples and also remains the same dc
value even if the input dc voltage varies, or the load connected to the output dc
voltage changes. This voltage regulation is usually obtained using one of the
popular voltage regulator IC units.
3.3.2.1 Transformer
The potential transformer will step down the power supply voltage (0-
230V) to (0-6V) level. Then the secondary of the potential transformer will be
connected to the precision rectifier, which is constructed with the help of op–
amp. The advantages of using precision rectifier are it will give peak voltage
output as DC, rest of the circuits will give only RMS output.
3.3.2.2Bridge rectifier
When four diodes are connected as shown in figure, the circuit is called
as bridge rectifier. The input to the circuit is applied to the diagonally opposite
corners of the network, and the output is taken from the remaining two corners.
Let us assume that the transformer is working properly and there is a positive
potential, at point A and a negative potential at point B. the positive potential at
point A will forward bias D3 and reverse bias D4.
The negative potential at point B will forward bias D1 and reverse D2. At
this time D3 and D1 are forward biased and will allow current flow to pass
through them; D4 and D2 are reverse biased and will block current flow.
The path for current flow is from point B through D1, up through RL,
through D3, through the secondary of the transformer back to point B. this path
is indicated by the solid arrows. Waveforms (1) and (2) can be observed across
D1 and D3.
One-half cycle later the polarity across the secondary of the transformer
reverse, forward biasing D2 and D4 and reverse biasing D1 and D3.
Currentflow will now be from point A through D4, up through RL, through D2,
through the secondary of T1, and back to point A. This path is indicated by the
broken arrows. Waveforms (3) and (4) can be observed across D2 and D4. The
current flow through RL is always in the same direction. In flowing through RL
this current develops a voltage corresponding to that shown waveform (5).
Since current flows through the load (RL) during both half cycles of the applied
voltage, this bridge rectifier is a full-wave rectifier.
One advantage of a bridge rectifier over a conventional full-wave rectifier
is that with a given transformer the bridge rectifier produces a voltage output
that is nearly twice that of the conventional full-wave circuit.
The maximum voltage that appears across the load resistor is nearly-but
never exceeds-500 v0lts, as result of the small voltage drop across the diode. In
the bridge rectifier shown in view B, the maximum voltage that can be rectified
is the full secondary voltage, which is 1000 volts. Therefore, the peak output
voltage across the load resistor is nearly 1000 volts. With both circuits using the
same transformer, the bridge rectifier circuit produces a higher output voltage
than the conventional full-wave rectifier circuit.
3.3.2.3 IC voltage regulators
3.4.SOFTWARE IMPLEMENTATION
With MSComm1
.CommPort = Val(Text1.Text)
.Handshaking = comNone
.RThreshold = 1
.SThreshold = 8
.Settings = "9600,n,8,1"
.PortOpen = True
End With
End Sub
End
End Sub
Sleep 500
Sleep 500
Sleep 3000
End Sub
Text2.Text = ""
End Sub
Else
Sleep 500
Sleep 500
MsgBox "message sent"
End If
End Sub
Else
Sleep 500
Sleep 500
End If
'queryAddress = "http://maps.google.com/maps?q="
End Sub
Text4.Text = ""
Text5.Text = ""
End Sub
Case comEvReceive
databuf = MSComm1.Input
Text5.Text = Len(Text2.Text)
If Len(Text2.Text) >= 60 And Mid(Text2.Text, 50, 1) = "*" Then
Text2.Text = ""
'Text5.Text = ""
End If
'If Len(Text3.Text) = 12 And Mid(Text3.Text, 1, 1) = "*" Then
'Text3.Text = ""
'End If
End Select
End Sub
Text6.Text = ""
End Sub
CHAPTER- V
CONCLUSION
5. CONCLUSION AND FUTURE HOPES
REFERENCE
6.REFERENCES
[7]www.wikipedia.org
[8]www.engineersgarage.com
[9]www.rentron.com
[10]www.edaboard.com