Design of wireless monitoring and alarm system based on pyroelectric infrared sensor

Publisher:innovation2Latest update time:2010-03-09 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This design aims to produce a powerful alarm system that can promptly notify the parties involved in an emergency, even if they are not near the scene, and automatically call the police. Compared with ordinary alarms, this design focuses on remote voice alarms. As long as the appropriate sensors are connected, it can form a multifunctional alarm system such as burglar alarm, fire alarm, gas leak alarm, etc., and additionally implement some intelligent control functions, giving the alarm system more powerful and complete functions to meet people's needs for safety alarms. This system is based on the telephone network but is independent of the telephone and will not affect the normal use of the telephone. It is operated through voice prompts and has friendly human-computer interaction.

System principle and system block diagram

This system mainly includes automatic telephone off-hook and on-hook circuits, DTMF signal transceiver circuits, voice prompt circuits, alarm circuits, keyboard display circuits, human signal detection circuits, encoding circuits, wireless transmission circuits, and single-chip control circuits as the main core. The system structure diagram is shown in Figure 1. We set the alarm part as the main working part of this system, that is, real-time monitoring of the safety situation in the room, which is manifested as the main loop in the software. When there is a ringing signal or a setting signal, it will interrupt to perform the corresponding operation. Here we need a sensor that is sensitive to the infrared radiation of the human body and anti-interference (such as small animals, etc.). For this reason, we use a passive pyroelectric infrared detector and cover its radiation surface with a special Fresnel filter to significantly control the interference of the environment. The function of the setting part is to store the number to be dialed when the alarm is triggered and set the owner's identity authentication password. In order to simplify the system, an LCD screen is used for display.

Figure 1 System structure diagram

When the infrared human body detection circuit detects human intrusion, the encoding circuit encodes the address of the detection probe, and sends the address of the probe that detects human intrusion to the wireless receiving circuit through the wireless transmitting circuit. After decoding by the CPU, the LED displays the alarm address, and at the same time, an audible and visual alarm is issued or a preset phone number is called to the director to alarm.

Signal detection circuit

The signal detection circuit is mainly composed of pyroelectric infrared detection probe SD02 and BISS0001 signal processing circuit.

The signal detection circuit is shown in Figure 2. The pyroelectric infrared sensor, which is equipped with a filter lens and an impedance matching field effect tube, detects infrared radiation from the human body in a non-contact manner and converts it into an electrical signal. After being pre-amplified by the operational amplifier N1 in BISS0001 and amplified by the second stage of the operational amplifier N2, the DC potential is raised to the built-in voltage Um and sent to the bidirectional amplitude detector composed of comparators N4 and N5 to detect the effective trigger signal Us. Since the built-in voltage UH≈0.7UDD and UL≈0.3UDD, when UDD=5V, the noise interference of ±1V can be effectively suppressed. N3 is a conditional comparator. When the input voltage Uc is less than the built-in voltage UR (≈0.2UDD), N3 outputs a low level to block Us from being delivered to the next level. When Uc>UR, N3 outputs a high level and opens the AND gate N7. At this time, if the rising edge of the trigger signal Us arrives, the delay timer can be started, and Uo output is a high level. The selection of the comparator's domain value is very important. If the domain value is too low, it may lead to false alarms, while if it is too high, the sensitivity may be low.

Figure 2 Signal detection circuit

[page]

In the timing period Tx, the output terminal 2 of BISS0001 is high, then the transistor VT1 is saturated and turned on, and its collector is low, sending this signal to the encoding and wireless transmission circuit composed of the single-chip microcomputer and the wireless transmission circuit, and connecting it to the P0.0 port of the single-chip microcomputer used for encoding. The single-chip microcomputer encodes the probe and transmits it wirelessly; at the end of Tx, BISS0001 enters the blocking period Ti, its output terminal becomes low level, the transistor is cut off, and its collector is high level. Pin 1 (A terminal) of BISS0001 is connected to the power supply, so that the signal detection circuit is in repeated triggering. The Tx timing interval can be determined by the resistor and capacitor connected to pins 3 and 4 of BISS0001. The elevation angle of the signal detection probe can be adjusted within the range of 120°, and the actual detection distance can be adjusted by changing the elevation angle. We can adjust it through actual tests, or adjust the adjustable resistor RP in the signal detection circuit to adjust the detection distance of the probe. The detection distance of this designed circuit is 30m.

Coding circuit and wireless transmitting and receiving module

The encoding circuit and the wireless transmitting circuit are composed of a single-chip microcomputer and a transceiver integrated chip nRF401, and the circuit has few peripheral components and is simple.

This design uses the nRF401 wireless data transmission chip, which is a combination of transmission and reception, newly launched by Nordic Company of Norway. It is a real single-chip UHF wireless transceiver chip designed for the 433MHz ISM band, using FSK modulation and demodulation technology. With a high-gain antenna, the transmission distance can reach 3000m.

The coding and wireless transmission and reception circuit is shown in Figure 3. The PWR_UP of the RF chip is controlled through the P2.0 port of AT89C51. When it is "1", it means entering the normal working mode, and when it is "0", it means entering the standby mode; P2.2 is connected to the CS of the RF chip to control the transmission and reception frequency. When it is "1", it means the working frequency is 434.32MHz. When it is "0", it means the working frequency is 433.92MHz. P2.1 controls the TXEN end of the RF chip. When it is "1", it means entering the transmission mode, and when it is "0", it means entering the reception mode.

Figure 3 Wireless transmission and reception circuit

Interface between MT8880, AT89C51 and voice circuit

The DTMF signal sending/receiving circuit uses the MT8880 chip, a special integrated circuit launched by MITEL for processing DTNF signals. It not only has the automatic dialing function of receiving and sending DTMF signals, but also can detect dial tone, ringback tone, busy tone and other signal tones on the telephone trunk line. It is suitable for interfacing with a single-chip microcomputer and has a simple peripheral circuit.

[page]

There are 5 registers inside MT8880, namely, the receive data register, the transmit data register, the transceiver control registers CRA and CRB, and the transceiver status register. In this design, only the transmit data register, the transceiver control registers CRA and CRB are used to send DTMF signals to realize the automatic dialing function. The data in the transmit data register determines the frequency of the dual audio signal to be sent, so data can only be written to the transmit data register. The two transceiver control registers occupy the same address, so whether to operate CRB is determined by the value of the register selection bit in CRA.

ISDl420 voice chip adopts direct analog storage technology, and the recording and playback sound quality is excellent, and there is a certain reverberation effect; its peripheral components are simple, and only simple resistors and capacitors are needed to form a simple recording and playback circuit; no backup power supply is required, the information storage time is long, and no special programmer and voice developer are required; it has a strong address selection ability, and the memory can be divided into 160 segments for management, forming a minimum recording and playback time of 125ms. In this design, because four segments of alarm prompt voice are required, each segment of voice is set to 5s when designing the voice segmentation method, and its starting addresses are 00000000B, 00101000B, 01010000B, and 01111000B respectively.

The data ports A3, A4, A5, and A6 of ISD1402 are connected to the PB0, PB1, PB2, and PB3 ports of the microcontroller port expansion chip 8255 respectively, A0, A1, A2, and A7 are grounded, PLAYL is connected to the PB5 pin of 8255, and SP couples the voice signal through capacitor C14 and sends it to the telephone interface circuit. When the switch SB1 is pressed, the recording indicator LED lights up and starts recording at the same time. When there is an alarm, the microcontroller controls the DTMF signal sending/receiving circuit to automatically dial a phone call. After the call is connected, the microcontroller sends the instructions and playback instructions to ISD1420 according to the signals sent by different detectors. ISD1420 sends the voice signal to the telephone interface circuit, and after waiting for the playback to be completed, the microcontroller sends a hang-up command, and the alarm is completed.

The D0~D3 ports of MT8880 are connected to the PA0~PA3 ports of 8255 respectively, CLK2 is connected to the PA4 port, R/W is connected to the PA5 port, RSO is connected to the PA6 port, CS is connected to the PA7 port, and IRQ is connected to the T0 port of the main control circuit processor 89C51 to record the number of various pulses. The signal from the voice circuit is sent to the telephone line through R44. Relay K is used to control the on-hook and off-hook operation. The B pole of the transistor is connected to the P1.2 port of the main control circuit processor 89C51. When P1.2 is "1", V2 is turned on, relay K is closed, and the phone is connected. When P1.2 is "0", V2 is turned off and the phone is on-hook.

The P0 port of the main control circuit processor 89C51 is connected to the D0~D7 ports of 8255 and the D0~D7 ports of 74HC373 respectively, the Q0 and Q1 of 74HC373 are connected to the A0 and A1 of 8255 respectively, the P2.5, P2.6, and P2.7 of 89C51 are connected to the A, B, and C ports of 74HC138 respectively, and the YO of 74HC138 is connected to the CS end of 8255.

Software Design

1 Method for identifying signal tones

After the system detects the alarm signal, it simulates picking up the phone. In order to identify whether the telephone system is in a dialable state after simulating picking up the phone, whether the call is connected after the phone dials the number, and whether the other party picks up the phone to answer the call, the system must identify the signal tone. In order to identify the signal tone, the characteristics of various signal tones must be known. The characteristics of various signal tones are as follows.

● Dial tone: 450±25Hz continuous beep.

● Busy tone: A 450 ±25 Hz buzzer tone with a period of 0.35s on and 0.35s off. The tone period is 0.7s.

● Ringback tone: 450±25Hz buzzer tone with 4s off and 1s on, and the tone period is 5s.

These telephone signals are all analog signals, but the microcontroller cannot recognize analog signals, so the analog signals must be converted into pulse signals first, and then recognized according to the number of pulses in the pulse signal. The formula for calculating the number of pulses of these telephone audio signals is N=tm/T. Among them, N is the number of pulses per audio segment cycle; T is the audio cycle of the telephone audio signal, in seconds; tm is the conduction time of the signal audio segment cycle, in seconds.

In actual use, it is mainly necessary to identify the dial tone, busy tone and ringback tone. Analysis of the characteristics of these three signals shows that the number of pulses is different within a certain counting time. In this design, 2s counting is used to determine the dial tone, and 2.8s (i.e. 4 busy tone cycles) is used to determine whether it is a busy tone. Then 1s is used as a counting unit, and the accumulated pulse number after five counts is used to determine whether the other party answers the call. If yes, the corresponding alarm prompt voice is played; otherwise, 1s is counted again, and then the number of pulses in the last 5s is calculated to determine again whether the other party picks up the phone. Repeat this process. If no one answers the call after the waiting time has expired, the phone is hung up. Due to interference and some other factors, it is inevitable that there will be misjudgments and missed alarms. Therefore, only one call is made when at least one of the pre-set calls is dialed. If all are dialed or no one answers, all pre-stored calls are redialed, so that the probability of missed alarms is very low and can be ignored.

[page]

2 Software Flowchart and Dialing Program

The flow chart of the automatic dialing program is shown in Figure 4.

Figure 4 Dialing subroutine flow chart

3 Points to note during programming

First of all, the DTMF generator of MT8880 is the main body of the sending part. It generates all 16 kinds of standard dual-audio signals with low distortion and high precision. These frequencies are generated by the frequency division of 3.579545MHz crystal oscillator. The circuit consists of digital frequency synthesizer, row/column programmable frequency divider, and switched capacitor D/A converter. The row and column single-tone sine waves are mixed and filtered to generate dual-audio signals. The encoded data is written into the MT8880 sending register through the DTMF codec table to generate separate fLOW and fHIGH. Once the encoding is wrong, the dialing will fail. Therefore, be very careful during the programming process.

Secondly, after picking up the phone, there should be a delay before judging the off-hook tone. Because this system uses a mechanical relay to achieve automatic off-hook, the response time of the relay should be considered.

Finally, after dialing one phone number, you cannot dial the next one immediately. The shortest effective time for hanging up should be guaranteed to ensure that the previous phone number has been hung up, otherwise there will be no dial tone when dialing the next phone number.

in conclusion

The system's encoding and decoding are all implemented in software, and the transmission method adopts bidirectional transmission. If an alarm occurs, a data string is sent to the host, which consists of the following parts: 4-bit address code, 8-bit data code, 1 start bit, and 1 parity bit. After receiving the data, the host first checks it. If the data is wrong, it requires the previous data to be resent until it is correct. After receiving the correct data information, the next task is to check the address code. If the address code is the same as the address set by the host, it indicates that the data may be sent from a device outside the system. No decoding is performed. Only when the data with the same address as the host is received will it be decoded.

Reference address:Design of wireless monitoring and alarm system based on pyroelectric infrared sensor

Previous article:Design of an intelligent warning device for outdoor high-voltage devices
Next article:Design of infrared digital image acquisition alarm system

Latest Security Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号