Mmc15 Electronic Eye With Security Dialup
Mmc15 Electronic Eye With Security Dialup
Mmc15 Electronic Eye With Security Dialup
Security is primary concern for every one. This Project describes a design of
effective security alarm system that can monitor the predefined area with different
sensors. Unauthorized access, Fire accident, wall braking, IR detection, and fire
detection can be monitored by the status of each individual sensor and is indicated
with an LED. This security system works perfectly all the time i.e., whether some one
is present in the area or not.
The burglar alarm is built around the 8051 micro controller from Atmel. This
micro controller provides all the functionality of the burglar alarm. A maximum of 8
sensors can be connected to the burglar alarm. A power supply voltage of +5 VDC is
available for each sensor at the corresponding wiring terminals.
When the alarm has been activated, the LED of the sensor that caused the
alarm will light up, or flash in the event of a cable failure. LCD display is provided in
this project so as to give the information about the sensor triggered.
Hardware Tools:
1. Microcontroller AT89S52.
2. Sensors- LM35, LDR, IR sensor, panic switch
3. Buzzer
4. LCD
5. Auto-dialer
BLOCK DIAGRAM
Application Areas
Nearly 99 per cent of the processors manufactured end up in embedded
systems. The embedded system market is one of the highest growth areas as these
systems are used in very market segment- consumer electronics, office automation,
(ATM), X.25 and frame relay switches are embedded systems which implement the
necessary data communication protocols. For example, a router interconnects two
networks. The two networks may be running different protocol stacks. The routers
function is to obtain the data packets from incoming pores, analyze the packets and
send them towards the destination after doing necessary protocol conversion. Most
networking equipments, other than the end systems (desktop computers) we use to
access the networks, are embedded systems
.
Telecommunications: In the field of telecommunications, the embedded
systems can be categorized as subscriber terminals and network equipment. The
subscriber terminals such as key telephones, ISDN phones, terminal adapters, web
cameras are embedded systems. The network equipment includes multiplexers,
multiple access systems, Packet Assemblers Dissemblers (PADs), sate11ite modems
etc. IP phone, IP gateway, IP gatekeeper etc. are the latest embedded systems that
provide very low-cost voice communication over the Internet.
Wireless technologies: Advances in mobile communications are paving way
for many interesting applications using embedded systems. The mobile phone is one
of the marvels of the last decade of the 20h century. It is a very powerful embedded
system that provides voice communication while we are on the move. The Personal
Digital Assistants and the palmtops can now be used to access multimedia services
over
Security: Security of persons and information has always been a major issue.
We need to protect our homes and offices; and also the information we transmit and
store. Developing embedded systems for security applications is one of the most
lucrative businesses nowadays. Security devices at homes, offices, airports etc. for
authentication and verification are embedded systems. Encryption devices are nearly
99 per cent of the processors that are manufactured end up in~ embedded systems.
Embedded systems find applications in . every industrial segment- consumer
electronics, transportation, avionics, biomedical engineering, manufacturing, process
control and industrial automation, data communication, telecommunication, defense,
security etc. Used to encrypt the data/voice being transmitted on communication links
such as telephone lines. Biometric systems using fingerprint and face recognition are
now being extensively used for user authentication in banking applications as well as
for access control in high security buildings.
Finance: Financial dealing through cash and cheques are now slowly paving
way for transactions using smart cards and ATM (Automatic Teller Machine, also
expanded as Any Time Money) machines. Smart card, of the size of a credit card, has
a small micro-controller and memory; and it interacts with the smart card reader!
ATM machine and acts as an electronic wallet. Smart card technology has the
capability of ushering in a cashless society. Well, the list goes on. It is no exaggeration
to say that eyes wherever you go, you can see, or at least feel, the work of an
embedded system!
Advantages:
Highly sensitive
Fit and Forget system
Night Day mode sensing
Low cost and reliable circuit
Complete elimination of manpower
APPLICATIONS:
1. Infrared remote control units with high power requirements.
2. Free air transmission systems.
3. Infrared source for optical counters and card readers.
4. IR source for smoke detectors.
1.
INTRODUCTION TO MICROCONTROLLER
Microcontrollers as the name suggests are small controllers. They are like
single chip computers that are often embedded into other systems to function as
processing/controlling unit. For example the remote control you are using probably
has microcontrollers inside that do decoding and other controlling functions. They are
also used in automobiles, washing machines, microwave ovens, toys ... etc, where
automation is needed.
Micro-controllers
are
useful
to
the
extent
that
they
communicate with other devices, such as sensors, motors, switches, keypads, displays,
memory and even other micro-controllers. Many interface methods have been
developed over the years to solve the complex problem of balancing circuit design
criteria such as features, cost, size, weight, power consumption, reliability,
availability, manufacturability. Many microcontroller designs typically mix multiple
interfacing methods. In a very simplistic form, a micro-controller system can be
viewed as a system that reads from (monitors) inputs, performs processing and writes
to (controls) outputs.
Embedded system means the processor is embedded into the required
application. An embedded product uses a microprocessor or microcontroller to do one
task only. In an embedded system, there is only one application software that is
typically burned into ROM. Example: printer, keyboard, video game player
Microprocessor - A single chip that contains the CPU or most of the computer
Microcontroller - A single chip used to control other devices
Microcontroller differs from a microprocessor in many ways. First and the
most important is its functionality. In order for a microprocessor to be used, other
components such as memory, or components for receiving and sending data must be
added to it. In short that means that microprocessor is the very heart of the computer.
On the other hand, microcontroller is designed to be all of that in one. No other
external components are needed for its application because all necessary peripherals
are already built into it. Thus, we save the time and space needed to construct devices.
MICROPROCESSOR VS MICROCONTROLLER:
Microprocessor:
Designer can decide on the amount of ROM, RAM and I/O ports.
expensive
versatility general-purpose
Microcontroller:
CPU, RAM, ROM, I/O and timer are all on a single chip
single-purpose
MICROCONTROLLER 89S52
FEATURES:
DESCRIPTION:
The AT89C52 is a low-power, high-performance CMOS 8-bit microcomputer with
8Kbytes of Flash programmable and erasable read only memory (PEROM). The onchip Flash allows the program memory to be reprogrammed in-system or by a
conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU
with Flash on a monolithic chip, the Atmel AT89C52 is a powerful microcomputer,
which provides a highly flexible and cost-effective solution to many embedded
control applications.
PIN DESCRIPTION:
VCC - Supply voltage.
GND - Ground.
Port 0:
external program memory and during accesses to external data memory that uses 16bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal
pullups when emitting 1s. During accesses to external data memory that uses 8-bit
addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some control signals
during Flash programming and verification.
Port 3:
Port 3 is an 8-bit bi-directional I/O port with internal pullups. The Port 3
output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins,
they are pulled high by the internal pullups and can be used as inputs. As inputs, Port
3 pins that are externally being pulled low will source current (I IL) because of the
pullups. Port 3 also serves the functions of various special features of the AT89C51.
Port 3 also receives some control signals for Flash programming and verification.
PORT PIN ALTERNATE FUNCTIONS:
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe).
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. In normal operation, ALE is emitted at a constant rate of
1/6 the oscillator frequency and may be used for external timing or clocking purposes.
However, that one ALE pulse is skipped during each access to external data memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With
the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the
pin is weakly pulled high. Setting the ALE-disable bit has no effect if the
microcontroller is in external execution mode.
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 pro-gram memory locations starting at 0000H up to
FFFFH. However, if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This pin also receives
the 12V programming enable voltage (VPP) during Flash programming when 12V
programming is selected.
XTAL1:
input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2:
It is an output from the inverting oscillator amplifier
BLOCK DIAGRAM OF 89S52:
EXTERNAL
INTERRUPTS
INTERRUPT
CONTROL
ON-CHIP ROM
FOR
PROGRAM
CODE
TIMER/CO
UNTER
ON-CHIP
RAM
TIMER 1
TIMER 0
CPU
OSC
BUS
CONTROL
4 I/O
PORTS
P0 P1 P2 P3
SERIAL
PORT
TX
Rx
COUNTER
INPUTS
Architecture of 89S52
OSCILLATOR CHARACTERISTICS:
XTAL1 and XTAL2 are the input and output, respectively, of an
inverting amplifier, which can be configured for use as an on-chip oscillator. Either a
quartz crystal or ceramic resonator may be used. To drive the device from an external
clock source, XTAL2 should be left unconnected while XTAL1 is driven. There are
no requirements on the duty cycle of the external clock signal, since the input to the
internal clocking circuitry is through a divide-by-two flip-flop, but minimum and
maximum voltage high and low time specifications must be observed.
IDLE MODE:
In idle mode, the CPU puts itself to sleep while all the on-chip peripherals
remain active. The mode is invoked by software. The content of the on-chip RAM and
all the special functions registers remain unchanged during this mode. The idle mode
can be terminated by any enabled interrupt or by a hardware reset. It should be noted
that when idle is terminated by a hardware reset, the device normally resumes
program execution, from where it left off, up to two machine cycles before the
internal reset algorithm takes control. On-chip hardware inhibits access to internal
RAM in this event, but access to the port pins is not inhibited. To eliminate the
possibility of an unexpected write to a port pin when Idle is terminated by reset, the
instruction following the one that invokes Idle should not be one that writes to a port
pin or to external memory.
OSCILLATOR CONNECTIONS:
A project manager
A make facility
Tool configuration
Editor
A powerful debugger
Select Project - Rebuild all target files or Build target. UVision2 compiles,
Select Project - Select Device and select an 8051, 251, or C16x/ST10 device
Database
Select Project - Targets, Groups, and Files. Add/Files, select Source Group1,
Select Project - Options and set the tool options. Note when you select the
target device from the Device Database all-special options are set automatically. You
only need to configure the memory map of your target hardware. Default memory
model settings are optimal for most.
APPLICATIONS:
.
Use the Step toolbar buttons to single-step through your program. You may
Open the Serial Window using the Serial #1 button on the toolbar.
Debug your program using standard options like Step, Go, Break, and so on.
object code but source Code may be any size. Programs that generate more than 2
Kbytes of object code will not compile, assemble, or link the startup code generated
includes LJMP's and cannot be used in single-chip devices supporting Less than 2
Kbytes of program space like the Philips 750/751/752.
.
devices.
EVALUATION SOFTWARE:
.
Code-Banking Linker/Locator
Library Manager.
PERIPHERAL SIMULATION:
The u vision2 debugger provides complete simulation for the CPU and on chip
peripherals of most embedded devices. To discover which peripherals of a device are
supported, in u vision2. Select the Simulated Peripherals item from the Help menu.
You may also use the web-based device database. We are constantly adding new
devices and simulation support for on-chip peripherals so be sure to check Device
Database often.
4. SCHEMATIC
5. CIRCUIT DESCRIPTION
Security is the condition of being protected against danger or loss. In the
general sense, security is a concept similar to safety. The nuance between the two is
an added emphasis on being protected from dangers that originate from outside.
Individuals or actions that encroach upon the condition of protection are responsible
for the breach of security. The word "security" in general usage is synonymous with
"safety," but as a technical term "security" means that something not only is secure
but that it has been secured. One of the best options for providing good security is by
using a technology named EMBEDDED SYSTEMS.
In this project we used fire sensor, LDR, IR and metal detector to
target mainly for fire accidents identification, unuthorised dperson entering into the
home, door opening intimation if opend by unauthorized person and theft alaram
indication using LDR if any of the events occur in the home, signal will be given to
the controller which will be displayed on to the LCD with a beep sound by the buzzer
and also makes a blank call to the number which will be entered during initialization.
All the sensors output is taken directly as two levels without using ADC. The working
of various sensors are described in the following sections.
6. FIRE SENSOR
This fire sensor circuit exploits the temperature sensing property of an
ordinary signal diode IN 34 to detect heat from fire. At the moment it senses heat, a
loud alarm simulating that of Fire brigade will be produced. The circuit is too
sensitive and can detect a rise in temperature of 10 degree or more in its vicinity.
Ordinary signal diodes like IN 34 and OA 71 exhibits this property and the internal
resistance of these devices will decrease when temperature rises.
The fire sensor circuit is too sensitive and can detect a rise in temperature of
10 degree or more in its vicinity. Ordinary signal diodes like IN 34 and OA 71
exhibits this property and the internal resistance of these devices will decrease when
temperature rises. In the reverse biased mode, this effect will be more significant.
Typically the diode can generate around 600 milli volts at 5 degree centigrade. For
each degree rise in temperature; the diode generates 2 mV output voltage. That is at 5
degree it is 10 mV and when the temperature rises to 50 degree, the diode will give
100 milli volts. This voltage is used to trigger the remaining circuit. Transistor T1 is a
temperature controlled switch and its base voltage depends on the voltage from the
diode and from VR and R1. Normally T1 conducts (due to the voltage set by VR) and
LED glows. This indicates normal temperature.
When T1 conducts, base pf T2 will be grounded and it remains off to inhibit
the Alarm generator. IC UM 3561 is used in the circuit to give a Fire force siren. This
ROM IC has an internal oscillator and can generate different tones based on its pin
connections. Here pin 6 is shorted with the Vcc pin 5 to get a fire force siren. When
the temperature near the diode increases above 50 degree, it conducts and ground the
base of T1. This makes T1 off and T2 on. Alarm generator then gets current from the
emitter of T2 which is regulated by ZD to 3.1 volt and buffered by C1.Resistor R4
( 220K) determines the frequency of oscillation and the value 220K is a must for
correct tone. To set the fire sensor circuit, keep a lighted candle near the diode and
wait for 1 minute. Slowly adjust VR till the alarm sounds. Remove the heat .After one
minute, alarm will turns off. VR can be used for further adjustments for particular
temperature levels.
An LDR (Light dependent resistor), as its name suggests, offers resistance in response
to the ambient light. The resistance decreases as the intensity of incident light
increases, and vice versa. In the absence of light, LDR exhibits a resistance of the
order of mega-ohms which decreases to few hundred ohms in the presence of light. It
can act as a sensor, since a varying voltage drop can be obtained in accordance with
the varying light. It is made up of cadmium sulphide (CdS).
An LDR has a zigzag cadmium sulphide track. It is a bilateral device, i.e., conducts in
both directions in same fashion.
8. MAGNETIC SENSOR
Contacts are well protected against dust, oxidization and corrosion due to the
hermetic glass bulb and inert gas; contacts are activated by means of a
magnetic field rather than mechanical parts
Maintenance free
Easy operation
Reduced size
Outputs:
When using the NO (normally open) type the open reed contact closes as the
magnet approaches. NO Magnetic sensors are two wires. When using the NO+NC
type both NO (normally open) and NC (normally closed) functions are made available
by means of a single glass bulb. NO+NC Magnetic sensors are supplied with three
wires, one is in common, one is NO and one is NC
Uses:
Reed switches are widely used for electrical circuit control, particularly in the
communications field. Reed switches are commonly used in mechanical systems as
proximity switches as well as in door and window sensors in burglar alarm systems
and tamper proofing methods. These were formerly used in the keyboards for
computer terminals, where each key had a magnet and a reed switch actuated by
depressing the key. Speed sensors on bicycles use a reed switch to detect when the
magnet on the wheel passes the sensor.
Advantages:
1. They are hermetically sealed in glass environment.
2. Free from contamination, and are safe to use in harsh industrial and explosive
environments.
3.
Reed switches are immune to electrostatic discharge (ESD) and do not require
any external ESD protection circuits. The isolation resistance between the
contacts is as high as 1015 ohms, and contact resistance is as low as 50
milliohms.
4. They can directly switch loads as low as a few microwatts without the help of
external amplification circuits, to as high as 120W.
5.
When the reed switches are combined with magnets and coils, they can be
used to form many different types of relays.
Six reed switches are used in our project to indicate different levels of the
petrochemical liquid in the process container. When the floating magnet comes in
contact with any of the reed switches, magnetic field will be generated and the reeds
are drawn together and thus the reed switch is triggered and this change is applied to
the microcontroller for further processing.
9. IR SECTION:
WHAT IS INFRARED?
Infrared is an energy radiation with a frequency below our eyes sensitivity, so we
cannot see it. Even that we can not "see" sound frequencies, we know that it exist, we
can listen them.
Even that we can not see or hear infrared, we can feel it at our skin temperature
sensors.
When you approach your hand to fire or warm element, you will "feel" the heat, but
you can't see it. You can see the fire because it emits other types of radiation, visible
to your eyes, but it also emits lots of infrared that you can only feel in your skin.
INFRARED IN ELECTRONICS
Infra-Red is interesting, because it is easily generated and doesn't suffer
electromagnetic interference, so it is nicely used to communication and control, but it
is not perfect, some other light emissions could contains infrared as well, and that can
interfere in this communication. The sun is an example, since it emits a wide spectrum
or radiation.
The adventure of using lots of infra-red in TV/VCR remote controls and other
applications, brought infra-red diodes (emitter and receivers) at very low cost at the
market.
From now on you should think as infrared as just a "red" light. This light can means
something to the receiver, the "on or off" radiation can transmit different
meanings.Lots of things can generate infrared, anything that radiate heat do it,
including out body, lamps, stove, oven, friction your hands together, even the hot
water at the faucet.
To allow a good communication using infra-red, and avoid those "fake" signals, it is
imperative to use a "key" that can tell the receiver what is the real data transmitted
and what is fake. As an analogy, looking eye naked to the night sky you can see
hundreds of stars, but you can spot easily a far away airplane just by its flashing
strobe light. That strobe light is the "key", the "coding" element that alerts us.
Similar to the airplane at the night sky, our TV room may have hundreds of tinny IR
sources, our body and the lamps around, even the hot cup of tea. A way to avoid all
those other sources, is generating a key, like the flashing airplane. So, remote controls
use to pulsate its infrared in a certain frequency. The IR receiver module at the TV,
VCR or stereo "tunes" to this certain frequency and ignores all other IR received. The
best frequency for the job is between 30 and 60 kHz, the most used is around 36 kHz
IR GENERATION
To generate a 36 kHz pulsating infrared is quite easy, more difficult is to receive
and identify this frequency. This is why some companies produce infrared receives,
that contains the filters, decoding circuits and the output shaper, that delivers a square
wave, meaning the existence or not of the 36kHz incoming pulsating infrared.
It means that those 3 dollars small units, have an output pin that goes high (+5V)
when there is a pulsating 36kHz infrared in front of it, and zero volts when there is not
this radiation.
Those IR demodulators have inverted logic at its output, when a burst of IR is sensed
it drives its output to low level, meaning logic level = 1.
The TV, VCR, and Audio equipment manufacturers for long use infra-red at their
remote controls. To avoid a Philips remote control to change channels in a Panasonic
TV, they use different codification at the infrared, even that all of them use basically
the same transmitted frequency, from 36 to 50 kHz. So, all of them use a different
combination of bits or how to code the transmitted data to avoid interference.
RC-5
Various remote control systems are used in electronic equipment today. The
RC5 control protocol is one of the most popular and is widely used to control
numerous home appliances, entertainment systems and some industrial applications
including utility consumption remote meter reading, contact-less apparatus control,
telemetry data transmission, and car security systems. Philips originally invented this
protocol and virtually all Philips remotes use this protocol. Following is a description
of the RC5. When the user pushes a button on the hand-held remote, the device is
activated and sends modulated infrared light to transmit the command. The remote
separates command data into packets. Each data packet consists of a 14-bit data word,
which is repeated if the user continues to push the remote button. The data packet
structure is as follows:
2 start bits,
1 control bit,
5 address bits,
6 command bits.
The start bits are always logic 1 and intended to calibrate the optical receiver
automatic gain control loop. Next, is the control bit. This bit is inverted each time the
user releases the remote button and is intended to differentiate situations when the
user continues to hold the same button or presses it again. The next 5 bits are the
address bits and select the destination device. A number of devices can use RC5 at the
same time. To exclude possible interference, each must use a different address. The 6
command bits describe the actual command. As a result, a RC5 transmitter can send
the 2048 unique commands. The transmitter shifts the data word, applies Manchester
encoding and passes the created one-bit sequence to a control carrier frequency signal
amplitude modulator. The amplitude modulated carrier signal is sent to the optical
transmitter, which radiates the infrared light. In RC5 systems the carrier frequency has
been set to 36 kHz. Figure below displays the RC5 protocol.
The receiver performs the reverse function. The photo detector converts optical
transmission into electric signals, filters it and executes amplitude demodulation. The
receiver output bit stream can be used to decode the RC5 data word. This operation is
done by the microprocessor typically, but complete hardware implementations are
present on the market as well. Single-die optical receivers are being mass produced by
a number of companies such as Siemens, Temic, Sharp, Xiamen Hualian, Japanese
Electric and others. Please note that the receiver output is inverted (log. 1 corresponds
to illumination absence).
IR RECEIVER
Description
demodulated
output
signal
can
directly
be
decoded
by
Some examples for suitable data format are: NEC Code, Toshiba Micom
Format, Sharp Code, RC5 Code, RC6 Code, R2000 Code, Sony Format
(SIRCS). When a disturbance signal is applied to the TSOP17.. it can still
receive the data signal. However the sensitivity is reduced to that level
that no unexpected pulses will occur. Some examples for such disturbance
signals which are suppressed by the TSOP17 are:
DC light (e.g. from tungsten bulb or sunlight)
Continuous signal at 38 kHz or at any other frequency
Signals from fluorescent lamps with electronic ballast (an example of the
signal modulation is in the figure below).
Infrared technology develpoping until now, already has been known to everyone, this
technology has been generally used in the application of modern science technology, national
defense and industrial and agricultural fields.
(7) signal processing system. It could enlarge and tilter detacting signal to get
information. And then translates the information into required format
which is transfer to the control device or display at last.
(8) display device. This is the final device of infrared device. Display devices are
commonly used including oscilloscopes, cathode ray tubes, infraredsensitive materials, instructions and other instruments and recorder.
Infrared system could be able to complete the relevant physical measurement
in accordance with the process above mentioned.
The core of infrared system is infrared detectors which can be divided into
Thermal detectors and photon detectors according to the different detecting
mechanism. The following example of a thermal detector is used to analyze principle
of the detector.
Thermal detectors make use of radiant heat effect, so that make the
temperature of detecting component raise after receiving radiation energy, and thus
make the detector performance depends on the temperature performance change. The
radiation will be detated when detecting temperature performance change. In most
cases, to detect change through thermal radiation. When the device receives radiation
to cause non-electricity change that can be measured the power change by means of
appropriate transformation.
DRIVER CIRCUIT:
Digital systems and microcontroller pins lack sufficient current to drive the
circuits like relays, buzzer circuits etc. While these circuits require around 10milli
amps to be operated, the microcontrollers pin can provide a maximum of 1-2milli
amps current. For this reason, a driver such as a power transistor is placed in between
the microcontroller and the buzzer circuit.
Vcc
BUZZER
P1.0
GROUND
10.
microcontroller.
This
switch is
The switches that we are using in our project are 4 leg micro
switches of momentary type.
Vcc
R
P2.0
Gnd
LED INTERFACING:
Vcc
P1.0
It is important to know that each diode will be immediately destroyed unless its
current is limited. This means that a conductor must be connected in parallel to a
diode. In order to correctly determine
value of this conductor, it is necessary
to know diodes voltage drop in
forward direction, which depends on
what material a diode is made of and
what colour it is. Values typical for the
most frequently used diodes are shown
in table below: As seen, there are three
main types of LEDs. Standard ones get
ful brightness at current of 20mA. Low Current diodes get ful brightness at ten times
lower current while Super Bright diodes produce more intensive light than Standard
ones.
Since the 8051 microcontrollers can provide only low input current
and since their pins are configured as outputs when voltage level on
them is equal to 0, direct connectining to LEDs is carried out as it is
shown on figure (Low current LED, cathode is connected to output
pin).
Switches and Pushbuttons
There is nothing simpler than this! This is the simplest way of controlling appearance
of some voltage on microcontrollers input pin. There is also no need for additional
explanation of how these components operate.
The simplest solution is to connect simple RC circuit which will suppress each
quick voltage change. Since the bouncing time is not defined, the values of elements
are not strictly determined. In the most cases, the values shown on figure are
sufficient.
If complete safety is needed, radical measures should be taken! The circuit, shown on
the figure (RS flip-flop), changes logic state on its output with the first pulse triggered
by contact bounce. Even though this is more expensive solution (SPDT switch), the
problem is definitely resolved! Besides, since the condensator is not used, very short
pulses can be also registered in this way. In addition to these hardware solutions, a
simple software solution is commonly applied too: when a program tests the state of
some input pin and finds changes, the check should be done one more time after
certain time delay. If the change is confirmed it means that switch (or pushbutton) has
changed its position. The advantages of such solution are obvious: it is free of charge,
effects of disturbances are eliminated too and it can be adjusted to the worst-quality
contacts.
Transformer:
Usually, DC voltages are required to operate various electronic equipment and
these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus
the a.c input available at the mains supply i.e., 230V is to be brought down to the
required voltage level. This is done by a transformer. Thus, a step down transformer is
employed to decrease the voltage to a required level.
Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into
pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project,
a bridge rectifier is used because of its merits like good stability and full wave
rectification.
Filter:
Capacitive filter is used in this project. It removes the ripples from the output
of rectifier and smoothens the D.C. Output received from this filter is constant until
the mains voltage and load is maintained constant. However, if either of the two is
varied, D.C. voltage received at this point changes. Therefore a regulator is applied at
the output stage.
Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage
regulator is an electrical regulator designed to automatically maintain a constant
voltage level. In this project, power supply of 5V and 12V are required. In order to
obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The first
number 78 represents positive supply and the numbers 05, 12 represent the required
output voltage levels.
12.
LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing
LEDs (seven segment LEDs or other multi segment LEDs) because of the 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 a few characters.
3. Incorporation of a refreshing controller into the LCD, thereby relieving the
CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed
by the CPU to keep displaying the data.
4. Ease of programming for characters and graphics.
These components are specialized for being used with the microcontrollers,
which means that they cannot be activated by standard IC circuits. They are used for
writing different messages on a miniature LCD.
A model described here is for its low price and great possibilities most
frequently used in practice. It is based on the HD44780 microcontroller (Hitachi) and
can display messages in two lines with 16 characters each. It displays all the
alphabets, Greek letters, punctuation marks, mathematical symbols etc. In addition, it
is possible to display symbols that user makes up on its own.
Automatic shifting message on display (shift left and right), appearance of the
pointer, backlight etc. are considered as useful characteristics.
Pins Functions
There are pins along one side of the small printed board used for connection to
the microcontroller. There are total of 14 pins marked with numbers (16 in case the
background light is built in). Their function is described in the table below:
Function
Pin
Number
Name
Logic
State
Description
Ground
Vss
0V
Power supply
Vdd
+5V
Contrast
Vee
0 Vdd
RS
0
1
D0 D7 are interpreted as
commands
D0 D7 are interpreted as
data
R/W
0
1
0
1
From 1
to 0
D0
0/1
Bit 0 LSB
D1
0/1
Bit 1
D2
0/1
Bit 2
10
D3
0/1
Bit 3
11
D4
0/1
Bit 4
12
D5
0/1
Bit 5
13
D6
0/1
Bit 6
Control of
operating
Data /
commands
14
D7
0/1
Bit 7 MSB
LCD screen:
LCD screen consists of two lines with 16 characters each. Each character
consists of 5x7 dot matrix. Contrast on display depends on the power supply voltage
and whether messages are displayed in one or two lines. For that reason, variable
voltage 0-Vdd is applied on pin marked as Vee. Trimmer potentiometer is usually
used for that purpose. Some versions of displays have built in backlight (blue or green
diodes). When used during operating, a resistor for current limitation should be used
(like with any LE diode).
R
D D D D
D D
RW
D3 D2
S
7 6 5 4
1 0
Clear display
0 0 0
1.64Ms
Cursor home
0 0 0
1.64mS
0 0 0
1 I/D S
40uS
0 0 0
40uS
Cursor/Display Shift
0 0 0
1 D/C R/L x
Function set
0 0 1 DL N
0 1
1 BF
Write to CGRAM or
DDRAM
D D D
D
D4 D3 D2 D1
7 6 5
0
40uS
D D D
D
D4 D3 D2 D1
7 6 5
0
40uS
Execution
Time
U B
40uS
40uS
CGRAM address
40uS
DDRAM address
40uS
DDRAM address
B 1 = Cursor blink on
0 = Cursor shift
LCD Connection
Depending on how many lines are used for connection to the microcontroller,
there are 8-bit and 4-bit LCD modes. The appropriate mode is determined at the
beginning of the process in a phase called initialization. In the first case, the data
are transferred through outputs D0-D7 as it has been already explained. In case of 4bit LED mode, for the sake of saving valuable I/O pins of the microcontroller, there
are only 4 higher bits (D4-D7) used for communication, while other may be left
unconnected.
Consequently, each data is sent to LCD in two steps: four higher bits are sent
first (that normally would be sent through lines D4-D7), four lower bits are sent
afterwards. With the help of initialization, LCD will correctly connect and interpret
each data received. Besides, with regards to the fact that data are rarely read from
LCD (data mainly are transferred from microcontroller to LCD) one more I/O pin
may be saved by simple connecting R/W pin to the Ground. Such saving has its price.
Even though message displaying will be normally performed, it will not be
possible to read from busy flag since it is not possible to read from display.
LCD Initialization
Once the power supply is turned on, LCD is automatically cleared. This
process lasts for approximately 15mS. After that, display is ready to operate. The
mode of operating is set by default. This means that:
1. Display is cleared
2. Mode
DL = 1 Communication through 8-bit interface
N = 0 Messages are displayed in one line
F = 0 Character font 5 x 8 dots
3. Display/Cursor on/off
D = 0 Display off
U = 0 Cursor off
B = 0 Cursor blink off
4. Character entry
ID = 1 Addresses on display are automatically incremented by 1
S = 0 Display shift off
Automatic reset is mainly performed without any problems. If for any reason
power supply voltage does not reach full value in the course of 10mS, display will
start perform completely unpredictably.
If voltage supply unit cannot meet this condition or if it is needed to provide
completely safe operating, the process of initialization by which a new reset enabling
display to operate normally must be applied.
Algorithm according to the initialization is being performed depends on
whether connection to the microcontroller is through 4- or 8-bit interface. All left over
to be done after that is to give basic commands and of course- to display messages.
Contrast control:
To have a clear view of the characters on the LCD, contrast should be adjusted. To
adjust the contrast, the voltage should be varied. For this, a preset is used which can
behave like a variable voltage device. As the voltage of this preset is varied, the
contrast of the LCD can be adjusted.
Potentiometer
Variable resistors used as potentiometers have all three terminals
connected. This arrangement is normally used to vary voltage, for
example to set the switching point of a circuit with a sensor, or control the
volume (loudness) in an amplifier circuit. If the terminals at the ends of the
track are connected across the power supply, then the wiper terminal will
provide a voltage which can be varied from zero up to the maximum of the
supply.
Presets
These are miniature versions of the standard variable resistor. They are
designed to be mounted directly onto the circuit board and adjusted only
when the circuit is built. For example, to set the frequency of an alarm
tone or the sensitivity of a light-sensitive circuit, a small screwdriver or
similar tool is required to adjust presets.
Presets are much cheaper than standard variable resistors so they are
sometimes used in projects where a standard variable resistor would
normally be used.
Multiturn presets are used where very precise adjustments must be made. The screw
must be turned many times (10+) to move the slider from one end of the track to the
other, giving very fine control.
13. CODE
/*-------------------------------------------; security system with autodialler
--------------------------------------------*/
#include<reg51.h>
#include "lcddisplay.h"
sbit temp
= P2^0;
sbit read_switch
sbit ir
= P2^1;
= P2^2;
sbit ldr
= P3^0;
Sbit redial
=P2^4;
sbit credial
=P2^5;
sbit buz
=P2^3;
unsigned char i;
void dialling();
void main()
{
buz=1;
redial=0;
credial=0;
lcd_init();
delay(50);
lcdcmd(1);
msgdisplay("SECURITY SYSTEM");
lcdcmd(0xc0);
msgdisplay("USING AUTODIALER");
delay(1000);
while(1)
{
redial=0;
credial=0;
buz=1;
if(read_switch==1)
{
buz=0;
lcdcmd(1);
msgdisplay("DOOR OPENED");
dialling();
while(1);
}
if(temp==1)
{
buz=0;
lcdcmd(1);
msgdisplay("FIRE DTECTED");
dialling();
while(1);
}
if(ldr==1)
{
buz=0;
lcdcmd(1);
msgdisplay("LIGHT FALLEN");
dialling();
while(1);
}
if(ir==1)
{
buz=0;
lcdcmd(1);
msgdisplay("PERSON DETECTED");
dialling();
while(1);
}
}
}
void dialling()
{
credial=1;
delay(100);
redial=1;
delay(400);
redial=0;