Family intelligent control terminal based on ARM-Linux and GPRS technology

The family intelligent control system connects all kinds of household appliances, family security devices and various measuring devices in the family through the family bus technology to form a family internal network, which is managed by the family intelligent controller [1]. Remote control is to connect the smart home controller to the outside world through a certain communication method, so that people can centrally monitor and control the home system locally or remotely.

The scheme introduced in this article combines the advantages of GPRS (General Packet Radio Service) technology always online, fast speed, wide access range, small size, low power consumption, etc. [2], using RS485 industrial bus, the design realizes a Home intelligent controller of embedded system. Users can remotely monitor wirelessly via SMS and the Internet. Today, mobile phones and the Internet are very popular, providing users with simpler and more convenient options. At the same time, due to the special design of the RS485 interface of the controller, the number of external nodes can be expanded from the original 32 to 64, which solves the problems of wiring networking and control of household equipment.

1 System design

From the structural point of view, it is mainly divided into three parts: user, controller, and home device control of RS485 bus. The user sends a command to the GPRS module of the controller through a mobile phone message or a network, and the controller also feeds back information to the user or issues an alarm notification through the GPRS module. Thus, the wireless connection between the user and the controller is realized, and the remote control is realized.

2 Hardware design

The structural block diagram of the hardware part is shown in Figure 1. The controller is the core part of the entire system. It is connected to the GPRS module through the serial port expansion; it provides an RS485 bus interface to connect with household equipment through a level conversion chip; it also provides LCD, keyboard, etc Interactive interface. The main control chip of the controller adopts Samsung S3C44B0, uses ARM7TDMI core, and the working frequency is 66MHz [1]. The processor is connected with 4MFlash (used to store the controller's startup code and system code and the text log of the event of the day) allocated to the memory Bank0 space and 4M & TImes; 16 SDRAM, and allocated to the memory Bank6 space.

GPRS module peripheral circuit: GPRS module adopts MC35 module of Siemens company, supports multiple communication methods such as data, voice, short message and fax, etc. It can be controlled by AT command. The serial line can be directly connected to the RS232 serial port through the MAX3238 level conversion. Serial port expansion: 44B0 provides a complete 9-wire serial port for dial-up Internet access by GPRS modem through an external dual-channel universal asynchronous transceiver ST16C2550. Its main feature is 16-byte FIFO (First In First Out) buffer for receiving and sending, and independent baud rate generator can provide 50bps to 4Mbps transceiver clock. Users can easily locate the error and judge the operating status through the chip's status register. The memory space of the chip uses the reserved storage space bank4. Use bus control. RS485 interface design: The TI company's RS485 interface chip 75L BC184 is used to achieve the conversion between the TTL level of the 44B0 serial port and the RS485 level. The input impedance of the chip is twice the RS485 standard input impedance (≥24KΩ ), So 64 nodes (equivalent to twice the original) can be connected to the bus. And it has a unique design. When the input is open, its output is high, which can ensure that the receiver input cable has an open circuit failure, which does not affect the normal operation of the system.

3 RS485 bus protocol design

RS-485 bus for system communication needs to specify its transmission protocol, the most important is the design of the frame structure. The structure of the data frame of this system includes: start, address, type, data length, data, checksum and end frame seven parts, except that the data frame is N bytes (depending on the data transmitted from the slave), the rest All occupy 1 byte. The definition of the type word is shown in Table 1. The “SEN DDATA” frame in the type frame is a data frame, which is used to store the status information of the slave device, and the other four are instruction frames, which are used to store the command words sent by the master to the slave. .

The master sends a query request. The master sends a read request. The slave is ready to receive. The slave is busy. The master / slave sends data.

This system uses the LRC frame check method. The LRC value is calculated by the transmission device and placed in the message frame. The receiving device calculates the LRC during the reception of the message and compares it with the value in the LRC field of the received message. If the two values ​​are not equal, there is a transmission error . In addition to the definition of the frame structure, the communication of the entire system also needs to abide by the following rules: (a) Master query method: the master polls each slave and requests the slave to submit status information, and the slave cannot actively send a request. (b) After the master sends out the "ASK" command, if the slave returns a "BUSY" frame, the master starts timing and counting, and if it times out 3 times, the task execution fails. (c) After receiving the "READY" signal sent from the slave, the master sends a "GETDATA" command to the slave to enter the receiving state, and at the same time turns on the timeout control. If the data sent back from the slave is not received within the specified time, the counter is incremented by 1 and continues to send out the "GETDATA" signal. If it times out 3 times, the query is cancelled. (d) The slave waits for the master to send instructions and performs corresponding operations according to the specific instructions. If the received command frame is wrong, the frame will be discarded directly.

4 Software design

The design of the software part is mainly based on ARM-Linux, because the operating system has a complete TCP / IP protocol, and also supports many other network protocols, which can provide complete protocol support for the GPRS modem to connect to the Internet, and the operating system has a good Stability and real-time performance can meet the requirements of home intelligent controllers for system reliability. In addition, Linux's source code is open and portable, providing good technical support for problems in system development. The software design of this system is mainly two parts of the application program: GPRS wireless data transmission; RS485 bus control.

4.1 RS485 bus control

Based on the RS485 bus protocol in the previous section, the master-slave control is mainly divided into three parts: polling, query, and control. (1) Polling: The master periodically queries each slave. If alarm information is found, the alarm will be triggered in time after being saved and fed back to the user. If a timeout or framing error occurs, the host gives up the query and stores the event in the host. (2) Inquiry: The working process of inquiring is roughly the same as that of polling, but only the specified slave and specified status are queried. (3) Control: send the control instruction to the designated slave, and request the slave to feedback the execution result.

Led Downlight

In the LED lighting ,LED downlights are intelligent product and it is very reliable for lighting solutions. LED downlights can be suitable for lighting indoor and outdoor spaces, such as : offering a wide range of LED downlights, bathroom downlights, outdoor downlights, recessed downlights, ceiling downlights, etc.LED downlights can be many different shapes, such as outdoor headlights, recessed headlights, ceiling headlights, and square headlights, which are usually made with aluminum, ensuring style and substance in one go.Moreover,They can adapt to different working environments, and the adjustment temperature ranges from 3000K to 6000K. Because 

LED Downlight

Recessed Downlight,LED Recessed Downlight,Halo Ultra Thin Downlight,Surface Mounted Downlight

JIANGMEN LEDER LIGHTING CO., LTD , https://www.lederlight.com

Posted on