The intelligent comprehensive monitoring base station based on AT91RM9200 has the obvious advantages of stable and reliable performance, high degree of integration and intelligence, no need for special personnel, good scalability, and high resource utilization. Therefore, it is very meaningful to develop an intelligent integrated monitoring base station based on AT91RM9200, which has high technological advancement and broad market prospects.

Authors: Shi Chonglin; Yu Xiaofeng; Zhang Shenghua; Feng Wei

Similar traditional monitoring systems can be roughly divided into four types: anti-theft and arson alarm monitoring systems, access control systems, attendance or patrol systems, environmental detection systems, and video surveillance systems. Currently, there are usually comprehensive monitoring of an area (such as a warehouse) on the market. Management is the simple addition of the above four types of monitoring systems. Each sub-system is relatively independent, and the integration is performed at the upper-level monitoring center. This will inevitably lead to cumbersome wiring, heavy maintenance, difficult upgrades, and increased costs. The single networking mode of the system may also cause the system’s low robustness and poor ability to handle emergencies. In view of such a situation, this paper improves an intelligent comprehensive monitoring base station solution based on 32-bit high-performance processor AT91RM9200. .

1 System structure

The biggest feature of this base station is that it integrates various subsystems at the bottom layer, and adopts three networking methods: PSTN, GPRS and TCP/IC. It is an absolute advantage in terms of cost, intelligence, and ease of installation and use. The system structure is shown in Figure 1.

The whole system can be divided into two parts: the upper monitoring center and the lower monitoring base station. The monitoring base station and the monitoring center are connected through Ethernet or telephone network. Besides, managers can also access the monitoring base station through GPRS. The monitoring base station is connected to the front-end temperature and humidity transmitter and other environmental data measurement devices and access control card readers through the RS485 bus, and multiple devices can be mounted according to actual needs. Smoke sensors and infrared alarms are generally the output form of dry contacts, which can be mounted on the digital interface of the base station; the door magnetic electric lock can also be mounted on the digital interface of the base station through a dedicated access control power supply, in order to reduce video transmission. The data volume of the camera is compressed by the MPEG4 video compression and encoding equipment, and then the compressed data stream is read to the base station cache through the USB main port of the base station, and then sent to the upper monitoring center through the network, which is decoded and read by the upper monitoring center.

This architecture has good scalability, and can easily increase or decrease the number of monitoring base stations according to the actual situation, and has little impact on the upper-level monitoring center. In addition, the system has flexible network control and management functions, as long as the authority is given , any computer on the network can be used as a monitoring center for remote monitoring, which realizes the hierarchical, networked and distributed monitoring and management.

2 Hardware composition and design

In order to realize this scheme as soon as possible and quickly build a prototype, a modular design idea is adopted in the design of the hardware. The hardware structure diagram is shown in Figure 2.

Design of intelligent integrated monitoring base station based on 32-bit high-performance processor and RS485 bus

2.1 Minimal system

The minimum system is the processing center of the base station. The main chip is AT91RM9200, a high-performance embedded chip based on the ARM920T core from Atmel, with a computing speed of up to 200MIPS. AT91RM9200 integrates a wealth of peripheral components, including system peripherals and application (user) peripherals. System peripherals include power management controller (PMC), system timer (ST), real-time clock (RTC), advanced interrupt controller (AIC), parallel I/O (PIO) controller, debug unit (DU); application peripherals Includes USB host port, USB device port, Ethernet 10/100BaseT MAC controller, Multimedia Flash (MMC) card interface, Synchronous Serial Control (SSC), USART, Serial Peripheral Interface (SPI), TWO-wire two-wire interface , timer/counter. The AT91RM9200 integrates a high-speed on-chip SRAM and a low-latency external bus interface (EBI). EBI provides a seamless connection to external memory or memory-mapped peripherals. A controller is built into the EBI to control synchronous DRAM, flash memory in burst access mode and static memory; EBI also provides interfaces with SmartMedia, CompactFlash and NAND Flash. The scalable Flash interface provides convenience for the upgrade and expansion of the entire system.

The main chip is connected with 1 piece of 16 MB Flash and 2 pieces of 16 MB SDRAM to expand the storage space and memory. The storage space and memory size can be further expanded depending on the actual application needs.

2.2 Peripheral interface

Peripheral interfaces include 1 USB host port, 2 RS485 serial ports, 2 RS232 serial ports, 1 Ethernet port, 1 RS232 debugging serial port, 1 JTAG port, 3 dry contact input interfaces, 3 digital Quantity output interface, 5 V power input interface.

The USB main port is used for the transmission of data stream of the video compression module; for the convenience of software design, two RS485 interfaces are designed, one is used to connect the temperature and humidity transmitter of Dalian North Measurement and Control Group, and the other It is used to connect the RS485 card reader of Guangzhou Micropower Company; two RS232 serial interfaces, one is used to connect the GPRS M0DEM of Shenzhen Ten Billion Company, and the other is used to connect the embedded modem of Beijing Tianshi Company to realize GPRS access and The function of connecting to the telephone network; one Ethernet port realizes the function of connecting to the Ethernet; 3-way dry contact input interface is used to connect the smoke sensor and passive infrared detector of Shenzhen Dilake Company; 3-way digital output interface through electromagnetic The relay can control door magnetic locks, air conditioners, fire sprinklers, sound and light alarms, etc. according to actual needs.

AT91RM9200 integrates a wealth of peripheral components, so only a small number of chips can be implemented in the design of the peripheral interface.

2.3 Video Compression Module

The video compression module was originally integrated with the base station. Considering the practical application, there is no Ethernet in some occasions, and it can only be connected to the monitoring center through the telephone network. In this case, video transmission is meaningless, so the video compression module is independent, which can be applied and needs to be used for video monitoring. If the video compression module is used, the video compression module should be mounted on the USB host port of the base station.

In order to shorten the development cycle, the video compression module adopts the MPEG24 video coding chip GO7007SB which supports multi-format from the American WIS Company. GO7007SB adopts a variety of WIS patented technologies, which can easily realize various formats and standards of audio/video compression and alarm, dynamic detection, OSD (On Screen Display), embedded web server and other functions. Through proper configuration, the output format of the video stream can be MPEG-1, MPEG-2, MPEG-4, H. 263, MJPEG format. GO7007SB can be connected with CMOS/CCD image sensor chip without gluing, meanwhile, it provides control channels such as EEPROM, SDRAM, USB, etc. and abundant peripheral interfaces such as HPI.

GO7007SB only supports digital video interface, and the cost of analog camera is low. You can use Philips’ video decoding chip SAA711A to convert analog video data from analog camera into digital video data stream and send it to GO7007SB for compression and encoding.

3 Base station software composition and design

There are several versions of the software design of the base station. Here is an example of a version that adds video surveillance and transmits data from Ethernet.

3.1 Main functions of the software

The main functions of the software are as follows:

① Real-time detection and processing of the data sent by the front-end sensor, and judgment to determine whether the situation of the front-end monitored place is normal. If there is an emergency, the fire extinguishing, alarm and other devices will be automatically activated, and the relevant situation and data will be sent to the manager of the main control center through the network and text messages.

② It can receive commands from the network in real time, and realize the corresponding functions after automatically processing and judging the type of commands (such as querying the sensor and controlling the SMS module); at the same time, the main control center can receive the relevant information of the front-end sensor through the network. data.

③ It can compress the video data through the video coding module, and send the compressed video data to the monitoring center in real time through the network.

④Users can query the status of the sensors in front of the intelligent control terminal through text messages, and can control the access control system. When an emergency occurs, the intelligent control terminal can send an alarm by means of text messages.

5) The base station can automatically identify and process the data of the access control system, automatically determine the user’s authority, record the user’s entry and exit, and transmit the latest record to the main control center for record backup.

3.2 Software Architecture

The whole software adopts the embedded operating system Linux as the main carrier of base station function realization. Linux is a multitasking operating system. The software is divided into five threads. After the system is powered on, the five threads work in parallel. The relationship between the five threads is shown in Figure 3.

Design of intelligent integrated monitoring base station based on 32-bit high-performance processor and RS485 bus

The five threads are:

The video transmission thread is responsible for transmitting the compressed data to the main control center through the network.
The network port receiving thread is responsible for receiving and processing the instructions and data sent by the main control center through the network port.
The sensor detection thread is responsible for detecting the status of the front-end sensor and processing the corresponding data.
The access control detection thread is responsible for controlling the access control system.
The GSM short message detection thread is responsible for receiving the short message command and making corresponding processing according to the command.

The following takes the network port receiving thread as an example to introduce the design of this thread module in detail. The network receiving thread process is shown in Figure 4.

Design of intelligent integrated monitoring base station based on 32-bit high-performance processor and RS485 bus

ndfs: Select the number of file handles to be monitored. It depends on the number of files opened in the process. Generally, it is set as the maximum file number in each file to be monitored plus 1.
readfds: A collection of readable file handles monitored by select().
writefds: Collection of writable file handles monitored by select().
exceptfds: Collection of exception file handles monitored by select().
timeout: The timeout end time of this select(). (See /usr/sys/select.h for millionths of a second.)

When the image file in readfds or writefds is readable or writable or times out, this select() ends and returns. Programmers use a set of system-provided macros to determine which file is readable or writable at the end of select(). Particularly useful for Socket programming is readfds.

Several related macros are explained as follows:

FD_ZERO (fd_set*fdset): Clear the association between fdset and all file handles.
FD_SET (int fd, fd_set*fdset): establish the connection between the file handle fd and fdset.
FD_CLR(int fd, fd_set*fdset): Clear the association between file handle fd and fdset.
FD_ISSET (int fd, fdset*fdset): Check whether the file handle fd associated with fdset is readable and writable, “0 means readable and writable. (See /usr/include/sys/types.h for the definition of fd_set and related macros)

In this way, the socket only needs to read in when there is data to read, roughly as follows:

So an FD_ISSET (sockfd) is equivalent to notifying that sockfd is readable.

Epilogue

The intelligent comprehensive monitoring base station based on AT91RM9200 has the obvious advantages of stable and reliable performance, high degree of integration and intelligence, no need for special personnel, good scalability, and high resource utilization. Therefore, it is very meaningful to develop an intelligent integrated monitoring base station based on AT91RM9200, which has high technological advancement and broad market prospects.

The Links:   6MBP75RA120 G649DX5R010