introduction
At present, urban security systems are receiving more and more attention, and customers have higher and higher requirements on the functions and performance of security systems.
This paper proposes a wireless security system based on
GSM and Zigbee technology. The characteristics of this system are that it utilizes the advantages of GSM and Zigbee wireless networks to realize the wireless networking of the security system, eliminating the tedious wiring process, realizing multi-point and long-distance transmission of security information, and improving the safety, reliability and concealment of the security system.
1 System Solution
The main design feature of this system solution is to combine the Zigbee wireless sensor network with the GSM network. Using a wireless network not only saves the trouble of wiring and increases the flexibility of security sensor layout, but also prevents the communication cable from being damaged, thus improving safety. The entire system structure is shown in Figure 1.
The system embeds the module with Zigbee protocol into the security equipment such as passive infrared, glass breakage, door magnet, smoke sensor and gas leakage as a node of wireless sensor network. For example, when theft occurs, the passive infrared sensor detects that the thief enters the monitoring area, which triggers the interruption of the node chip, thereby activating the node chip, and the chip will automatically send out the alarm data packet through the Zigbee wireless transceiver module.
The Zigbee coordinator is the interface between the Zigbee network and the external GSM network. As the core of the system, it is responsible for the management of the entire network and the forwarding of data. It receives data from the security monitoring node through the transceiver module, and the embedded controller performs necessary processing on the received data, and then sends it to the security center through the GSM network to achieve rapid security alarm.
The whole system can be mainly divided into two parts: Zigbee coordinator and Zigbee wireless sensor node.
1.1 Zigbee Coordinator
As the center of the entire system, the Zigbee coordinator undertakes many tasks, so high requirements are placed on the controller responsible for managing this center.
The traditional single-chip microcomputer can no longer meet the requirements in some aspects. ARM is the first choice to replace the traditional single-chip microcomputer due to its high performance, low power consumption and low cost. This design uses the ARM9 processor STR912FW44X6 chip as the core and a series of functional modules are expanded peripherally. The entire hardware structure is shown in Figure 2.
Among them, STR912FW44X6 is the main control chip. It is a high-performance embedded chip based on the ARM966E_S core launched by STMicroelectronics. It has a computing speed of 96MIPS and supports single-cycle DSP instructions. The chip integrates 544kB Flash and 96kB
SRAM, supports Ethernet, USB,
UART, I2C and CAN communications, has 80 GPIOs, 8-channel 10-bit AIC, 3-phase motor controller, watchdog timer and 9 programmable DMA channels. The system uses a UART transceiver chip TL16C550 from TI to connect the GSM module to the GPIO of the ARMCPU to realize the sending of GSM short message alarms.
The GSM communication module uses Siemens' TC35i module, which has stable performance, low price, and all the functions of GSM wireless communication, and supports short message encoding in TEXT and PDU modes. In the RF transceiver, this design uses TI's Zigbee RF transceiver chip CC2420. CC242o uses OQPSK modulation, supports data transmission rates up to 250kbps, and can achieve point-to-multipoint rapid networking. In addition, the coordinator also designs RS232 interface, keyboard display and on-site alarm circuit according to actual needs.
1.2 Zigbee Wireless Sensor Node
Zigbee wireless sensor nodes are composed of security sensors and Zigbee terminal devices, as shown in Figure 3. Zigbee terminal devices use TI's Zigbee RF transceiver chip CC2430, which has a high cost-effectiveness and integrates Zigbee radio frequency (RF), memory and microcontroller on a single chip.
It uses an 8-bit MCU (8051) with 128kB of programmable flash and 8kB of RAM, and also contains an analog-to-digital converter (ADC), timers, an AES128 co-processor, a watchdog timer, a sleep mode timer with a 32kHz crystal oscillator, a power-on reset circuit, a power-down detection circuit, and 21 programmable I/O pins.
2 Introduction to Zigbee Technology
Zigbee is a product of the Zigbee Alliance, which is composed of more than 100 well-known software and hardware companies in the world and is committed to developing a short-range, low-power, low-rate, low-cost wireless sensor network standard. Wireless Sensor Network (
WSN) refers to an embedded wireless network composed of a large number of relatively low-cost sensor nodes with perception, computing, and real-time communication capabilities. It is currently a hot spot for research and application in many fields.
3 System Software Implementation
The GSM communication module TC35i is controlled by AT commands, and data transmission adopts short messages. The encoding and decoding methods of AT commands and short messages are the key to the software design of this system. The following focuses on a detailed introduction of the two.
3.1 Introduction to AT commands
AT (Attention) command set is the industrial standard of modem communication interface. Most mobile phones on the market now support the AT command set specified by GSM7.05. This command set is released by ETSI (European Technical Committee for Telecommunications) and contains the control instructions for SMS. General GSM modules support AT commands, so computers or microcontrollers can send AT commands directly to GSM modules through serial ports to conveniently send, receive and manage short messages SMS.
3.2 Short message encoding method
There are three modes for controlling short messages: BlockMode; PDUMode; TextMode. At present, PDUMode has replaced BlockMode, and TextMode does not support Chinese and most mobile phones do not support this mode. However, domestic mobile phones and GSM modules now support PDU mode. In order to meet the versatility of the system, this system uses PDUMode for short messages. So what is PDU mode? Simply put, it is a method of sending or receiving mobile SMS. The PDU string is a string of ASCII codes on the surface, consisting of numbers and letters such as o~9, A~F. They are 8-bit hexadecimal numbers or BCD decimal numbers. The PDU string contains not only the message itself, but also a lot of other information, such as the SMS service center number, target number, reply number, encoding method and service time. The structure of the PDU string sent and received is not exactly the same. The following introduces the PDU encoding format of short messages (Table 1, Table 2).
SCA: the address of the SMS center, for example, +8613800290500 for Xi’an;
FO: File byte header, set to 11 when sending text messages;
MR: information type, usually 00;
DA: destination address;
0A: sender address;
PID: protocol indicator, usually 00;
DCS: Data coding scheme, O0 is 7-bit coding, F6 is 8-bit coding, O8 is double-byte coding;
VP: validity period;
UDL: User data length, i.e. the actual SMS content length;
UD: User data, i.e. SMS content;
SCTS: Short Message Center Timestamp.
3.3 Sending and receiving short messages
To send and receive short messages, and to exchange information between the GSM module and the mobile phone, the information must first be encoded and decoded in the PDU format. This system uses Unicode encoding. Unicode is a unified character encoding standard that uses double bytes to encode characters. The characteristic of this Unicode is that all characters are represented by two bytes, not only Chinese uses two bytes, but also English uses two bytes.
The steps for sending and receiving short messages in PDU mode are: use "AT+CMGF=0" to set to PDU mode; use "AT+CMGS=length" followed by PDU packet to send short messages; use "AT+CMGR=sequence number" to read the received short messages.
For example, if you need to send the message "My home was robbed!" to the mobile phone 13991885678, the MCU first sends AT+CMGS=25 to the GSM module through the serial port, waits for the return of the ASCII character ">", then outputs the PDU data string and ends with the Ctrl+Z key. The sending procedure is as follows:
The PDU encoding analysis of its short message data is shown in Table 3:
4 Conclusion
This design provides a flexible and convenient wireless solution for the construction of security systems by using the short message service of the GSM network and the Zigbee wireless sensor network technology. The system has good scalability and practical value, and can achieve all-round security monitoring and protection. The most important point is that the system can reliably communicate with users through wireless networks, which enhances the security, reliability and concealment of the system.