AT89C52 Intelligent Wireless Security Alarm Application Analysis

introduction

Security alarm systems are now receiving more and more attention from people, and people are increasingly demanding alarm functions and performance. This article proposes a smart wireless security alarm based on AT89C52: it can connect wirelessly with standard security probes, realize large-scale security monitoring, and can be expanded at will. Multiple zone features. Be able to distinguish between various warnings and be able to broadcast warnings by voice. Automatic telephone alarm, to provide remote users with warning voice and live sound, and receive user instructions for corresponding operations. Multi-function free switching, low false alarm rate, high reliability. Easy to use, high cost performance.

This alarm is serially connected between the outside line and the user's ordinary telephone. The input of alarm number, recording of alarm voice, input of wireless sensor, and setting of other host parameters are all done 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 computer receives a coded signal from the wireless probe, the host computer compares the code with the original code and checks the system parameters to decide whether to alarm or not. It can automatically dial out the alarm phone set by the user and inform the police through the voice. The user can monitor the live sound, and can also activate the alarm and other executing agencies (such as preventing gas leaks, start the exhaust fan) through the telephone command, and decide the host enters the deployment. Still disarmed. Users can also take the initiative to call the host from different places, arm or disarm the host.

system structure

The core part of this system is AT89C52. Other main unit circuits are: wireless code receiving circuit, DTMF transceiver circuit, digital voice circuit, call circuit, line switching circuit, disconnection detection and ringback detection circuit, and power supply and backup power supply circuit. Wait. System block diagram shown in Figure 1.

SCM, watchdog circuit, wireless code receiving circuit

MCS-51 series AT89C52 single-chip microcomputer is used, it has 8K EEPROM, no need to expand the external memory. 256 bytes of RAM and 32 lines of I/O ports can fully meet the requirements of this system. The watchdog circuit uses the X5045, a programmable circuit that combines the three functions of a watchdog, voltage monitor, and serial EEPROM. Its internal 512-byte EEPROM is used to store the wireless probe's encoding and some system setup parameters. The X5045 provides 1,000,000 erases and 100 years of data retention. Wireless encoding receiver uses a common super-regenerating receiving module, frequency 315MHz, ASK mode, does not contain decoding chip PT2272 (using software decoding), corresponding to the wireless probe end of the encoding chip PT2262, there are 312 kinds of encoding, to ensure sufficient confidentiality. The module's signal output is directly connected to the microcontroller's P1.1 software decoding.

DTMF transceiver circuit
DTMF (dual-tone multi-frequency) transceiver circuit shown in Figure 2, its core chip MT8880, can receive and send all DTMF 16 signals, with a call tones and band-pass filtering, and can directly interface with the microprocessor. The one-chip computer dials out the telephone number through DTMF transceives the circuit to carry on the telephone warning, and receives the remote user's telephone telecontrol order to carry on the corresponding operation. The input and output signals of the DTMF circuit are all gain-adjusted via a signal amplification circuit (with the TEA1062 as the core).

Digital voice recording and reproducing circuit
Digital voice recording and playback circuit shown in Figure 3. The digital speech chip ISD1420 used is based on advanced analog digital voice storage technology. It has good sound quality and does not require A/D conversion. It can record 20 seconds of voice information, can store information in segments, use bus technology, and is suitable for interface with microcontrollers. In addition, it is a zero-power information storage method. In the case of power failure, information can be retained for more than 10 years; it is easy to use, can change the recording content at will, and the number of recording and playback is more than 100,000 times. In this system, the user enters various alert voices and user's address voice (which is easily networked with the 110) into the ISD 1420 through the telephone. Six kinds of warnings (or corresponding six defense zones) total 6 × 2 seconds = 12 seconds, address voice 8 seconds. When using the ISD1400 series speech chip, it should be noted that a 0.1mF capacitor is connected between REC and VCC to prevent the recording operation from destroying the original recorded information during power-on.

Talking circuit

The TEA1062 is a telephone-only call integrated circuit. When sending a call, the voice signal (from the ISD1420 and the resident group microphone) is input through the MIC+ pin, and the DTMF signal (from the MT8880) is input through the DTMF pin, and after being amplified by the TEA1062 is sent from the LN pin to the telephone outside line. When receiving the call, the signal passes through the cancellation side tone network and is input from the IR pin. After being amplified, the signal is output from the pin QR and divided into two ways: all the way to the ANA-IN terminal of the ISD1420 for voice recording, and the other to the IN of the MT8880. - The end extracts the DTMF signal.

Disconnection, ringback detection circuit

In order to prevent phone line failure or man-made damage caused by the phone can not alarm, as a remedial measure, the system is added to the disconnection detection circuit, Figure 4 for the broken line, 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 of the telephone network to ensure that the leakage current of the outside line is less than 15mA. The other is made up of optocoupler 4N33. The external line voltage is sent to the B terminal of 4N33. If the line is suddenly cut off when the alarm occurs, the C terminal jumps to the high level. At this time, the MCU will automatically switch from the alarm mode to the siren alarm mode. It serves the purpose of double protection. At the same time, 4N33 also constitutes a ringback detection circuit. When the user calls from the remote site to the host for arming and disarming operation, the ringing signal is sent to the IN+ and IN- pins of the 4N33 through the polyester capacitor and the rectifier bridge, causing a jump at the C terminal level. Opto-isolation prevents high-voltage ringing signals from entering the host. When the host detects that the ringing signal has reached the appropriate number of times, the host automatically picks up the phone and receives the user-entered password. If the password is correct, the host computer begins to accept the user's remote command.

Line switching, telephone setting circuit

The circuit switching circuit is composed of two double-knife dual-setting relays to realize the switchover of the connection relationship between the host, the outside line and the telephone. Normally, the outside line is connected with the telephone; when the alarm is active and remotely monitored, the outside line is connected with the host; when setting up the host (including recording the alarm phone number, recording voice, and other parameter settings), the host disconnects the outside line, only with the phone. The machine is connected. At this time, the host needs to supply power to the 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 switch is set to ON, the constant current source is input and the software is transferred to the setting subroutine of the response.

Backup power circuit, display circuit, drive circuit

In order to ensure that the mains power is off, the main unit can still carry out the telephone alarm. There is a backup power circuit in this system, as shown in Figure 5. With 4 1.2V nickel-cadmium rechargeable batteries as a backup power supply, when the power is insufficient, it can automatically charge constant current; using the voltage detection module HT7050A, the battery automatically stops charging after full charge. When the utility power fails, the electronic switch is turned on and the backup power supply is connected to the system.

Because there are voices to distinguish between alarm conditions, the system does not require a high level of display circuitry. Use a light-emitting diode as a power indicator, and then use a light-emitting diode to indicate the working status: arming (lighting), disarming (extinguishing), or alarming (flashing) to meet the requirements. Actuators are used for special occasions, such as starting exhaust fans in case of gas leaks. In order to ensure that the actuator has enough drive capability, the system uses a zero-crossing trigger optocoupler MOC3041 to drive the triac, which can have 220V, 10A drive capacity.

System software design

The system software adopts a modular structure and subroutine nesting technology. It has good readability and is easy to compile and expand. The main flow uses the sequential inquiry method to detect the wireless coded signal, the switch status of the set button, and the external ringing signal. The time for detecting the last two signals is very short, and it can be considered that the host is receiving the wireless encoded signal at any time.

Main program flow

The main program flow is shown in Figure 6. It loops repeatedly, calling the following main subroutines:

(1) Wireless code detection program. If a valid signal is detected, it goes to the software simulation PT2272 decoding subroutine and alarm subroutine.

(2) Set button state detection. If the setting switch is on, go to the setting subroutine and set the host parameters.

(3) External ring detection program. If the ring reaches the set number of times, it goes to the monitoring subroutine. Through parameter setting, it is also possible to prohibit off-site active monitoring.

A brief introduction to the main subroutines for setting up subroutine processes

(1) Alarm subroutine: determine whether the alarm, which alarm mode (telephone alarm, alarm alarm or both). If the telephone alarm mode is used, it will call the dialing subroutine to dial out the pre-set alarm call and select the appropriate voice to be sent to the telephone line. During this process, it will also detect whether there is a disarm signal from the remote control. Or the user's anti-control signal.

(2) Monitoring Subroutines: When the user calls the host to perform arming, disarming, or other operations at a remote location, the monitoring subroutine receives the user's instructions. It first checks the user's password to see if it is a legitimate user. If so, the monitoring subroutine can arm, disarm, activate the siren, and switch relay output ports according to the user's instructions.

Points to note

(1) Wirelessly encoded software decoding. This alarm device uses software to simulate the PT2272 to perform software decoding so that the alarm device can receive the code regardless of the address code of the transmitting terminal PT2262. When the hardware PT2272 is used for decoding, it can only decode successfully if it is completely consistent with the PT2262 address code. Since a single alarm host must be able to connect wirelessly with multiple wireless sensor probes and be able to distinguish between the various probes for the purpose of partitioning, software decoding must be used.

(2) Host's anti-false alarm function. During the use of this alarm device, we found that most of the smoke detectors have the problem of battery voltage drop (the 9 volt battery dropped to about 7.5 volts) and cause a false signal, which leads to false alarms from the host. This is a common problem with similar alarms. According to the research on the characteristics of the low-electricity false alarm of the smoke detector, it was found that the code signal sent by the smoke detector was shorter than normal alarm at this time. Therefore, a sensitivity adjustment module was added in the program and it was stipulated that only valid signals were received for several consecutive times ( The host only starts alarming for the zone with the smoke sensor. Sensitivity is adjustable in six levels. As long as the setting is appropriate, sensitivity and reliability can be taken into consideration to solve the problem of false alarm of smoke sensor.

(3) The flexibility of the host's working methods. In the software, more than 30 instructions are defined, which can be used to select various operating methods for the host, and the parameter size can be set to facilitate debugging by the debugging personnel. It is also convenient for users to use and maximize the functions of the software.

Conclusion

The security alarm introduced in this article can be partitioned, has an automatic telephone voice alarm function, uses an ordinary telephone as a keyboard to set the alarm host, and realizes powerful functions through software. Taking into account the scalability, the software contains networking subroutines, which can be networked with the PCs in the monitoring center, and is suitable for centralized management in communities and buildings.

Screwdriver

Multifunction Cross Switch Screwdriver,Double Head Screwdriver,Cross Flat Screwdriver,Plastic Handle Screwdriver

Yucheng Weisite Measuring Tools Co., Ltd , https://www.wsttool.com