complete smart home system consists of five parts: main control module, electrical control subsystem, lighting control subsystem, security control subsystem and network control subsystem. The five parts have their own functions and logically constitute a complete control entity. The whole system provides people with an intelligent, comfortable and safe home environment, and also provides remote information monitoring capabilities. The main
control module is the brain of the smart home, and the subsystem is the limbs of the smart home. The main control module is responsible for the information concentration, storage, analysis and decision-making of the subsystem. The development of embedded chips makes the main control module more and more sophisticated and increasingly functional.
The electrical control subsystem is responsible for monitoring the operating status of electrical appliances and executing the control instructions of the main control module. The development of network home appliances has cleared the obstacles of identification and interconnection of different home appliances, and also simplified the design of electrical control subsystems. The lighting control subsystem, also known as scene control, is centered on intelligent control of light, shadow and color. This subsystem controls the combination of light in terms of angle, brightness, color, etc. to meet the needs of different scenes. This subsystem also meets the concept of time control and has mechanical motion sensors, human movement sensors and illuminance sensors.
The security control subsystem plays a role in prevention and alarm for many factors that cause security problems. Smoke sensors, temperature sensors, and carbon monoxide sensors are responsible for environmental safety control; the video intercom system prevents interference from strangers; and the door magnetic sensor and window magnetic sensor play an anti-theft role.
The remote control system subsystem meets the networking control function of home networks and public networks. Isolated home networks greatly reduce the value of smart homes, while interconnection with GPRS (General Packet Radio Service) networks and the Internet makes smart homes unique.
The composition of the smart home system is shown in Figure 1. Smart home is a huge system. The main control module is the control center and communication center of the system, and the home network is the nervous system of the system, transmitting the system information flow and control flow. There are many devices in the home, and the interfaces of the devices are different. It is a huge challenge to realize the intelligent control of various devices. In view of the shortcomings of the current smart home system, which has single functions and poor networking capabilities, this design uses distributed technology, bus technology and embedded technology to construct a multifunctional and powerful communication smart home master control module.
1 Function and hardware design of the main control module
The development of embedded technology, especially the continuous development of embedded control chips in terms of power consumption, speed and integration, has made it possible to use a single-chip control chip to complete the control of the entire system. As can be seen from Figure 2, the main control module needs to complete the following tasks: networking with the subsystem, GPRS communication function, Ethernet communication function, display function, monitoring software, etc. Among them, GPRS communication and Ethernet communication logically belong to the network control subsystem, but these two functions are implemented on the main control module, which on the one hand improves the integration and stability; on the other hand, it fully utilizes the hardware and software resources of the main control module.
The ARM chip uses S3C2410, and many features of this chip are very suitable for the main control module of smart homes. The built-in STN/CSTN/TFT LCD controller and 4-wire resistive touch screen controller simplify the circuit design of the LCD display; the standard operating frequency is 203 MHz, with strong computing power and low power consumption, which can meet the computing requirements of the main control module; the peripheral interfaces are rich, providing good support for the networking function of the main control module. The GPRS module uses the Siemens MC35I module that supports the AT command set, and it communicates with the main control module through the serial port; the Ethernet chip uses the Realtek RTL8139 Ethernet controller; the main control module and the subsystem are networked by the CAN bus, and the main control module has a corresponding CAN communication circuit; FLASH, SDRAM, EEPROM and SD card are all information storage media, and the EEPROM is designed to store system configuration information, and 64 MB NANDFLASH and 64 MB SDRAM are configured; the voice circuit outputs reminders or warning sounds, etc.; information is meaningful only when it contains time information, and the clock circuit on the main control module provides accurate time; the LCD screen can intuitively display various information, which is conducive to enhancing the affinity of the system, and an 8.0-inch TFT LCD screen is selected.
2 CAN bus communication between the main control module and the subsystem
The processing capacity of the main control module is limited. Multiple subsystems and the main control module are networked by the fieldbus to form a distributed control system. Each subsystem works together under the control of the main control module. The main information flow and control flow are transmitted between the main control module and the subsystem. The main control module transmits control flows to the subsystem, which complete the configuration of the subsystem or command the subsystem to complete a specific task. The main data flow is transmitted from the subsystem to the host, and the data flow mainly includes the operating status of each device in the subsystem or sensor data. The communication between the main control module and the subsystem can be wired or wireless. In view of the advantages of the wired method such as fast speed, high reliability, low cost, and mature technology, this system uses the CAN bus to complete the networking of the main control module and the subsystem. The networking structure of the system is shown in Figure 3.
CAN protocol is the most popular fieldbus protocol. To ensure the flexibility of the protocol, the protocol only defines the data link layer and the physical layer. Generally, the CAN controller will implement these two layers of protocols, and the application layer protocol needs to be developed for specific applications. The CAN application layer protocol standards are DeviceNet and CANOpen. These two protocols are developed for large-scale systems and for factory automation control and automotive electronics, so smart homes need to use custom CAN application layer protocols. In smart homes, subsystems and main control modules use point-to-point communication. The custom application layer protocol is based on an asymmetric master-slave network structure. The application layer frame structure is defined as shown in Figure 4. Dir (1 bit): The direction of data transmission, 0 means the main control module to the subsystem; 1 means the subsystem to the main control module.
Address (7 bit): The address number of the device in the CAN bus network.
Type (3 bit): Frame type, divided into: broadcast single frame, broadcast multi-frame start, broadcast multi-frame end, ordinary single frame, ordinary multi-frame start, ordinary multi-frame end.
Index (2 bit): Index number, indicating the index number of a frame when multiple frames are used, and the maximum
number of multiple frames is 4. Count (3 bit): The number of bytes contained in the frame.
Data (8 byte): Data load in the frame.
In order to prevent the entire system from being affected by data exchange errors, there are two strategies that can be considered: improving the reliability of system data transmission; adding necessary fault-tolerant processing in software processing. The CAN protocol uses data block encoding to communicate, and the CAN bus has high-speed (1 Mbit/s) data transmission capabilities below 40 m. The CAN protocol is very suitable for communication and control between the main control module and other subsystems.
3 Software design of the main control module
3.1 Software architecture of the main control module
The smart home main control module needs to complete the collaborative work of four subsystems. It adopts a modular design concept and requires four software modules to handle four subtasks respectively. The software architecture of the main control module is shown in Figure 5. The main task coordinates the normal operation of the four subtasks. Each subsystem can be divided into many more detailed tasks. If a structured program method is adopted, the program design is very complicated and there will be many potential problems in the system. Embedded hardware resources are increasingly abundant and the cost is relatively low. The enhancement of resources enables software to have more resources to use. The hardware resources of the main control module are very rich, and the software system is also very large. The software system cannot avoid encountering conflicts, data synchronization, and data exchange problems when accessing resources. Therefore, an embedded operating system is needed to uniformly manage hardware resources and provide a good basic environment for software development, such as: memory management, process management, storage management, file system, device management, message mechanism, data synchronization, data exchange, multithreading, sockets, etc. Although the operating system occupies a certain amount of storage space, it brings more convenience to software development. The operating system uses the Linux2.6 kernel. The main control module has no special peripherals, so the amount of driver development and kernel development is very small. The development work is mainly focused on the task development of the subsystem and the development of monitoring software. Linux development is to establish a cross-compilation environment on the host machine, determine the compilation options according to the hardware configuration, and obtain the Linux executable image after compilation.
3.2 Main program of the main control module
The intelligent control main control module has rich hardware resources and is supported by the Linux operating system. The software development of the main control module uses modularization ideas. The module division is based on high cohesion and low coupling, and a group of logically tightly coupled functions are divided into one module. The module division result is presented in a data flow diagram. The data flow diagram of the main control module is shown in Figure 6. The data flow and control flow of the safety control subsystem, electrical control subsystem and lighting control subsystem are transmitted to the main control module through the CAN bus network. The CAN communication monitoring subthread of the main control module parses the data transmitted in the CAN network. Then, the data distribution processor subthread of the main control module distributes the data to the corresponding data processing program according to the type of data. The processed data is stored in the database, and the analyzed information is intuitively displayed on the interface.
The network module is a logically independent module. Due to its particularity, it is implemented in the main control module. The remote PC sends the network stream to the network module through the Internet, and the mobile phone sends the network stream to the network module through GPRS. The network module will call the network information processing module to process the network stream. After data processing, it will be stored or forwarded to other control subsystems through the CAN bus.
4 System Testing
The performance of the main control module is mainly reflected in the communication speed and communication quality. In order to obtain these parameters, it is necessary to test the data transmission capability between the main control module and the subsystem. The test methods are: non-competition point-to-point bidirectional data transmission test; competition point-to-point bidirectional data transmission test. The test indicators are: transmission time and bit error rate. The test results of transmitting 200 KB of data are shown in Table 1.
The test results show that the communication between the main control module and the subsystem is relatively stable, and the data transmission rate is high, which can meet the real-time requirements. The bit error rate in the test is very low, which shows the stability of the CAN protocol on the one hand; on the other hand, due to the small amount of data in the data test, the probability of error is small.
5 Conclusion
The smart home system is a complex system. Due to the large number of control objects, a single intelligent control system cannot complete the control task, and a home control network needs to be formed. The main control module of the intelligent control system plays a scheduling and coordination role in the network. This paper analyzes the structure of the home control network, proposes the software and hardware model and design scheme of the main control module, and proposes a practical communication scheme for networking the main control module and other functional subsystems.
Compared with other schemes, this scheme adopts the CAN bus protocol internally, which has the characteristics of convenient networking, stable performance and low cost; it adopts the TCP/IP protocol externally, which has the characteristics of remote control capability and strong scalability. Finally, the design of the main control module software and the data transmission performance test between the main control module and other functional subsystems are introduced. The test results show that the main control module has a reasonable structure and strong communication capability with the subsystem, and can well complete the two-way transmission of data flow and control flow between the main control module and the subsystem.
Previous article:Web-based real-time management and monitoring system for equipment network
Next article:ASON's Control Plane and Its Core Technologies
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- 【NXP Rapid IoT Review】 + Kit Modification-External Lithium Battery (Link)
- How to design a typical analog front-end circuit
- [Fudan Micro FM33LG0 Series Development Board Review] Driving RGB TFT Display
- Thank you for being there + thank you for everyone who appears in my life
- Use NucleiStudio to import GD32VF103_Demo_Suites routine
- [Project source code] Operating FPGA side registers under FPGA-based Linux
- Newbies need help with a few questions about RA2A1
- The virtual machine started to freeze again
- How to solve the problem of solder balls caused by mismatched pads during production
- How speakers work