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

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

The scheme introduced in this paper combines the advantages of GPRS (General Packet Radio Service) technology forever online, fast speed, wide access range, small size, low power consumption, etc. [2], using RS485 industrial bus, the design realizes a kind of Home intelligence controller for embedded systems. Users can now remotely monitor wirelessly via SMS and the Internet. Today, mobile phones and the Internet are quite popular, providing users with simpler and more convenient choices. At the same time, due to the special design of the RS485 interface of the controller, the external nodes can be expanded from 32 to 64, which solves the problems of wiring and networking 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 short message or a network mode, and the controller also feeds back information to the user or issues an alarm notification through the GPRS module. Thereby, the user and the controller are wirelessly interconnected to realize remote control.

2 hardware design

The block diagram of the hardware part is shown in Figure 1. The controller is the core part of the whole system. It is connected to the GPRS module through the serial port extension; the RS485 bus interface is connected to the household equipment through the level conversion chip; and the LCD, keyboard, etc. are also provided. Interactive interface. The main control chip of the controller adopts Samsung S3C44B0, uses ARM7TDMI core, and the working frequency is 66MHz [1]. The processor external 4MFlash (the boot code and system code for the storage controller and the text log of the day event) is allocated to the memory Bank0 space and the SDRAM of 4M&TImes;16, which is allocated to the Bank6 space of the memory.

GPRS module peripheral circuit: GPRS module uses Siemens MC35 module, supports data, voice, short message and fax and other communication methods can be controlled by AT command. The serial line can be directly connected to the RS232 serial port after level conversion by the MAX3238. Serial port expansion: 44B0 provides a complete 9-wire serial port for GPRS modem dial-up via an external dual-channel universal asynchronous transceiver ST16C2550. Its main features are receiving and transmitting 16-byte FIFO (first in, first out) buffers, and independent baud rate generators can provide 50bps to 4Mbps transceiver clocks. The user can conveniently locate the error and judge the operating status through the status register of the chip. The chip memory space uses the reserved storage space bank4. Use bus mode control. RS485 interface design: using TI's RS485 interface chip 75L BC184, can realize the conversion between TTL level and RS485 level of 44B0 serial port, the input impedance of the chip is twice the input impedance of RS485 standard (≥24KΩ ), so you can connect 64 nodes on the bus (equivalent to twice the original). And it has a unique design, when the input is open, its output is high, this can ensure that the open circuit of the receiver input cable does not affect the normal operation of the system.

3 RS485 bus protocol design

System communication with RS-485 bus requires regulation of its transmission protocol. The most important thing is the design of the frame structure. The structure of the data frame of the system includes: start, address, type, data length, data, checksum and end frame, except for the data frame is N bytes (depending on the data transmitted by the slave), the rest Both occupy 1 byte. The type word definition is shown in Table 1. The "SEN DDATA" frame in the type frame is a data frame for storing the status information of the slave device, and the other four are instruction frames for storing the command word sent by the host to the slave. .

The host sends a query requesting the host to send a read request. The slave is ready to receive the slave to send data in the busy master/slave.

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 in the process of receiving the message and compares it with the value in the LRC field in the received message. If the two values ​​are not equal, it indicates that there is a transmission error. . In addition to the definition of the frame structure, the communication of the whole system also needs to comply with the following rules: (a) Host query mode: The host polls each slave and requests the slave to submit status information, and the slave cannot actively issue the request. (b) After the host issues the "ASK" command, if the slave feeds back the "BUSY" frame, the host starts timing and counting, and if the timeout is 3 times, the task execution fails. (c) After receiving the "READY" signal sent back from the slave, the master sends a "GETDATA" command to the slave to enter the receive state and simultaneously turn on the timeout control. If the data sent back by the slave is not received within the specified time, the counter is incremented by one and the "GETDATA" signal is continuously issued. If the timeout is 3 times, the query is canceled. (d) The slave waits for the host to send an instruction and operates accordingly according to the specific instruction. If the received instruction frame is incorrect, 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 GPRS modem connection to the Internet, and the operating system has good performance. Stability and real-time can meet the system reliability requirements of the home intelligent controller. In addition, the source code of Linux is open and portable, which provides good technical support for system development problems. The software design of this system is mainly two parts of the application: GPRS wireless data transmission; RS485 bus control and control.

4.1 RS485 bus control

Based on the bus protocol of the previous part of RS485, the master-slave control is mainly divided into three parts: polling, query and control. (1) Polling: The host periodically queries each slave. If an alarm message is found, the alarm is triggered and fed back to the user in time. The host discards the query if a timeout or framing error occurs, and stores the event in the host. (2) Query: The workflow of the query is roughly the same as the polling, but only the specified slave and the specified state are queried. (3) Control: Send the control command to the specified slave, and ask the slave to feedback the execution result.

Mobile Phone Battery is rechargeable Lithium Ion Battery for NOKIA,SAMSUNG and other phone brands.with its rechargeable ability and high energy desity, lithium ion battery is extensively applied in mobile phone and cell phone. with rich experience and advanced technology, our company supply battery for domestic and oversea clients. Please feel free to contact us!

Other Mobile Phone Battery

Other Mobile Phone Battery,Small Battery,Replacement Mobile Battery,Battery For Gps Tracker

Shenzhen Powercom Electronics Co., Ltd. , https://www.expowercome.com