1 Introduction
Information technology has been widely used in all aspects of people's lives. People are increasingly demanding the family living environment. Smart home comes into being. Compared with ordinary homes, smart homes not only have traditional living functions, but also provide comfortable, safe, high-grade and pleasant family living space. They also transform from the original passive static structure to a tool with active intelligence. A full range of information interaction functions to help families and the outside to maintain information exchange, optimize people's lifestyles, help people to effectively arrange time, enhance the safety of home life, and even provide savings for various energy costs. In short, smart home is a residential platform, using network, communication and control technology to manage home equipment to create an efficient, comfortable, safe, convenient and environmentally friendly living environment.
Smart home started late in China. At present, the application of home network is complex and scattered, and there is no unified standard. Generally speaking, it can be divided into a high-level information entertainment network and an underlying data acquisition and control network. At the bottom of the micro-controller as the core of the smart home network node is the main implementation of the current home network. This article is based on this way using NXP's ARM7 microcontroller LPC2478 to achieve a smart home monitoring system. The system can collect multiple analog and switch quantities to provide real-time home environment status information for local users or through the CAN bus for remote users such as the property management center. Once the state of the home environment changes, users can react quickly to minimize the occurrence of security incidents.
2 system solution
The main control of this system adopts LPC2478 in ARM microcontroller, which has 512K bytes of program storage space, rich on-chip resources, on-chip LCD controller and two CAN interfaces, which is very suitable for low power consumption and low cost embedding. Design. There are 8 analog inputs in Figure 1. Because there are less analogs in the actual home state monitoring data, and there are 8 channels of 10-bit analog-to-digital converters on the LPC2478, the system directly implements A/ on its on-chip resources. D function. The analog quantity collected by the acquisition is processed by the microcontroller and output to the LCD display module (LCM1) for local display through the PA port, and output to the remote host via the CAN1 port. It can also be transmitted by RS-232 serial communication via UART0. Go to the local PC. The switching amount is input to the P0~P2 ports of the microcontroller through the bus isolation driver chip (74HC245). After the microcontroller processes, it is output to the 8D latch 74HC573 via the P3 port, and then controlled by the driving circuit to control household appliances such as lighting, air conditioning and the like that only need to be switched. The enable logic "1" indicates that the shutdown is indicated by a logic "0". At the same time, the microcontroller is also output to the remote host via the CAN1 port. The keyboard circuit is used to set the working state of the system and display the collection amount locally.
3 system software and hardware design
The software design of the lower computer can be divided into data acquisition module, communication module, keyboard and LCD control module, and switch output control module. Due to space limitations, only the specific implementation of the data acquisition module is introduced. The ARM microcontroller uses a polling method for analog and digital acquisition. By setting the timer/counter 0 interrupt, each interrupt time is 20 milliseconds, for analog (AI) sampling timing; timer/counter 1 interrupt, interrupt time 250 milliseconds, scanning digital input (DI) state every interrupt . At the beginning of the main program, the initialization of timer/counter 0, timer/counter 1, AD, DI, etc. is performed. The initialization is mainly to set the interrupt mode of the timer (set timer 0 overflow interrupt, timer 1 compare interrupt), external interrupt INT0, INT1 interrupt mode (initial interrupt request is generated on the falling edge of INT0, asynchronous interrupt request is generated on the rising edge of INT1); AD, DI are in the state that can receive analog quantity and switch quantity, then the program enters the loop state, waiting for the arrival of the upper computer control information, if When the control information arrives, the corresponding flag is set to 1, and the main program jumps to the corresponding service program to generate the corresponding operation.
Plastic Speakers,Plastic Speaker With Labtop,Plastic Abs Speaker,Portable Plastic Speaker
Comcn Electronics Limited , https://www.comcnspeaker.com