AT89C51 single-chip intelligent voice dialing alarm system

Publisher:创新思绪Latest update time:2012-11-03 Source: 21ic Keywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:AT89C51 Reference address:AT89C51 single-chip intelligent voice dialing alarm system

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

Design of parallel current sharing system of high frequency switching power supply based on AT89C51 single chip microcomputer
  Modularization is the development trend of switching power supplies. Parallel operation is an effective solution for large-capacity power supply products. Capacity expansion can be achieved by designing an N+l redundant power supply system. This system is a parallel connection of multiple high-frequency switching po
[Power Management]
Design of parallel current sharing system of high frequency switching power supply based on AT89C51 single chip microcomputer
Design of constant temperature control system based on AT89C51 microcontroller
1. System Overview The modules used in the system include AT89C51 microcontroller + LCD1602 display + DS18B20 temperature measurement + buzzer alarm + button + fan cooling + small light. The system uses AT89C51 microcontroller as the main control, and uses LCD1602 to display the collected temperature data and temper
[Microcontroller]
Design of constant temperature control system based on AT89C51 microcontroller
Application of AT89C51 single chip microcomputer in cutting force measurement of CNC lathe
  1 Problem statement   In the processing of CNC lathes, the measurement of cutting force is very important. By measuring the cutting force, we can analyze and study the stress conditions and working conditions of various parts, mechanisms or structures of CNC lathes, verify the correctness of the design and calculati
[Microcontroller]
Application of AT89C51 single chip microcomputer in cutting force measurement of CNC lathe
Design of Laser Password Controller Based on AT89C51
This password controller is a photoelectric remote control type, which combines the above two advanced technologies. A specific password is arranged with illumination or no illumination as the basic code, and laser is used as the carrier, and then it is recognized by the receiver, analyzed and judged by the single-c
[Microcontroller]
Digital Thermometer Based on AT89C51 and DS18820
  1 Introduction   With the rapid development of modern information technology and the gradual realization of traditional industrial transformation, temperature detection and display systems that can work independently are applied in many fields. Traditional temperature detection uses thermistors as temperatur
[Microcontroller]
Digital Thermometer Based on AT89C51 and DS18820
Design of control keyboard based on AT89C51
Introduction  In some automated measurement or intelligent equipment, the microcomputer acts as the control center to control and manage multiple functional units to realize the system functions of the instrument and equipment. The keyboard is the basic device for human-computer communication, and the operator uses
[Microcontroller]
Design of control keyboard based on AT89C51
Design and simulation of LED display screen based on mobile data
  As an information display device, LED electronic display screen is mainly used to play advertisements, news, notifications, weather forecasts, time, stock information, flight information, ticket information, etc. It has been increasingly used in bus stops, traffic intersections, buses, ticket halls, business halls,
[Microcontroller]
Design and simulation of LED display screen based on mobile data
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号