Intelligent Wireless Security Alarm Based on AT89C52

Publisher:seanxnieLatest update time:2013-12-30 Source: 21ic Keywords:AT89C52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Introduction
    Nowadays, people pay more and more attention to the security alarm system, and people have higher and higher requirements for the functions and performance of the alarm. This paper proposes an intelligent wireless security alarm based on AT89C52:
it can be wirelessly connected with standard security probes to achieve large-scale security monitoring and can be expanded at will.
Multi-zone function. It can distinguish various alarm situations and broadcast the alarm situation categories by voice.
Automatic telephone alarm, provide alarm voice and on-site sound to remote users, and receive user instructions for corresponding operations.
Multi-function free switching, low false alarm rate, high reliability.
Easy to use, with high cost performance.
    This alarm is connected in series between the outside line and the user's ordinary telephone. The input of the alarm number, the recording of the alarm voice, the entry of the wireless sensor and the setting of other host parameters are all completed through the telephone, which does not affect the work of the telephone at ordinary times. The user uses the remote control to arm or disarm the host. When the host receives the coded signal sent from the wireless probe, the host compares the code with the original stored code, and queries the system parameters to decide whether to alarm and what method to take. It can automatically dial the alarm number set by the user and inform the user of the alarm situation through voice. The user can monitor the sound on the scene and activate the alarm and other actuators (such as preventing gas leakage and starting the exhaust fan) through telephone commands, and decide whether the host enters the arming or disarming state. The user can also actively call the host from a different location to arm or disarm the host.

Figure 2 DTMF transceiver circuit

Figure 3 Digital voice recording and playback circuit

Figure 4: Disconnection and ringback detection circuit

Figure 5 Backup power supply circuit

Figure 6 Main program flow chart

System Structure
    The core of this system is AT89C52. Other main unit circuits include: wireless coding receiving circuit, DTMF transceiver circuit, digital voice circuit, call circuit, line switching circuit, disconnection detection and ringback detection circuit, as well as power supply and backup power supply circuit. The system block diagram is shown in Figure 1. [page]

The single-chip microcomputer, watchdog circuit, and wireless coding receiving circuit
    use the AT89C52 single-chip microcomputer of the MCS-51 series. It has 8K EEPROM and does not need to expand external memory. 256 bytes of RAM and 32-line I/O ports can fully meet the requirements of this system. The watchdog circuit uses X5045, which is a programmable circuit that integrates three functions of watchdog, voltage monitoring and serial EEPROM. Its internal 512-byte EEPROM is used to store the code of the wireless probe and some system setting parameters. X5045 can provide 1,000,000 erases and writes and 100 years of data retention. The wireless coding reception adopts the common super regenerative receiving module, frequency 315MHz, ASK mode, without decoding chip PT2272 (using software decoding), corresponding to the encoding chip PT2262 at the wireless probe end, with 312 kinds of encoding, ensuring sufficient confidentiality. The signal output end of the module is directly connected to P1.1 of the microcontroller for software decoding.

DTMF transceiver circuit
    The DTMF (dual tone multi-frequency) transceiver circuit is shown in Figure 2. Its core chip is MT8880, which can receive and send all 16 DTMF signals, has the function of receiving call tone and bandpass filtering, and can directly interface with the microprocessor. The microcontroller dials the phone number through the DTMF transceiver circuit for telephone alarm, and receives the telephone remote control command from the remote user for corresponding operation. The input and output signals of the DTMF circuit will pass through the signal amplifier circuit (with TEA1062 as the core) for gain adjustment.

Digital voice recording and playback circuit
    The digital voice recording and playback circuit is shown in Figure 3. The digital voice chip ISD1420 uses advanced analog digital voice storage technology, good sound quality, no A/D conversion required, can record 20 seconds of voice information, can store information in segments, uses bus technology, and is suitable for interface with single-chip microcomputers. In addition, it is a zero-power information storage method. In the case of power failure, the information can be retained for more than 10 years; it is easy to use, the recording content can be changed at will, and the recording and playback times can reach more than 100,000 times. In this system, users use telephones to enter various alarm voices and user address voices (for networking with 110) in segments into ISD1420. 6 types of alarms (or corresponding to 6 defense zones) total 62 seconds = 12 seconds, and address voice 8 seconds. When using the ISD1400 series voice chip, pay attention to connecting a 0.1mF capacitor between REC and VCC to prevent recording operations from occurring when power is on and destroying the original recorded information.

The call circuit
    TEA1062 is a dedicated call integrated circuit for telephones. When sending a call, the voice signal (from ISD1420 and the collective microphone) is input through the MIC+ pin, and the DTMF signal (from MT8880) is input through the DTMF pin. After being amplified by TEA1062, it is sent to the telephone line from the LN pin. When receiving a call, the signal is input from the IR pin through the sidetone cancellation network, and is output from the QR pin after amplification. It is divided into two paths: one is sent to the ANA-IN terminal of ISD1420 for voice recording, and the other is sent to the IN- terminal of MT8880 to extract the DTMF signal.

The disconnection and ringback detection circuit
    is a remedial measure to prevent the telephone line from failing to alarm due to failure or human damage. The disconnection detection circuit is added to this system as a remedial measure. Figure 4 shows the disconnection and ringback detection circuit. There are two disconnection detection circuits. One is a high input impedance detection circuit composed of a rectifier bridge and 9018, which is used to detect the line voltage of the telephone line at ordinary times and is part of the host self-test. This circuit should meet the requirements for telephone access to the network and ensure that the leakage current of the external line is below 15mA. The other is composed of the optocoupler 4N33. The voltage of the external line is sent to the B terminal of 4N33. If the external line is suddenly cut off during the telephone alarm, the C terminal jumps to a high level. At this time, the single-chip microcomputer will automatically switch from the telephone alarm mode to the alarm mode, achieving the purpose of double protection. At the same time, 4N33 also constitutes a ringback detection circuit. When the user calls the host from a different place to arm and disarm, the ringing signal is sent to the IN+ and IN- pins of 4N33 through the polyester capacitor and the rectifier bridge, causing the C terminal level to jump. Optical isolation can prevent high-voltage ringing signals from entering the host. When the host detects that the ringing signal reaches the corresponding number of times, the host automatically picks up the phone and receives the password entered by the user. If the password is correct, the host begins to accept the user's remote control instructions.

Line switching, telephone setting circuit The line
    switching circuit consists of two double-pole double-position relays to realize the switching of the connection relationship between the host, the external line, and the telephone. Normally, the external line is connected to the telephone; when an alarm is triggered and when active monitoring is performed remotely, the external line is connected to the host; when setting the host (including recording the alarm phone number, recording voice, and other parameter settings), the host disconnects the external line and is only connected to the telephone. At this time, the host needs to provide power to TEA1062 through a constant current source. The constant current source consists of a light-emitting diode, S8550, and several resistors. Whether to enter the setting state is determined by a setting switch. When the setting switch is turned on, the constant current source is turned on, and the software enters the corresponding setting subroutine.

Backup power supply circuit, display circuit, and drive circuit
    To ensure that the host can still make a telephone alarm when the city power is cut off, a backup power supply circuit is provided in this system, as shown in Figure 5. Four 1.2V nickel-cadmium rechargeable batteries are used as backup power supplies, which can automatically charge at a constant current when the power is insufficient; using the voltage detection module HT7050A, the battery automatically stops charging when it is fully charged. When the city power is cut off, the electronic switch is turned on and the backup power supply is connected to the system.
    Since there is voice to distinguish the alarm category, the system does not have high requirements for the display circuit. Using one LED as power indicator and another LED to indicate the working status: armed (lit), disarmed (off) or in alarm (flashing) can meet the requirements. The
    actuator is used in some special occasions, such as starting the exhaust fan in case of gas leakage. To ensure that the actuator has sufficient driving capacity, the system uses zero-crossing trigger optocoupler MOC3041 to drive the bidirectional thyristor, which can have a driving capacity of 220V and 10A.

System software design
    The system software adopts modular structure and subroutine nesting technology, which has good readability and is easy to compile and expand. The main process adopts sequential query method to detect wireless coding signals, the switch status of setting buttons, and external ringing signals respectively. The time used to detect the latter two signals is very short, and it can be considered that the host is receiving wireless coding signals at any time.

Main program flow
    The main program flow is shown in Figure 6. It repeatedly loops and calls the following main subroutines:
(1) Wireless coding detection program. If a valid signal is detected, it will transfer to the software simulation PT2272 decoding subroutine and alarm subroutine.
(2) Setting button status detection. If the setting switch is turned on, it will transfer to the setting subroutine to set the host parameters.
(3) External ringing detection program. If the ringing reaches the set number of times, it will transfer to the monitoring subroutine. Through parameter setting, remote active monitoring can also be prohibited.

Setting subroutine flow 
    The setting subroutine flow is shown in Figure 7. 
    Brief introduction of main subroutines
(1) Alarm subroutine: Determine whether to alarm and what alarm method to use (telephone alarm, siren alarm or both alarms). If the telephone alarm method is used, it will call the dialing subroutine to dial the pre-set alarm phone number and select the appropriate voice to broadcast to the telephone line. During this process, it will also detect whether there is a disarming signal from the remote control or a reverse control signal from the user end.
(2) Monitoring subroutine: When the user calls the host in a different location to arm, disarm or perform other operations, the monitoring subroutine will receive these instructions from the user. It first verifies the user password to see if it is a legitimate user. If so, the monitoring subroutine can arm, disarm, activate the alarm, switch the relay output port, etc. according to the user's instructions.
A few points to note
(1) Software decoding of wireless code. This alarm uses software to simulate PT2272 for software decoding, so that no matter what the address code of the transmitter PT2262 is, the alarm can receive the code. When using hardware PT2272 for decoding, it can only be successfully decoded when it is completely consistent with the address code of PT2262. Since an alarm host needs to be able to wirelessly connect to multiple wireless sensor probes and be able to distinguish each probe to achieve the purpose of partitioning, software decoding must be used.
(2) The host's anti-false alarm function. During the use of this alarm, we found that most smoke detectors had the problem of battery voltage drop (9 volt battery dropped to about 7.5 volts) causing false signals, which would cause false alarms in the host. This is a common problem with similar alarms. Based on the research on the false alarm characteristics of low-power smoke detectors, it was found that the code signal sent by the smoke detector at this time was shorter than that of the normal alarm. Therefore, a sensitivity adjustment module was added to the program, stipulating that the host will only start the alarm after receiving valid signals several times in a row (only for the defense zone equipped with smoke detectors). The sensitivity is adjustable in 6 levels. As long as the setting is appropriate, sensitivity and reliability can be taken into account to solve the false alarm problem of smoke detectors.
(3) The flexibility of the host's working mode. More than 30 instructions are defined in the software, which can select various working modes for the host and set the parameter size, which is convenient for debugging personnel and users to use, and maximize the functions of the software.

Conclusion 
    The security alarm introduced in this article can realize partitioning and has an automatic telephone voice alarm function. It uses an ordinary telephone as a keyboard to set the alarm host and realize powerful functions through software. Taking scalability into consideration, the software contains a networking subroutine that can be connected to the PC in the monitoring center, making it suitable for centralized management in communities, buildings and other places.

Keywords:AT89C52 Reference address:Intelligent Wireless Security Alarm Based on AT89C52

Previous article:Application of DS18B20 in temperature detection system
Next article:Gas state monitoring system based on intelligent sensor NPX

Recommended ReadingLatest update time:2024-11-16 14:42

AT89C52 single chip eight-way voltage meter C program
/************************************************************************/  // Eight-way voltmeter C program  /************************************************************************/  /*Use AT89C52 single-chip computer, 12MHz crystal oscillator, P0 port reads AD value, P2 port is used for AD control, use common anod
[Microcontroller]
Important knowledge map of AT89C52 microcontroller
Memory space distribution diagram Internal RAM distribution diagram So the special function registers SFR Reset value of SFR PSW Program Status Word Register Power Control Register PCON TCON (Timer Control): Mainly for timer/counter interrupt flag control and external interrupt control   T2CON SCON (
[Microcontroller]
Important knowledge map of AT89C52 microcontroller
Design of Digital Controlled DC Current Source Based on AT89C52
The digitally controlled DC current source designed in this paper can effectively reduce the output error caused by aging of components, temperature drift, etc., and has the functions of output current between 20-2000mA (adjustable), preset output current, and direct display of output current signal. The hardwar
[Microcontroller]
Design of Digital Controlled DC Current Source Based on AT89C52
Design of Data Collector Based on Small-RTOS51
introduction   With the development of embedded systems, embedded software design is moving closer to software platforms. Microcontroller software design is no longer a single-threaded structure, but gradually adopts a multi-tasking design concept. The real-time kernel is also called a real-time operating system or
[Microcontroller]
Design of Data Collector Based on Small-RTOS51
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号