Design and Implementation of Embedded Smart Home Terminal Based on GPRS

1 Introduction

With the continuous development of network technology and communication technology, people hope that they can understand and control the situation in their homes in a certain way even when they are working or going out. At the same time, with the popularization of digital homes, the remote control of smart home has become one. Trends. 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, designed and implemented based on embedded system Home smart controller. 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.

2 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.

3 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.

Block diagram of the hardware part

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 FIFO (first in first out) buffers each with 16 bytes. The independent baud rate generator 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 75LBC184, can realize the conversion between the TTL level and RS485 level of the 44B0 serial port, the input impedance of the chip is twice the RS485 standard input impedance (≥24KΩ) Therefore, 64 nodes can be connected to 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.

4RS485 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 "SENDDATA" 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 [ 3].

Type word definition

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.

Wind Power Substation

Pad Mounted Transformer,Wind Power Substation,Step-Up Wind Power Sustation,Step Up Transformer

Hangzhou Qiantang River Electric Group Co., Ltd.(QRE) , https://www.qretransformer.com