Smart Home Control System Based on Single Chip Microcomputer and CAN Bus

Publisher:火箭飞人Latest update time:2011-08-23 Source: 维库Keywords:CAN Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In order to meet the functional requirements of each part of the building intercom system, this system uses three I/O port lines and one unlock key.

Among the three I/O lines, one is used as output to control the ringing of the intercom extension; one is used as input to detect the off-hook signal of the intercom extension; and one is used to control the control relay of the analog audio signal channel of the intercom extension, so that the user can directly communicate through the audio analog channel after it is connected. The unlocking key is set on the keyboard, and the unlocking signal is transmitted to the outdoor station through the CAN bus. After receiving the unlocking signal, the outdoor station controls the opening of the building door lock.

3.3 Security Alarm Section

The functions of the security alarm part include input of alarm signals, local alarm, local alarm display, and remote alarm.

The alarm signals include signals from various detectors, such as window magnetic switches, door magnetic switches, passive infrared sensors, gas detectors, fire detectors, etc. All alarm signals are connected to the PB port of 8255. Local alarm is that the microcontroller controls the buzzer through the I/O port to sound the alarm, and the eight-segment digital tube display shows the alarm category. Remote alarm includes remote telephone alarm and alarm to the management personnel in the centralized control room through the CAN bus.

3.4 Telephone remote monitoring part

There are three main solutions for remote monitoring: remote control based on the Internet, remote control based on power lines, and remote control based on telephone networks. The first two networking solutions are relatively complex, technically difficult, and costly, and require a high level of technical skills from the maintainer. The telephone network is a mature, widely used, and low-cost communication network. This design uses the telephone network to achieve remote monitoring. When there is an alarm at home, the user can remotely alarm by phone. When it is necessary to remotely control household appliances, the user can send the control signal to the microcontroller through the phone, and the microcontroller then outputs the control signal through the PA port of 8255 to drive the relay to switch the household appliances. The circuit of the telephone remote monitoring part mainly includes three parts: signal detection, analog off-hook circuit, dual-tone multi-frequency DTMF signal transceiver circuit implemented by HT9170 and HT9200A, and voice recording and playback circuit using ISD1420 as the recording and playback component.

3.5 Nodes connected to the CAN bus

This design uses the CAN bus peer-to-peer communication network to realize the exchange of information between indoor extensions of the smart home control system, as well as between extensions and the switchboard. It has the characteristics of equal status of each node and no master-slave node.

Since the main controller AT89C52 microcontroller itself does not have a CAN bus controller, this design uses the SJA1000 CAN bus communication controller and the AT82C250 bus driver to realize the information exchange between the microcontroller and the CAN bus.

3.6 Keyboard display

The keyboard adopts a 4×4 matrix keyboard with a total of 16 keys, including ten numeric keys, and the rest are the arming button, resident call intercom button, unlock button, confirm button, clear alarm and disarm button and home appliance control button, which are used for input of various control signals, call/help signals, unlock signal, disarm/arm signal. The display adopts the 74LS164 shift register with serial input and parallel output to drive a single LED eight-segment digital tube for real-time display of control parameters or alarm categories.

4 Design and implementation of smart home control system software

In order to make the program clear and readable and run at a high speed, this system software adopts a modular structure design, which consists of a main program and related subprograms (such as keyboard scanning subprogram, display subprogram, voice prompt subprogram, dial alarm subprogram, electrical control subprogram, etc.). The main program flow is shown in Figure 2.

Figure 2 Main program flow chart

Figure 2 Main program flow chart

The program mainly includes three modules: security alarm, building intercom and telephone remote control.

The main program works as follows: the system is initialized after power-on reset. After the initialization is completed, the system detects the alarm signal, building intercom call signal and incoming telephone call signal respectively. If there is a signal input, it enters the corresponding processing module. In the security alarm module, a delay program is set to eliminate jitter and false alarms. The delay program is mainly implemented by calling the keyboard scanning subroutine. If there is still an alarm after the delay is completed, the local alarm, the alarm to the central control room through the CAN bus and the dial-up telephone alarm are carried out in sequence, thereby realizing the function of multi-point alarm and minimizing the loss.

In the building intercom module, the call signal of the door phone is transmitted to the extension via the CAN bus. After the extension detects this signal, it connects the intercom ringing, and then determines whether to pick up the phone. If there is no off-hook signal, it will delay the judgment. When the resident picks up the phone, the microcontroller outputs a signal to control the control relay of the audio communication line to turn on, allowing the resident to talk with the caller.

During the call, the microcontroller determines whether the user is on-hook. If the user is on-hook, the microcontroller returns. If the user is not on-hook, the microcontroller calls the keyboard scanning subroutine to determine whether the unlock key is pressed. If the unlock key is pressed, the microcontroller remotely unlocks the door through the CAN bus and the door station. The working process of the telephone remote control program module is that when there is an incoming call, the microcontroller first detects whether the phone rings 4 times, then simulates picking up the phone, and then plays a recording prompting the user to enter the password. If the password is incorrect, the user simulates hanging up the phone. If the password is correct, the microcontroller plays a recording prompting the user to enter the serial number of the appliance to be controlled, and then detects the control signal returned, and calls the appliance control subroutine to control the switch of the household appliance, and simulates hanging up the phone after completion.

5 Conclusion

The smart home control system designed in this paper makes full use of the powerful control function of the single-chip microcomputer and the outstanding features of the CAN bus, such as flexibility, convenience, high reliability, high communication rate, low price, and easy networking. It integrates the relatively independent systems in the smart home and realizes functions such as building intercom, telephone remote control, and multi-point alarm. CAN technology is a new control network technology. Combined with the existing mature public telephone network, it will gradually show its unique advantages in the application of smart communities.

Abstract: Aiming at the problem that the smart home system has low integration and little connection between systems, this paper introduces a networking technology based on CAN bus with a single-chip microcomputer as the control core, and designs a smart home control system that can realize building intercom, telephone remote monitoring and multi-point alarm functions in combination with the public telephone network.

1 Introduction

Smart home emerged in Japan and Europe and the United States in the 1980s, and entered China in the late 1990s. With the development of the economy and the improvement of people's living standards, it has gradually been understood and accepted by the Chinese people. At present, there are many kinds of intelligent systems and products in China, but each system is independent of each other, with low integration and little connection with each other. For example, building intercom systems, security systems, household appliance automatic control systems, etc., each has its own terminal, and there is no unified intelligent control platform. For users, this situation increases the cost of use and the complexity of operation; for construction, it leads to repeated wiring. In view of this situation, this paper designs a single-chip microcomputer AT89C52 as the control core, using the original telephone network to integrate the building intercom, security alarm and telephone remote monitoring system to form a unified intelligent control platform, and connects with the door machine and the management machine through the CAN bus network, which can realize the functions of building intercom, telephone remote monitoring and alarm. The intelligent home control system. This system is simple to operate, does not require repeated wiring, and reduces the cost. It is a system that is truly suitable for smart homes.

2 Main components and functions of smart home control systems

(1) Building intercom system

The building intercom adopts a community networking system, and the intercom system is installed at the door of each residential unit and in the residents' homes to realize the functions of visitor identity verification and intercom with residents, as well as remote control unlocking by residents, thereby effectively preventing illegal persons from entering residential buildings.

(2) Home security system

The home security system has functions such as anti-theft, fire prevention, remote monitoring and alarm.

(3) Household appliance automatic control systems

The main function of the household appliance automatic control system is to control household appliances, lighting and other electrical equipment. The system can realize local centralized control of home lighting or household appliances, and can also remotely control home appliances through telephone when necessary to save energy.

3 Smart Home Control System Hardware Design and Implementation

The indoor extension system of the smart home control system is shown in Figure 1. The system is mainly composed of a single-chip microcomputer and its I/O port expansion part, a building intercom part, a security alarm part, a telephone remote monitoring part, a node part connected to the CAN bus, and a keyboard and display part.

Figure 1. Structure of indoor extension system of smart home control system

Figure 1. Structure of indoor extension system of smart home control system

3.1 MCU and I/O port expansion

The single-chip microcomputer uses the powerful AT89C52 as the main controller, which is mainly used for signal acquisition, data processing, and output of control signals. It is the core of the entire control system. Since this system requires many I/O ports, the I/O ports provided by the single-chip microcomputer itself are not enough, so the chip 8255 is used to expand its I/O ports. Among them, the PA port of 8255 works in output mode and is used to control the switch of household appliances; the PB port works in input mode and is used to input the alarm signals of various alarm detectors; the PC port is used to expand the keyboard.

Keywords:CAN Reference address:Smart Home Control System Based on Single Chip Microcomputer and CAN Bus

Previous article:Design of battery safety detection system based on single chip microcomputer
Next article:A mixed signal LED buck-boost drive circuit

Recommended ReadingLatest update time:2024-11-17 03:54

Comprehensive upgrade of CAN FD
As we all know, CAN FD is an upgraded version of the protocol based on CAN 2.0. In order to meet the growing requirements of high bandwidth and high transmission rate in automotive electronics, CAN FD has been upgraded in the following aspects:   1. Higher transmission baud rate     Figure 1 Variable data segment ba
[Automotive Electronics]
Comprehensive upgrade of CAN FD
Canalys: China's smartphone growth will be weak in 2021, increasing by only 1%
      Research firm Canalys today released a report on the smartphone market in mainland China for 2021 and the fourth quarter. The report said that in 2021, the smartphone market in mainland China experienced a year of ups and downs. After the aggressive shipments in the first quarter, manufacturers adjusted their li
[Mobile phone portable]
Canalys: China's smartphone growth will be weak in 2021, increasing by only 1%
Understanding the CAN controller hardware lookup table of LPC1768/17XX
1. Background:  LPC1768 is used for CAN transmission and reception. Here we summarize and record the transmission and reception of CAN controller using LPC1769, so that you can quickly get started in the next development.  Note: LPC1768/1769 are basically the same except for the maximum frequency they support. 
[Microcontroller]
Understanding the CAN controller hardware lookup table of LPC1768/17XX
Design of CO (Carbon Monoxide) Infrared Detection System Based on CAN Bus and MSP430
    This article describes the circuit principle and application of CO (carbon monoxide) infrared detection system design based on CAN bus and MSP430   This system is based on the design idea of ​​infrared detection system with CAN bus interface. The detection system is based on the MSP430 ultra-low po
[Microcontroller]
Design of CO (Carbon Monoxide) Infrared Detection System Based on CAN Bus and MSP430
Design of Intelligent Ultrasonic Liquid Level Transmitter Based on CAN Bus
O Introduction   Fieldbus is a fully decentralized, fully digital, intelligent, bidirectional, interconnected, multi-variable, multi-point, multi-station communication network used between field instruments and control systems and control rooms. CAN (Controller Area Network) is a serial data communication protocol p
[Microcontroller]
Design of Intelligent Ultrasonic Liquid Level Transmitter Based on CAN Bus
Lithium supplier Vulcan and Renault sign lithium supply agreement
German-Australian joint venture Vulcan Energy Resources said on Monday it had signed a lithium supply agreement with Renault, Reuters reported. Vulcan will supply the French automaker with 6,000 to 17,000 tonnes of lithium annually from its geothermal brine deposits in Germany starting in 2026, the two sides said. Th
[Mobile phone portable]
Application of CAN bus in parallel inverter power supply
1 Introduction The parallel operation of inverter power supplies can not only realize power synthesis, but also easily form a building block, redundant, and intelligent distributed high-power power supply network system, which is an important direction for the development of power supply technology. Fie
[Power Management]
SCANIA uses Mathworks to develop fuel-efficient driver assistance system
Inefficient driving techniques can increase carbon emissions and fuel consumption by 10%. To address this issue, Scania developed a real-time driver analysis system that provides truck drivers with instant feedback on their driving techniques. To reduce development costs, Scania engineers used MATLAB, Simulink, MATLAB
[Industrial Control]
SCANIA uses Mathworks to develop fuel-efficient driver assistance system
Latest Industrial Control 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号