Design of Street Light Monitoring Communication Terminal Based on ARM7

Tag: ARM7 street light monitoring

This article refers to the address: http://

0 Preface

For the urban street lamp management department, anti-theft and energy-saving have always been a very headache. It requires a lot of manpower, material resources and financial resources. Because of the large number of street lamps and geographically dispersed, it brings great difficulties to the staff. GPRS is the general packet radio service [1], the English full name is General Packet Radio Service, which is a new type of packet data transmission service opened on the existing GSM network. GPRS uses packet switching technology, which allows multiple users to share certain fixed channel resources. GPRS is especially suitable for intermittent, bursty or frequent, small amount of data transmission, and is also suitable for occasional large data volume transmission, with real-time online, volume-based billing, fast login, high-speed transmission, free switching and so on. Therefore, the wireless communication system built by GPRS is a system with low cost, easy maintenance and promotion, no restriction, high reliability, good stability, certain advanced, standard and easy to expand. It can be said that the application of GPRS to the data transmission of the street lamp monitoring system is currently the most ideal choice.

The system designs a terminal based on ARM7 processor and street lamp monitoring communication system using GPRS technology to realize remote wireless wireless field data transmission. Combined with the PC software, the data of each channel is transmitted to the centralized monitoring center in real time to achieve unified monitoring and distributed management of street lamp operation. The system structure model diagram is shown in Figure 1.

Figure 1 GPRS street light monitoring communication system model diagram

Figure 1 GPRS street light monitoring communication system model diagram

1 Introduction to the main chip

1.1 LPC2106 chip [2]

The LPC2106 processor is Philips' ARM7TDMI-S processor with an ARM7TDMI-SCPU that supports real-time emulation and tracking, and embeds 128KB of high-speed flash memory. With ISP and IAP functions, a 128-bit memory interface and a special acceleration system that allows 32-bit code execution at the highest clock cycle, the optional 16-bit Thumb mode is at the lowest cost in programs where code length plays a key role. It can reduce more than 30% of the code, CPU operating frequency can reach 60MHz; LPC2106 is small, it has two low-power modes: idle and power-down, so that the system guarantees low power consumption, very power saving, It is an ideal choice for street lighting monitoring systems. Its internal RAM reaches 64K and provides interfaces such as I2C serial and SPI serial interface, which enables the LPC2106 to perform various expansions in the GPRS system. Its two timers have 4 capture/compare channels respectively, suitable for street light control. Multi-channel data processing, watchdog timer ensures system security, dual power technology ensures system reliability.

1.2 P87LPC760 chip [3]

The P87LPC760 is a 14-pin packaged microcontroller that is suitable for many applications requiring high integration and low cost to meet a wide range of performance requirements. It is part of Phillips' small package family. The P87LPC760 offers high speed and low speed crystal and RC oscillator modes. Programmable with a wide operating voltage range, programmable I/O line output mode selection, and optional Schmitt The special trigger input LED driver, the output has an internal watchdog timer, the P87LPC760 adopts the accelerated 80C51 processor structure, and the instruction execution speed is twice that of the standard 80C51 MCU. In the street lamp monitoring communication terminal as a slave processor.

2 hardware system structure

2.1 GPRS communication terminal hardware structure

The GPRS street lamp monitoring system terminal is installed at each data collection point of the street lamp, and is connected with the GPRS transparent data transmission terminal through the RS232 port and the RS485 port. The data is encapsulated by the protocol and sent to the GPRS data network of China Mobile, and the data is transmitted to the GPRS data network. The street lamp monitoring center realizes the real-time online connection of the street lamp terminal and the street lamp monitoring center system. The hardware structure of the GPRS communication terminal adopts the design method of the master-slave CPU, so as to improve the reliability and running speed of the system. The main processor adopts the ARM7TDMI-S processor LPC2106 of Phillips, which is mainly responsible for the encapsulation of the protocol and the realization of communication with GPRS; The processor uses Phillips' P87LPC760, which is mainly responsible for the control of the ARM7 chip and GPRS module. The implementation structure of the GPRS monitoring communication terminal is shown in Figure 2.

Figure 2 GPRS monitoring communication terminal structure

Figure 2 GPRS monitoring communication terminal structure

2.2 Monitoring communication hardware implementation

In the street lamp monitoring communication terminal, the main processor is the LPC2106 processor based on the AMR7 core, which is the hardware core of the whole system. The connection structure diagram is shown in Figure 3. The main function is to realize the communication protocol encapsulation and data transmission under GPRS. At the same time, the AT command for GPRS is adopted, the data is marked into an IP packet by using the TCP/IP protocol, the wireless GPRS network is accessed via the GPRS interface, and the Winsock control is applied to implement receiving data and data exchange.

2.3 Monitoring Communication Control Implementation

The slave processor uses the P87LPC760, and the main function is to control the data transmission and communication of the LPC2106 processor and the GPRS module;

2.4 Monitoring communication interface implementation

Since the monitoring communication terminal is a 3.3V system, and the UART1 of the core processor LPC2106 has a complete modem interface and uses TTL level, the RS232 level conversion and serial communication are performed using the 8-way RS232 conversion chip SP3238. The SP3238 chip is +3.0V and +5.5V RS232 converter. Features such as low power consumption, high data rate, and enhanced ESD protection. The MAX3485 is an RS485 level shifter that can be reserved for other functions.

2.5 GPRS module implementation

ZTE ZTE815 is mainly used to implement the GPRS module and is implemented by using a SIM card. The 1st and 4th pins of the SIM card are connected to the power supply, the 2 pin is grounded, the 3 pin is reset, and is connected to the 41 pin of the ZTE815; the 5 pin is the clock and is connected to the 45 pin of the ZTE815; the 6 pin is the communication read/write I/O pin. Connected to the 43 foot of the ZTE815.

Figure 3 LPC2106 connection structure

Figure 3 LPC2106 connection structure

3 GPRS communication software design

The design of the software is the core of the monitoring communication terminal. The communication module design is the main part of the whole terminal software design. The software design adopts ARM's ADS integrated development environment, and uses C language for programming, mainly to control the LPC2106 processor. The encapsulation of the protocol and the communication with the GPRS system, from the design of the initialization serial communication module to the communication flow design with the GPRS terminal with the SIM card, it is necessary to take into account the various functional modules of the software, including parameter setting, automatic reception of data, request data and signals. Judging and so on.

3.1 Communication Command Processing

The communication data processing mainly performs related processing on the data to be transmitted and the received information. Data is sent and received by establishing an AT command in the ARM7 module, and analysis and control of the AT command are realized. The AT command used in this system is: establish TCP/socket connection command "AT+ISTCP:"; send data command "AT+ISSND%:"; query data command "AT+ISRCV:"; query data link command "AT" +ISST:"; module exits transfer mode command "AT+IMCM"; query module signal value command "AT+CSQ"; module returns data transfer mode command "ATO"; DTU returns control command mode command "AT+I"; close The SOCKET command "AT+ISCLS: ".

3.2 Introduction to the main functions of the system

Communication control is a relatively complicated process. The main functions of this system are: (1) The received string and the target pSrc string comparison function unsigned char Recive_GpCmp (const unsigned char *pSrc, unsigned char unNum), used to receive instructions (2) Extract the signal strength function unsigned char Achieve_IMFSrong(void), the signal strength is 0~30; (3) compare the connection return value function unsigned char Achieve_Socket(void); (4) establish the SOCKET connection function void Connect_Socket(unsigned char *pIp), this function is responsible for sending the IP address and port number. The waiting time is one minute. In the data return value, I/000 indicates that the connection is successful, the handle number is 000, and I/ERROR indicates that the connection has timed out or is unsuccessful; 5) Query the signal strength function void Check_IMFSrong(void), which is equal to 1 for the query signal strength state, equal to 0 for the idle state, check the signal strength, the maximum time is 3.2 seconds, the time interval is 6 minutes, and the function is called in the main loop. (6) Query the online status, call the function void Check_Gprs(void) in the second interval, set the online query interval to 3 minutes, and confirm the dropped line twice to confirm the dropped line.

3.3 Implementation of data transceiving function

Due to the limitation of space, each function cannot be described in detail. The following mainly implements the data transceiving function.

3.3.1 Implementation of the Receive Data Function

Void Recive_Data_Socket(void)

{

Unsigned char buf[20],i;

Check_IMFSrong();

If(ucGPRSMode&&ucGprsLink)

{

For(i=0;i

Buf[i]=pGPRSCMD[2][i];

Buf[i++]=0x0d;

ucGPRSMode="1"; //Receive data

UART1_SendStr(buf,i);

}

}

3.3.2 Implementation of the send data function

Void Send_Data_Socket( )

{

Unsigned char i,j,tmp,buf[20];

Unsigned short usYn, usTmp, usLen;

If(Len==0)return;

For (i =0;i

{

Buf[i] = pGPRSCMD[1][i];

}

I--;

Buf[i++] = ':';

For (j=0;j<3;j++)

Buf[i++]=szGprsHandle[j]; //Data handle number

Buf[i++] = ',';

usTmp =10000;

usYn="0";

usLen="Len";

For(j=0;j<5;j++) //send length

{

Tmp="usLen/usTmp";

usLen="usLen"%usTmp;

If(usYn)

{

Buf[i++]=tmp+'0';

}

Else

{

If(tmp)

{

usYn="1";

Buf[i++]=tmp+'0';

}

}

usTmp/=10;

}

Buf[i++] = ':';

UART1_SendStr(buf,i); //Send the data header

UART1_SendStr(Data,Len); //Send data

}

4 Conclusion

The remote data communication method based on ARM7 core is adopted. The embedded design of the master-slave processor has novel ideas and high efficiency of the program algorithm, which solves the communication problem of the remote monitoring terminal. With the wireless mode, the security of data transmission is greatly improved, and wiring is not required, and it is hardly limited by the area. The system successfully invested in the actual street lamp management and economically solved the problem of urban street lamp control management. If the system is properly modified, it can be used in environmental monitoring, hydrological monitoring, civil air defense, urban traffic control and other fields, and has a good reference value.

The author of this paper innovates: (1) The system uses ARM chip, dual CPU design, high data processing speed, stability and reliability; (2) the system uses the chip cost-effective, can easily expand the system, Can be connected to the GPRS communication system. (3) The software design has high efficiency and achieved good results in urban street lamp management. And won the third prize of 2006 Cangzhou Science and Technology Progress Award. The economic benefits generated by the project are as high as 800,000 yuan/year. The data is provided by the Luzhou Street Light Management Office and is calculated according to the savings in electricity, manpower and management costs.

Door Lock

Front Door Locks,Sliding Door Lock,Security Door Locks,Bedroom Door Lock

YONGFA INTELLIGENT TECHNOLOGY SECURITY CO., LTD. , http://www.yongfa-safe.com