1 Introduction

Nowadays, people not only need comfort, health, reliability and convenience in their work and living environment, but also pay more attention to safety and use security systems to improve their ability to withstand various accidents. The current security system can be realized by computer technology, IC card technology, communication technology, etc. The CAN bus is applied to the security system to promote the development of home intelligence. The CAN bus is a widely used field bus. It supports multiple master nodes, has a complete error handling mechanism, fast communication speed, long transmission distance, and many control devices can be attached. The application of DTMF technology to security systems requires no special wiring, no radio frequency resources, and no electromagnetic pollution. In this paper, a new intelligent home security system based on CAN bus and DTMF technology based on AT89S52 single-chip microcomputer is designed, which makes the real-time and reliability of the original community security system have a new level of improvement. The system can monitor the safety environment of the whole home in real time. The scope of monitoring includes a series of unsafe factors such as indoor anti-theft, fire alarm and gas leak. Once the above accident occurs, the alarm system will send out corresponding alarm information, use the voice to broadcast the alarm category, and provide the alarm voice to the remote users and relevant departments.

2 system overall composition

The system block diagram is shown in Figure 1. The single chip computer controls the DTMF transceiver circuit, the digital voice circuit, and the hook control circuit. The detector can quickly and accurately monitor the abnormal condition of the house, notify the controller in time after confirmation, and then control the telephone interface circuit by the single chip microcomputer to realize the analog off-hook, automatically dial the preset telephone number for voice alarm and notify the management center. . When the other party's response is detected, the alert state is automatically restored.

Design of Home Security System Based on AT89S52 and CAN Bus

Figure 1 Block diagram of home security system

3 hardware design

The system main control section, AT89S52 microcontroller, without expanding the external memory. The watchdog circuit uses a programmable serial EEPROM - X25045. The X25045 stores data information such as flag fields, phone numbers, alarm codes, and system settings. The digital voice circuit uses the digital voice chip ISD1420. In the system, the ISD1420 is only used as the basic recording and playback circuit, so all the address lines are set to 0, so the starting address of the playback is 0. The voice signal is picked up by the electret microphone, amplified from the amplifiers input from both ends of the M IC and M IC REF, and the audio signal after the power amplifier is used from the SP+ to be connected to the talk circuit to send the voice signal.

3. 1 ringing detection and simulation hook unit

The system is at the two ends of the telephone line and is always in the monitoring state, which will not affect the normal operation of the telephone. Ring detection is performed when the system receives a ring signal. The ringing signal is connected to the P3. 4 port of the AT89S52 via three inverters. If no one answers after 5 rings, the system enters the automatic off-hook state. The single-chip P1. 2 pin outputs a high level, the transistor V501 is turned on, then the relay K1 acts, and the load resistor is connected to the circuit to realize analog off-hook. After that, a current of more than 10 mA will appear on the telephone line. After the switching center detects this current, it will no longer output the ringing signal but will switch to the telephone. If the ringing signal does not reach the preset value, it disappears, and the count value of the MCU is cleared, and the controller does not operate.

3. 2 DTMF transceiver unit

The DTMF transceiver circuit uses the DTMF signal encoding/decoding chip MT8880[5] chip. The MCU sends out the telephone number through the DTMF transceiver circuit to make a telephone alarm. The DTMF transceiver circuit is shown in Figure 2.

Design of Home Security System Based on AT89S52 and CAN Bus

Figure 2 DTMF transceiver circuit

MT8880 provides an interface to the micro-processor coupled to its transmission, reception and control the operation mode. Its receiving part uses a single-ended input consisting of R27, R28 and C16 with an input voltage gain of 1. The gain of the input signal can be adjusted by changing R28. Its transmitting part is composed of R29, C17, C18 and XTAL2. Its control part consists of R30 and C19. The IRQ /CP is connected to the P3. 5 pin of the microcontroller. When the MT8880 receives a valid dual tone multi-frequency signal, the microcontroller performs interrupt processing. The IN-end of MT8880 is connected to the QR end of the call circuit TEA 1062, and the TONE end of MT8880 is connected to the DTMF end of TEA1062.

3. 3 call unit

The call circuit uses the telephone dedicated call integrated circuit TEA1062. When sending a message, the voice signal (from ISD1420) is input through the M IC + pin, and the DTMF signal (from MT8880) is input through the DTMF pin, amplified by the TEA1062, and sent to the telephone line from the LN pin. When receiving the signal, the signal is input from the IR pin through the elimination side tone network, amplified and output from the pin QR, divided into two ways: one way to the ANA IN end of the ISD1420 for voice recording, and the other way to the IN of the MT8880. The terminal extracts the DTMF signal.

3. 4 CAN bus data transmission unit

The CAN bus data transmission unit consists of two parts, one is the CAN controller to realize the interaction and control of the bus data, and the other is the CAN data transceiver to realize the data transmission.

The AT89S52 of the single-chip microcomputer realizes the access to the bus by controlling the CAN controller, and is also responsible for the measurement and control of the functional unit. The CAN bus interface circuit is shown in Fig. 3.

Design of Home Security System Based on AT89S52 and CAN Bus

Figure 3 CAN bus interface circuit

The AT89S52 accesses the CAN controller SJA1000 through the interrupt mode. In order to enhance the anti-jamming capability of the CAN bus node, the SJA1000 is connected to the CAN bus driver PCA82C50 through the high-speed optocoupler 6N137. The CANH and CANL pins of the PCA82C50 are connected to a CAN bus by a 5 Ω resistor, which can be used as a current limiting function to prevent the PCA82C50 from being subjected to overcurrent surge.

4 software design

The software of the system adopts modular design, which mainly includes main program module, CAN communication module, ringing detection module, voice alarm module, DTMF transceiver module, etc. The main program and CAN communication module design are mainly introduced here.

4. 1 main program design

The main program mainly completes the call of each function module, detects the system input, and then performs judgment processing according to the system status. The program must perform the necessary initialization before the main loop, such as MT8880, ISD1420, SJA1000 related flags. The main program flow is shown in Figure 4.

Design of Home Security System Based on AT89S52 and CAN Bus

Figure 4 main program flow chart

4. 2 CAN communication module design

The CAN communication module includes controller initialization, data reception, and transmission subroutines. The SJA1000 has two states, reset mode and active mode. The register configuration is different in the two states. When the parameters are set, the CPU issues a command and the SJA1000 is in working state for normal communication. If the communication is in error, the CPU will return the SJA1000 to the reset mode. The receiving module is responsible for receiving and processing related node messages. During the receiving process, the CPU reads the data and determines the type of the data frame according to the command word for different processing. The sending module is responsible for sending the message. Before the SJA1000 sends the data, it is judged whether the sending condition is satisfied. If it is satisfied, the message frame information, the identifier and the data to be sent are written into the buffer, and then sent. The sending and receiving flow chart of JA 1000 is shown in Figure 5.

Design of Home Security System Based on AT89S52 and CAN Bus

Figure 5 JA 1000 transmission and reception flow chart

5 Conclusion

The system takes the AT89S52 single-chip microcomputer as the core, and does not need to make any modification to the telephone network to realize automatic detection and voice alarm for the home fortification point. In the design, the CAN bus structure is used to form the security system, which has better flexibility and expandability. At the same time, the CAN bus is used to introduce real-time data processing, which improves the reliability of the system. It can be used for building visual intercom, intelligent community management, access control management, etc.

0 times
Window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": " 0", "bdSize": "24" }, "share": {}, "image": { "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "Share to:", "viewSize": "16" }, "selectShare": { "bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren" , "weixin"] } }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share. Baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];

Nail File

Mini Nail Files,Glass Nail File,Christmas Nail Files,Crystal Nail Files

YANGJIANG TRI-WIN INDUSTRY & TRADE CO.,LTD , https://www.triwintableware.com