Professional Documents
Culture Documents
Chapter 1
INTRODUCTION
Ultrasound is acoustic (sound) energy in the form of waves having a frequency above
the human hearing range. The highest frequency that the human ear can detect is
approximately 20 thousand cycles per second (20,000 Hz). This is where the sonic range
ends, and where the ultrasonic range begins. Ultrasound is used in electronic, navigational,
industrial, and security applications. It is also used in medicine to view internal organs of the
body. Ultrasound can be used to locate objects by means similar to the principle by which
radar works. High frequency acoustic waves reflect from objects, even comparatively small
ones, because of the short wavelength. The distance to an object can be determined by
measuring the delay between the transmission of an ultra-sound pulse and the return of the
echo. This is the well-known means by which bats navigate in darkness. It is also believed to
be used underwater by cetaceans such as dolphins and whales. Ultrasound can be used in
sonar systems to determine the depth of the water in a location, to find fish, to locate
submarines. In this project, we are using the ultrasound signals to detect the intruders and the
owner is alerted through a message.
1.1 MOTIVATION
Today video surveillance is widely used. But it has a major disadvantage. If we have installed
a camera as our security system, we may have to go through the video recorded to know
about the intruder or we should sit in front of the camera and watch it continuously which is
totally a waste of time. But our ultrasonic security system sends the message to the owner
immediately when the intruder is detected, also alerts the surroundings by sounding the
alarm.
1.2 OBJECTIVE
Security is an important part of home, Office, Industry, Shops etc…The major function of
this Device is to provide security, hence it can be used almost anywhere to protect valuables.
CHAPTER 2
BLOCK DIAGRAM
CHAPTER 3
HARDWARE DISCRIPTION
The 8052 Microcontroller can be programmed in PL/M, 8052 Assembly, C and other
high-level languages. Many compilers even have support for compiling C++ for an 8052.
Program memory in the 8052 is read-only, while the data memory is considered to be
read/write accessible. When stored on EEPROM or Flash, the program memory can be
rewritten when the microcontroller is in the special programmer circuit.
PORT 2: It is 8-bit bi-directional I/O port. It is bit/ byte addressable. During external
memory access it functions as higher order address bus. The alternate use of Port 2 is to
supply a high order address byte in conjunction with port 0 low order byte to address external
memory.
P2.5: It is connected to the buzzer.
P2.6 and P2.7: These pins are connected to the leds.
PORT 3: It is used for special functions like interrupts, transmitter and receiver, to connect
external clock etc... And also as simple I/O port.
P3.0: This pin is used to give the input for the ultrasonic sensor. It is connected to the trigger
pin of ultrasonic sensor.
P3.1 (TxD): It is used to for serial communication to send data serially to the GSM module.
This pin is connected to the Rx pin of the GSM module.
P3.2 (INT0): This pin is used for receiving the output of the ultrasonic sensor. It is external
hardware interrupt I/P signal. It is connected to the echo pin of ultrasonic sensor.
Fig.3.21: HC-SR04
Specifications:
Power supply: 5V DC
Quiescent current: <2mA
Effectual angle: <15°
Ranging distance: 2cm – 500 cm
Resolution: 0.3 cm
Timing diagram:
A short ultrasonic pulse is transmitted at the time 0 reflected by an object as shown in the Fig
3.22. The sensor receives this signal and converts it to an electric signal. The next pulse can
be transmitted when the Echo is faded away. This time period is called cycle period. The
recommend cycle period should be not less than 50ms. If a 10μs width trigger pulse is sent to
the signal pin, the Ultrasonic module will output eight 40 KHz ultrasonic signal and detect
the Echo back. The measured distance is proportional to the echo pulse width and can be
calculated by the formula. If no intruder is detected, the output pin will give a 38ms high
level signal.
Introduction:
GSM/GPRS module is used to establish communication between a computer and a
GSM-GPRS system. Global System for Mobile communication (GSM) is an architecture
used for mobile communication in most of the countries. Global Packet Radio Service
(GPRS) is an extension of GSM that enables higher data transmission rate. GSM/GPRS
module consists of a GSM/GPRS modem assembled together with power supply circuit and
communication interfaces (like RS-232, USB, etc.) for computer. The MODEM is the soul of
such modules.
SIM900- TTL UART GSM/GPRS modem:
GSM (Global System for Mobile) / GPRS (General Packet Radio Service) TTL –Modem is
SIM900 Quad-band GSM / GPRS device, works on frequencies 850 MHZ, 900 MHZ, 1800
MHZ and 1900 MHZ. It is very compact in size and easy to use as plug in GSM Modem. The
Modem is designed with 3V3 and 5V DC TTL interfacing circuitry, which allows User to
directly interface with 5V Microcontrollers (PIC, AVR, AT89S52 microcontroller, AT89S52,
etc.) as well as 3V3 Microcontrollers (ARM, ARM Cortex XX, etc.). The baud rate can be
configurable from 9600- 115200 bps through AT (Attention) commands. This GSM/GPRS
TTL Modem has internal TCP/IP stack to enable User to connect with internet through GPRS
feature. It is suitable for SMS as well as DATA transfer application in mobile phone to
mobile phone interface. The modem can be interfaced with a Microcontroller using USART
(Universal Synchronous Asynchronous Receiver and Transmitter) feature (serial
communication).
Features-
● Quad Band GSM/GPRS : 850 / 900 / 1800 / 1900 MHz
● Built in RS232 to TTL or vice versa Logic Converter (MAX232)
● Configurable Baud Rate
● SMA (Sub Miniature version A) connector with GSM L Type Antenna
● Built in SIM (Subscriber Identity Module) Card holder
● Built in Network Status LED
● Audio Interface Connectors (Audio in and Audio out)
● Most Status and Controlling pins are available
● Normal Operation Temperature : -20 °C to +55 °C
● Input Voltage : 5V to 12V DC
Interfaces
● Interface to external SIM3V/1.8V
● Analog audio interface
● RTC backup
● SPI interface
● Serial interface
● Embedded SIM
● Antenna pad
● GPIO
● ADC
● Charge interface for LI battery
● PWM
MAX 232
The MAX232 IC is used to convert the TTL/CMOS logic levels to RS232 logic levels during
serial communication of microcontrollers with PC. The controller operates at TTL logic level
(0-5V) whereas the serial communication in PC works on RS232 standards (-25 V to + 25V).
This makes it difficult to establish a direct link between them to communicate with each
other.
The intermediate link is provided through MAX232. It is a dual driver/receiver that includes
a capacitive voltage generator to supply RS232 voltage levels from a single 5V supply. Each
receiver converts RS232 inputs to 5V TTL/CMOS levels. These receivers (R1 & R2) can
accept ±30V inputs. The drivers (T1 & T2), also called transmitters, convert the TTL/CMOS
input level into RS232 level.
Rs-232/Db9
An RS-232 serial port was once a standard feature of a personal computer, used for
connections to modems, printers, mice, data storage, uninterruptible power supplies, and
other peripheral devices. However, RS-232 is hampered by low transmission speed, large
voltage swing, and large standard connectors. In modern personal computers, USB has
displaced RS-232 from most of its peripheral interface roles. Many computers do not come
equipped with RS-232 ports and must use either an external USB-to-RS-232 converter or an
internal expansion card with one or more serial ports to connect to RS-232 peripherals.
Nevertheless, RS-232 devices are still used, especially in industrial machines, networking
equipment and scientific instruments.
RS-232 stands for Recommend Standard number 232. This cable Rs-232(Db9) is used to
interface between microcontroller and GSM (global system for mobile communication).
3.5 BUZZER
Power supply circuit is built using filter, rectifier, and then voltage regulators. Starting with
an ac voltage, a steady dc voltage is obtained by rectifying the ac voltage, then filtering to a
dc level, and finally, regulating to obtain a desired fixed dc voltage. The regulation is usually
obtained from an IC voltage regulator unit, which takes a dc voltage and provides lower dc
voltage, which remains the same even if the input dc voltage varies, or the output load
connected to the dc voltage changes. The block diagram of power supply is shown in Fig
3.61.
Transformer:
A transformer is a static electrical device that transfers energy by inductive coupling between
its winding circuits. A varying current in the primary winding creates a varying magnetic flux
in the transformer's core and thus a varying magnetic flux through the secondary winding.
This varying magnetic flux induces a varying electromotive force (EMF) or voltage in the
secondary winding. Transformers can be used to vary the relative voltage of circuits or isolate
them, or both. The transformer will step down the power supply voltage (0-230V) to (0-6V)
level. It is given to the Bridge rectifier as input.
Bridge rectifier:
Bridge rectifier is used to maintain the proper DC voltage at the input to the circuit as shown
in the Fig 3.62. It comprises of four diodes connected to form a bridge. It uses the entire AC
wave (both positive and negative sections). 1.4V is used up in the bridge rectifier because
each diode uses 0.7V when conducting and there are always two diodes conducting, as shown
in fig below.
Voltage Regulators:
Fig 3.63 shows the basic connection of a three-terminal voltage regulator IC to a load. The
fixed voltage regulator has an unregulated dc input voltage Vin, applied to one input terminal,
a regulated output dc voltage Vout, from a second terminal, and the third terminal connected
to ground. We are using 7805 IC which contains zener diode.
Calculations:
Vdc (o/p) =5V
Idc (o/p) =100mA
Vdc (in) =Vdc (o/p) + 5V = 10V
Assume y ≤ 0.05
C=577.35uF
Vm = Vdc (in) + Idc/4fc =10V
Choose capacitor >577.35uF (>> 10V)
Choose diodes with current rating >100mA, breakdown voltage>>PIV=Vm=10V
Vrms (i/p) = Vm/1.414 = 7.071V
N1/N2 = V1/V2 = 34/1 Choose 0:9 transformer.
Chapter 4
SYSTEM DESIGN
The circuit diagram shown in Fig 4.1 is the main part of the intruder detection. Ultrasonic
sensor is connected to 8052 through p3.0 and p3.2 pins of port3. LEDs are used to indicate
the presence and absence of intruder in the specified range. The embedded C is used to write
the software code and it is dumped into 8052 to measure the distance using Keil micro-vision.
Chapter 5
SOFTWARE DESCRIPTION
When the trigger pin is made a transaction from low to high with a delay of 10µs, then the
timer starts and Echo pin of the sensor goes high. If the pulse is received by the receiver of
the sensor then Echo pin goes low then time required for transmitting and receiving of the
pulse will be stored in DPTR register. The distance to the intruder will be proportional to the
high level time of echo pulse. The flowchart of the system is shown in fig 5.1.
Chapter 6
EXPERIMENTAL RESULTS
The intruder assumed here is a person but it can be anything which has certain size and shape.
The range of the distance varies from minimum of 2cm to maximum of 250cm. Fig 6.1 shows
the snapshot of the project which includes LED, buzzer, GSM module, Ultrasonic sensor, and
8052 microcontroller .Fig 6.2 shows the message received in the owner’s mobile.
Chapter 7
CONCLUSION
The major function of this Device is to provide security, hence it can be used almost
anywhere to protect valuables:
● Can be used in museum to protect antique items and other valuable items
● Can be used as an Home Security System
● It can also be used to protect Privacy
● Can be used in jewellery shop to protect jewels from customers.
REFERENCES
1. Mohammed Ali Mazidi and Gannice Gilipsi Mazidi, “8051 Microcontroller and
Embedded Systems Using Assembly and C” Second edition : PHI, 2002
2. www.wikipedia.org
3. www.raeelectronics .com
4. Ikuo Ihara, “Ultrasonic Sensing: Fundamentals and Its Applications to
Non-destructive Evaluation (a draft)”
5. www.elecfreaks.com, HC-SR04 User Guide.