0 Introduction
For urban street lamp management departments, anti-theft and energy saving have always been a headache, requiring a lot of manpower, material and financial resources. Because there are a large number of street lamps and their geographical locations are scattered, it brings great difficulties to the staff. GPRS is General Packet Radio Service [1]. This wireless service 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 particularly suitable for intermittent, sudden or frequent, small amount of data transmission, and is also suitable for occasional large amount of data transmission. It has the advantages of real-time online, volume-based billing, fast login, high-speed transmission, and easy switching. Therefore, the wireless communication system established by GPRS is a low-cost, easy to maintain and promote, unrestricted, highly reliable, stable, advanced, standardized and easy to expand system. It can be said that applying GPRS to the data transmission of street lamp monitoring system is the most ideal choice at present.
This system designs a terminal for street lamp monitoring communication system based on ARM7 processor and GPRS technology to realize remote wireless transmission of various field data. Combined with the host computer software, various data are transmitted to the centralized monitoring center in real time to realize 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
1 Introduction to main chips
1.1 LPC2106 chip[2]
The LPC2106 processor is Philips' ARM7TDMI-S processor. The chip has an ARM7TDMI-S CPU that supports real-time simulation and tracing, and is embedded with 128KB of high-speed Flash memory. It has ISP and IAP functions, a 128-bit memory interface, and a special acceleration system that allows 32-bit code to be executed at the highest clock cycle. In programs where code length plays a key role, the optional 16-bit Thumb mode can reduce more than 30% of the code at the lowest cost, and the CPU operating frequency can reach 60MHz; LPC2106 is very small, and it has two low-power modes: idle and power-down, which ensure that the system is used at low power consumption and is very energy-saving. It is an ideal choice in street light monitoring systems. Its internal RAM reaches 64K in size and provides interfaces such as I2C serial and SPI serial interfaces, allowing LPC2106 to be expanded in various ways in the GPRS system; its two timers, each with 4 capture/compare channels, are suitable for multi-channel data processing of street light control, the watchdog timer ensures the safety of the system, and the dual power supply technology ensures the reliability of the system.
1.2 P87LPC760 chip[3]
P87LPC760 is a 14-pin packaged single-chip microcomputer, suitable for many occasions requiring high integration and low cost, and can meet various performance requirements. It is a member of Philips' small package series. P87LPC760 provides high-speed and low-speed crystal oscillators and RC oscillation modes, programmable selection of a wide operating voltage range, programmable I/O port line output mode selection, optional Schmitt trigger input
2 Hardware System Structure
2.1 GPRS communication terminal hardware structure
The GPRS street light monitoring system terminal is installed at each data collection point of the street light, and is connected to the GPRS transparent data transmission terminal through the RS232 port and RS485 port. The data is sent to China Mobile's GPRS data network after being encapsulated by the protocol, and the data is transmitted to the street light monitoring center through the GPRS data network, realizing the real-time online connection between the street light terminal and the street light monitoring center system. The hardware structure of the GPRS communication terminal adopts the master-slave CPU design method, which improves the reliability and operation speed of the system. The main processor adopts Philips' ARM7TDMI-S processor LPC2106, which is mainly responsible for the encapsulation of the protocol and the realization of GPRS communication; the slave processor adopts Philips' P87LPC760, which is mainly responsible for the control of the ARM7 chip and GPRS module. The implementation structure diagram of the GPRS monitoring communication terminal is shown in Figure 2.
Figure 2 GPRS monitoring communication terminal structure diagram
2.2 Implementation of monitoring communication hardware
In the street light monitoring communication terminal, the main processor is the LPC2106 processor based on the AMR7 core, which is the hardware core of the entire system. The connection structure diagram is shown in Figure 3. Its main function is to realize the communication protocol encapsulation and data transmission under GPRS. At the same time, it adopts AT commands suitable for GPRS, uses TCP/IP protocol to pack data into IP packets, accesses the wireless GPRS network through the GPRS interface, and applies Winsock controls to realize data reception and data exchange.
2.3 Implementation of monitoring communication control
The slave processor uses P87LPC760, whose main function is to control the data transmission and communication between LPC2106 processor and GPRS module; [page]
2.4 Implementation of monitoring communication interface
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, an 8-way RS232 conversion chip SP3238 is used for RS232 level conversion and serial communication. The SP3238 chip is a +3.0V and +5.5V RS232
2.5 Implementation of GPRS module
ZTE815 is mainly used to implement GPRS module, which is implemented by SIM card. Pins 1 and 4 of SIM card are connected to power supply, pin 2 is grounded, pin 3 is reset, connected to pin 41 of ZTE815; pin 5 is clock, connected to pin 45 of ZTE815; pin 6 is communication read and write I/O pin, connected to pin 43 of ZTE815.
Figure 3 LPC2106 connection structure diagram
3 Design of GPRS communication software
Software design is the core of this monitoring communication terminal, among which the communication module design is the main part of the entire terminal software design. The software design adopts ARM's ADS integrated development environment and uses C language for programming. It mainly controls the LPC2106 processor, realizes the protocol encapsulation and communication with the GPRS system. From the initialization serial communication module design to the communication process design with the GPRS terminal with SIM card, it is necessary to take into account various functional modules of the software, including parameter setting, automatic reception of data, request for data and signal judgment.
3.1 Communication command processing
Communication data processing is mainly for the data to be sent and the information received. By establishing AT commands in the ARM7 module, data transmission and reception are realized, and the analysis and control of AT commands are realized. The AT commands used in this system are: establish TCP/socket connection command "AT+ISTCP:"; send data command "AT+ISSND%:"; query data command "AT+ISRCV:"; query data link command "AT+ISST:"; module exit transmission mode command "AT+IMCM"; query module signal value command "AT+CSQ"; module return data transmission mode command "ATO"; DTU return control command mode command "AT+I"; close SOCKET command "AT+ISCLS:".
3.2 Introduction to the main functions of the system
Communication control is a relatively complex process. The main functions of this system are: (1) The received string is compared with the target pSrc string. The function is unsigned char Recive_GpCmp(const unsigned char *pSrc, unsigned char unNum), which is used to detect the received instruction; (2) The signal strength is extracted by the function unsigned char Achieve_IMFSrong(void), and the signal strength is 0~30; (3) The connection return value comparison function is unsigned char Achieve_Socket(void); (4) The SOCKET connection is established by the 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 failed; (5) The signal strength query function is void Check_IMFSrong(void), equal to 1 for querying signal strength status, equal to 0 for idle status, check signal strength, the maximum time is 3.2 seconds, the time interval is 6 minutes, and call this function in the main loop; (6) Query online status, call the function void Check_Gprs(void) every 1 second, set the online query time interval to 3 minutes, and confirm disconnection after two disconnections.
3.3 Implementation of data sending and receiving functions
Due to space limitations, it is not possible to describe each function in detail. The following mainly implements the data sending and receiving functions.
3.3.1 Implementation of receiving data function
void Receive_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 [page]
UART1_SendStr(buf,i);
}
}
3.3.2 Implementation of sending 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';
}
[page]
else
{
if(tmp)
{
usYn="1";
buf[i++]=tmp+'0';
}
}
usTmp/=10;
}
buf[i++] = ':';
UART1_SendStr(buf,i); //Send data header
UART1_SendStr(Data,Len); //Send data
}
4 Conclusion
The GPRS network remote data communication method based on the ARM7 core and the embedded design of the master-slave processor are adopted. The idea is novel and the program algorithm is efficient, which solves the communication problem of the remote monitoring terminal. The wireless mode is adopted, and the security of data transmission is greatly improved, and no wiring is required, and there is almost no regional restriction. The system has been successfully put into actual street light management and economically solved the problem of urban street light 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's innovations: (1) The system uses ARM chips, dual CPU design, and has the characteristics of high data processing speed, stability and reliability; (2) The chips used in the system are cost-effective, can be easily expanded, and can be connected to the GPRS communication system. (3) The software design is efficient and has achieved good results in urban street light management. It won the third prize of Wuzhou Science and Technology Progress in 2006. The economic benefits generated by the project are as high as 800,000 yuan/year. The data is provided by the Wuzhou Street Light Management Office and calculated based on the savings in electricity, manpower, and management costs.
Previous article:Implementation and application of a reconfigurable FPGA configuration method based on ARM
Next article:Research on Remote Video Monitoring System Based on ARM Platform
Recommended ReadingLatest update time:2024-11-16 20:37
- Popular Resources
- Popular amplifiers
- Practical Deep Neural Networks on Mobile Platforms: Principles, Architecture, and Optimization
- ARM Embedded System Principles and Applications (Wang Xiaofeng)
- ARM Cortex-M4+Wi-Fi MCU Application Guide (Embedded Technology and Application Series) (Guo Shujun)
- An ARM7-based automotive gateway solution
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Beijing Excellence Communication is recruiting embedded developers with high salary!!!
- How to assign initial values to a continuous RAM range in C2000 chip
- TMS570 Learning 3-Internal Flash Programming
- First post by a newbie
- What is 4G DTU and what are its specific functions?
- CadenceLIVE China 2022 China Online User Conference invites you to attend
- Super detailed summary of receiver sensitivity and equivalent noise bandwidth
- Difference between junction temperature and case top temperature of power device
- The problem of grounding the output signal of the half-bridge inverter circuit
- Xianyu not only hired someone to do their graduation project, but also tried to "extort" money from the seller. It's a pity for these two students from Xidian University...