Smart Home Design Solution Reference Collection (Part 2)

Publisher:神光骑士Latest update time:2013-09-09 Keywords:Smart home Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Design of smart home security system based on single chip microcomputer

Abstract: This paper introduces a design of a multi-node home security system with AT89S52 single-chip microcomputer as the control core, which transmits information through DTMF public telephone network and CAN bus. This intelligent home security system integrates fire prevention, anti-theft and anti-gas, and can realize automatic detection and automatic voice dialing alarm. The DTMF transceiver circuit, call circuit and CAN bus transmission circuit are introduced in detail. The experimental results show that this system is practical, the information transmission is real-time and reliable, and it is suitable for home security or other security systems.

  1 Introduction

  The current security system can be realized with the help of computer technology, IC card technology, communication technology, etc. The application of CAN bus in security system has played a good role in promoting the development of home intelligence. The application of DTMF technology in security system does not require special wiring, does not occupy radio frequency resources, and has no electromagnetic pollution. This paper designs a new intelligent home security system based on CAN bus and DTMF technology with AT89S52 microcontroller as the core, which improves the real-time and reliability of the original community security system to a new level. This system can monitor the security environment of the entire home in real time, and the monitoring scope includes a series of unsafe factors such as indoor anti-theft, fire alarm, gas leakage, etc. Once the above accidents occur, the alarm system will issue corresponding alarm information, broadcast the alarm category with voice, and provide alarm voice to remote users and relevant departments.

  2 Overall system composition

  The system block diagram is shown in Figure 1. The single-chip microcomputer controls the DTMF transceiver circuit, digital voice circuit, and on-hook and off-hook control circuit. The detector can quickly and accurately detect abnormal conditions in the residence, and notify the controller in time after confirmation. The single-chip microcomputer then controls the telephone interface circuit to simulate off-hook, automatically dial the pre-set telephone number for voice alarm and notify the management center. When the other party responds, the alarm state is automatically restored.

Home Security System Block Diagram

Figure 1 Block diagram of home security system

  3 Hardware Design

  The main control part of the system uses AT89S52 single-chip microcomputer, and there is no need to expand external memory. The watchdog circuit uses a programmable serial EEPROM - X25045. X25045 stores data information such as flag field, phone number, alarm code, system settings, etc. The digital voice circuit uses the digital voice chip ISD1420. In the system, ISD1420 is only used as a basic recording and playback circuit, so all address lines are set to 0, so the starting address of playback is 0. The voice signal is picked up by the electret microphone and input from the MIC and MIC REF ends to the amplifier inside the chip for amplification. The audio signal after the power amplifier is used from SP+ to connect to the call circuit to send out the voice signal.

  3.1 Ring detection and analog off-hook and off-hook unit

  The system is always in monitoring state at both ends of the telephone line, which will not affect the normal operation of the telephone. When the system receives a ringing signal, it will perform a ringing detection. The ringing signal is connected to the P3.4 port of AT89S52 after passing through three inverters. If no one answers after 5 rings, the system enters the automatic off-hook state. The P1.2 pin of the microcontroller outputs a high level, the transistor V501 is turned on, and the relay K1 is activated, and the load resistor is connected to the circuit to simulate off-hook. After that, a current greater than 10mA will appear on the telephone line. After the exchange center detects this current, it will no longer output a ringing signal but turn to connect the phone. If the ringing signal disappears before reaching the preset value, the count value of the microcontroller is reset to zero and the controller does not act.

  3.2 DTMF transceiver unit

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

DTMF transceiver circuit

Figure 2 DTMF transceiver circuit

  MT8880 provides an interface connected to a microprocessor to control its transmission, reception and working mode. Its receiving part uses a single-ended input, which is composed of R27, R28 and C16. Its input voltage gain is 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 is composed of R30 and C19. IRQ/CP is connected to the P3.5 pin of the microcontroller. When MT8880 receives a valid dual-tone multi-frequency signal, the microcontroller performs interrupt processing. The IN- terminal of MT8880 is connected to the QR terminal of the call circuit TEA1062, and the TONE terminal of MT8880 is connected to the DTMF terminal of TEA1062.

  3.3 Call Unit

  The call circuit uses the dedicated call integrated circuit TEA1062 for telephones. When sending a call, the voice signal (from ISD1420) is input through the M IC + pin, and the DTMF signal (from MT8880) is input through the DTMF pin. After being amplified by TEA1062, they are 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.

  3.4 CAN bus data transmission unit

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

  The single-chip microcomputer AT89S52 accesses the bus by controlling the CAN controller, and is also responsible for the measurement and control of the functional units. The CAN bus interface circuit is shown in Figure 3.

CAN bus interface circuit

Figure 3 CAN bus interface circuit

  AT89S52 accesses CAN controller SJA1000 through interrupt mode. In order to enhance the anti-interference ability of CAN bus nodes, SJA1000 is connected to CAN bus driver PCA82C50 through high-speed optocoupler 6N137. CANH and CANL pins of PCA82C50 are connected to CAN bus through a 5Ω resistor respectively, which can limit the current and prevent PCA82C50 from being impacted by overcurrent.

  4 Software Design

  The system software adopts a modular design, mainly including the main program module, CAN communication module, ringing detection module, voice alarm module, DTMF transceiver module, etc. Here we mainly introduce the main program and CAN communication module design.

  4.1 Main program design

  The main program mainly completes the call of each functional module, detects the system input, and then makes judgments and processes according to the system status. Before the program enters the main loop, it is necessary to perform necessary initialization, such as MT8880, ISD1420, SJA1000, related flags, etc. The main program flow is shown in Figure 4.

Main program flow chart

Figure 4 Main program flow chart

Keywords:Smart home Reference address:Smart Home Design Solution Reference Collection (Part 2)

Previous article:Object positioning detection circuit schematic
Next article:Smart Home Design Solution Reference Collection (Part 3)

Latest Analog Electronics Articles
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号