With the improvement of people's living standards and the enhancement of security awareness, it is urgent to develop an automatic alarm system that is affordable and reliable for the general public. In view of the popularity of residential telephones and mobile communication devices, as well as the advantages of telephone voice alarms, such as speed, effectiveness and low price, the public communication network has become the best transmission medium for alarm systems. The alarm system introduced in this article is an intelligent voice dialing alarm system developed on this basis. The system can be widely used in various occasions with high security requirements, such as intelligent buildings, shopping malls, banks and factories.
The main function of the automatic telephone alarm is: users can pre-store their mobile phone numbers, office numbers or the telephone numbers of the alarm monitoring center into the alarm host according to their needs. The alarm host continuously inspects the status of the monitored equipment (access control, smoke detectors, window magnets, cameras, etc.). When an unsafe situation (such as fire, illegal entry, video loss, etc.) occurs, the alarm host dials the pre-stored phone number and plays the corresponding alarm voice. If the phone is busy or no one answers, you can dial a pre-stored phone number. If all pre-stored phones are busy or no one answers, all pre-stored phones will be automatically redialed, ensuring the effectiveness and reliability of the alarm.
1 System composition and working principle
The system composition block diagram is shown in Figure 1. The AT89C51 single-chip microcomputer is used as the control core, and the external E2PROM is used to store telephone numbers, set parameters (timing arming/disarming, linkage, video, etc.) and alarm information. When the AT89C51 single-chip microcomputer detects a new alarm signal in real time (zone failure, video loss, main power failure or host computer crash), the alarm host will automatically process the alarm (sound and light alarm, start corresponding linkage, record alarm and dial alarm, etc.).
The working principle of the dial alarm is as follows:
the system automatically controls the off-hook/on-hook circuit to simulate off-hook, and at the same time, the AT89C51 single-chip microcomputer sets the MT8880 to call mode through the programmable parallel interface 8255 to detect whether there is a dial tone. If there is a dial tone, the MT8880 is set to burst mode and automatically dials the user's preset phone number. After dialing the phone number, it immediately detects whether the other party has picked up the phone. Once it detects that the other party has picked up the phone, the voice prompt circuit is activated to send a voice message consistent with the alarm situation, completing the automatic dialing alarm.
2 Hardware Design
2.1 Alarm Acquisition
Circuit The signal acquisition circuit consists of a 16-channel defense zone input signal acquisition circuit and a 16-channel video loss detection acquisition circuit. The 16-channel defense zone input signal acquisition circuit is shown in Figure 2. The acquisition circuit is connected to the P0 port of the AT89C51 microcontroller through a programmable parallel interface chip 8255, and the 16-channel defense zone input signal is connected to the PA port and PB port of the 8255 after photoelectric isolation. The PA port and the PB port are both set as input ports, and these 16 input ports correspond to the inputs of the 16 detectors respectively. The system determines whether an alarm occurs by collecting data from the PA and PB ports of the 8255.
The 16-channel video loss detection acquisition circuit is shown in Figure 3. The circuit first selects the video path through a 16-channel analog switch chip CD4067, then passes through the video signal detection circuit, and finally connects to the P1.3 port of the AT89C51 microcontroller. The system first sends the video channel number to the analog switch CD4067, and then sends the collected data to the P1.3 port to determine whether the video is lost.
2.2 Interface between DTMF sending and receiving circuit MT8880 and AT89C51 and voice circuit
MT8880 is a special integrated circuit chip launched by MITEL for processing DTMF signals. It not only has the automatic dialing function of receiving and sending DTMF signals, but also can detect signal tones such as dial tone, ringback tone and busy tone on the telephone trunk line. It is suitable for interfacing with a single-chip microcomputer, and the peripheral circuit is simple.
There are five registers inside MT8880, namely the receiving data register, the sending data register, the transceiver control registers CRA and CRB, and the transceiver status register. In this design, since only the sending data register, the transceiver control registers CRA and CRB are used to send DTMF signals to realize the automatic dialing function, only these three registers are introduced here. The data in the sending data register determines the frequency of the dual audio signal to be sent, so data can only be written to the sending 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. Its interface circuit is shown in Figure 4.
The ISD1420 voice chip uses direct analog storage technology, and has excellent recording and playback sound quality and 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 dedicated 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. Its interface circuit diagram is shown in Figure 4. [page]
Voice segmentation method: Address input terminals A0~A7 are arranged from low to high, each address represents 125ms of addressing, 160 addresses cover 20s of voice range (160×0.125s=20s), recording and playback functions start from the set starting address, the end of recording is determined by the stop operation, the chip automatically inserts the end mark (EOM) at the end position of the segment; and when the EOM mark is encountered during playback, the playback is automatically stopped. In this design, because four segments of alarm prompt voice are required, each segment of voice is set to 5s during the design, and its starting addresses are 00000000B, 00101000B, 01010000B, and 01111000B, respectively. From these four starting addresses, it can be seen that A7, A2, A1, and A0 are all 0, so they are grounded.
3 Software Design
3.1 Signal Tone Identification Method
The system simulates picking up the phone after detecting the alarm signal. 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 buzzer;
- Busy tone: 450±25Hz buzzer tone with 0.35s on and 0.35s off, and tone-on and off cycle of 0.7s;
- Ringback tone: 450±25Hz buzzer tone with 4s off and 1s on, and the tone-off cycle 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 of the pulse signal. The number of pulses of these telephone audio signals can be calculated by the following formula:
N=tm/T
, where 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 on time of the signal tone off cycle, in seconds.
In actual use, it is mainly necessary to identify 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. At the beginning of the design, it was considered to use 5s as a counting unit to judge these three signal tones, but through actual debugging, it was found that when the other party picked up the phone, it took a while to hear the alarm voice. After repeated research and debugging, 2s counting was finally used to judge the dial tone, and 2.8s (i.e. 4 busy tone cycles) was used to judge whether it was a busy tone. If not, it means that the call was dialed. 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, another 1s is counted, and then the pulse number in the last 5s is calculated to determine whether the other party picks up the phone again. This is repeated until no one answers the call after the waiting time has expired, and then the phone is hung up. Due to interference and some other factors, it is inevitable that there will be misjudgments and missed alarms. Therefore, if at least one of all the pre-set calls is dialed, it is dialed only once. If none of them are dialed or no one answers, all the pre-stored calls are redialed. In this way, the probability of missed alarms is very low and can be ignored.
3.2 Software Settings
The flowchart of the automatic dialing program is shown in Figure 5. The following is part of the automatic dialing program.
AUTOCALL: CLR P1.2 ;Simulate off-hook
MOV A,#5DH ;Allow signal tone output, next time is to write control register CRB
MOVX @DPTR,A ;Write control register CRA
MOV A,#51H ;MT8880 is set to burst mode
MOVX @DPTR,A ;Write control register CRB
MOV A,#56H ;MT8880 is set to call mode
MOVX @DPTR,A ;Write control register CRA
LCALL DELAY
LCALL AUTOY ;Call signal tone identification subroutine to see if there is dial tone
MOV A,#5DH ;Allow signal tone output, next time is to write control register CRB
MOVX @DPTR,A ;Write control register CRA
MOV A,#50H ;MT8880 is set to burst mode
MOVX @DPTR,A ;Write control register CRB
…… ;Dial phone number
MOV A,#56H ;MT8880 is set to call mode
MOVX @DPTR,A ;Write control register CRA
LCALL AUTOY ;Call the signal tone discrimination subroutine to see if there is a ringback tone
LCALL AUTOY ;Call the signal tone discrimination subroutine to see if the other party picks up the phone
SETB P1.2 ;Simulate hanging up
3.3 Points to note during programming
First, the DTMF generator of MT8880 is the main body of the sending part. It generates all sixteen kinds of standard dual-tone signals with low distortion and high precision. These frequencies are generated by the frequency division of the 3.579545MHz crystal oscillator. The circuit consists of a digital frequency synthesizer, a row/column programmable frequency divider, and a switched capacitor D/A converter. The row and column single-tone sine waves are mixed and filtered to generate dual-tone 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, so be very careful during the programming process. The codec table can be found in the MT8880 Datasheet.
Secondly, after picking up the phone, a delay of some time should be made before judging the off-hook tone, because this system uses a mechanical relay to achieve automatic off-hook, so the response time of the relay should be considered.
Finally, after dialing a phone number, the next phone number cannot be dialed immediately. The shortest effective time of 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.
This system has flexible configuration and can be effectively and quickly applied to occasions with relatively high security requirements. For example: for occasions where video loss does not need to be monitored, video monitoring boxes can be omitted; and for smart communities, hospitals, etc., a DVR (Digital Video Recorder) host, a set of alarm monitoring software and multiple alarm hosts can be combined together through the RS485 bus to form a network-based intelligent monitoring system.
This alarm system has the advantages of low price, simple operation, fast communication speed, high reliability and low false alarm rate.
Previous article:C8051F320 and its USB interface application
Next article:Single chip microcomputer controlled stepper motor automatic positioning system
Recommended ReadingLatest update time:2024-11-16 19:30
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- micropython update: 2021.4
- The battery voltage is pulled down
- Is there any abnormal sound from the common mode inductor?
- There's a problem with the project
- bq27411-g1 (single-cell fuel gauge) bq27541 (single-cell fuel gauge) bq27546-g1 (single-cell fuel gauge)
- Playing with circuits (2) - Killing LM5175
- A post in the Audiophile Academy. I just want to ask why there is no loop phase shift when a resistor is added before the decoupling capacitor.
- TI teaches you how to overcome the three common problems in high-speed amplifier design
- Is it suitable to learn Java right after graduating from university?
- [Social Recruitment] Senior Comprehensive STA R&D Engineer