For image monitoring systems, users often put forward such functional requirements: they hope to be able to monitor objects that are far away. These objects may be distributed in suburbs, deep mountains, wastelands or other unattended places; in addition, they hope to obtain clearer monitoring images, but the real-time requirements for image transmission are not high. Obviously, it is difficult to meet such requirements by using the traditional PC plus image acquisition card.
In the embedded field, the ARM9 series microprocessors provide the best performance in terms of high performance and low power consumption. Therefore, the ARM9 embedded processor S3C2440 is selected to design and implement a remote image light monitoring system. Through this system, a camera can be controlled thousands of miles away to collect images and transmit them back. If the camera has a 485 interface pan/tilt, the camera's viewing angle, lens stretching, focus and other functions can also be remotely controlled through the Internet.
In addition to acquiring image data, the system also provides multi-way switch control and data acquisition functions, which can connect various sensors such as temperature and humidity and control the switch status of other external devices such as infrared night vision lights. Finally, the data can be transmitted to any place through GPRS or CDMA wireless communication modules and the Internet.
1 System Design
This system uses Samsung's S3C2440 embedded processor and arm-linux2.4.26 operating system; S3C2440 uses the ARM920T core with a main frequency of 400MHz; in addition to integrating general serial port controllers, USB controllers, A/D converters and GPIO functions, it also integrates a camera interface (CAMIF) (this interface is the core part of remote image acquisition). Under the control of the S3C2440 processor, the system collects analog video signals from the CCD camera, and then transmits them to the memory buffer through encoding and DMA. The software then compresses and packages the digital video data in the memory. Finally, the image is sent to the server of the monitoring center in the form of IP packets through the communication unit. The hardware structure principle of the entire system is shown in Figure 1.
1.1 Image sampling interface
The camera interface (CAMIF) of S3C2440 supports image data input of ITU-R BT.601/656 YCbCr8-bit standard, and can sample images of up to 4096×4096 pixels. The camera interface can have two modes for data transmission with the DMA controller: one is the P-port mode, which converts the image data sampled from the camera interface into RGB data and transmits it to SDRAM under DMA control (generally this mode is used to provide image preview function); the other is the C-port mode, which transmits the image data to SDRAM in the format of YCbCr4:2:0 or 4:2:2 (this mode mainly provides image data input for encoders such as MPEG-4 and H.263). Both of the above working modes allow a clip window to be set, and only the image data entering this window can be transmitted to SDRAM. The above process can be illustrated by Figure 2.
The camera interface of S3C2440 receives image data of ITU standard, and cannot directly receive analog video signals output by CCD cameras, so a SAA7113 video decoder chip is also required. SAA7113 can input 4 analog video signals, and can convert the 4 inputs through different configurations of internal registers. The input can be 4 CVBS or 2 S video (Y/C) signals, and the output is 8-bit "VPO" bus, which is the standard ITU656, YUV 4:2:2 format. The initialization of SAA7113 needs to be carried out through the I2C bus, and the I2C controller integrated in S3C2440 can just realize this process. The connection principle between the camera interface of S3C2440 and SAA7113 is shown in Figure 3.
The CE pin of SAA7113 is connected to a GPIO pin of S3C2440, so that the working state of SAA7113 can be controlled. When there is no need to collect images, the GPIO port outputs a low level, so that the SAA7113 chip is in a low power consumption state, saving energy consumption. Comparing Figures 2 and 3, it can be seen that the SAA7113 chip is the "external image sensor" in Figure 2. It provides the sampled standard ITU video data to the camera interface of the embedded system. These data are transferred to the memory through the P port or C port control of DMA, so that the image data can be further processed in the memory.
1.2 Sampling interface driver
The driver of the image sampling interface is written according to the Linux video device driver model V4L (video for Linux). The driver uses the C port mode to communicate with DMA. Before sampling one frame of image, first set the resolution of the sampled image and the clip window size and other parameters, then set the memory address of the video sampling output buffer accessed by the DMA controller, and then start the acquisition of one frame of image by setting the CAMIF interface control register of S3C2440. When one frame of image is acquired, the CAMIF interface will automatically start one C port DMA communication to transfer the acquired image data to the memory. After the transmission is completed, a C port interrupt will be generated to notify the driver that the sampling and transmission of one frame of data has ended. Specifically, this driver needs to implement the following functions:
Initialize the clock register of the CAMIF interface of S3C2440. Mainly, the camera clock frequency division register (CAMDIVN) is set according to the external crystal frequency of SAA7113. Bits 0 to 3 of this register are the frequency division coefficient, which is calculated as:
CAMCLK_DIV=UPLL/(CAMCLK * 2)-1
(Initialization code omitted — Editor's note)
Configure the sampling parameters of the CAMIF interface. Mainly the format of the input source image data, the output image format, the sampling window size, the DMA access address and other parameters. A structure is defined here to store the configuration information related to the CAMIF interface:
struct s3c2440_camif_cfg_t {
int src_x; //input source image width
int src_y; //Input source image height
int
dst_x; //Output target image width
int dst_y; //output target image height
int dst_fmt;
// Output target image data format
int pre_x; //Preview channel (P port mode) output image width
int pre_y;
//Preview channel (P port mode) output image height
int pre_fmt; //Set to 1 when using channel (P port mode)
__u16 bypass;
//When it is 1, it means that proportional image enlargement/reduction is not enabled
__u16 ycbcr; //YcbCr order of input image
struct s3c2440_camif
*dev; //device system information
};
The above configuration information is ultimately associated with a series of registers. This structure provides a clear, centralized storage buffer for reading/writing registers.
Interface functions for opening, closing and controlling the camera. These three interface functions are written according to the V4L specification, and their prototypes are as follows:
① Open the camera interface function:
static int
v4l_cam_open(struct video_device *v,int mode);
② Camera control interface function:
static int
v4l_cam_ioctl(struct video_device *v,unsigned int cmd,void *arg);
③ Close the camera interface function:
static void v4l_cam_close(struct video_device *v);
Interrupt processing interface function. This interrupt processing function is called after completing 1 frame of image acquisition using C port mode. The function prototype is defined as follows:
static void
s3c2440_camif_isr_c(int irq,void *dev_id,struct pt_regs *regs);
The implementation function for reading image data. This function uses the value of dev→rdy to determine whether the acquisition conversion of a frame of image has been completed. If the value is set to 1, it means that the sampling is completed, and the data can be copied from the image data buffer to the user's storage space; if it is 0, the function enters a blocking state or returns the EAGAIN flag. By the way, the value of dev→rdy is set in the interrupt processing function. (Implementation code omitted - Editor's note)
1.3 Image Data Compression
The image data of one frame processed by the CAMIF interface of S3C2440 is relatively large and needs to be further compressed before it can be suitable for network data transmission. The S3C2440 processor does not provide a hardware image compression encoder, but because of its high main frequency, image compression can be performed using software. Considering the CPU processing power and the high requirements for the clarity of a single-frame sampled image, the JPEG/MJPEG method based on the discrete cosine transform algorithm (DCT) is used to compress and encode the image data.
1.4 Image Data Transmission
The communication unit is responsible for the image data transmission task. In this system, there are two types of communication units available. One is the GPRS/CDMA wireless transmission module. They are connected to the S3C2440 processor through the serial port, and this communication method can be used in environments where Ethernet transmission cables are difficult to lay. Its disadvantages are small communication bandwidth and slow transmission speed, but if the real-time requirements are not high, it can also transmit high-definition static images. Another communication unit is the 10MHz CS8900a Ethernet transmission module. It can be connected to the local area network, and then send the monitoring image to the monitoring server of the local area network or to the Internet through the gateway. This communication method has high speed and good real-time performance, but a wired Ethernet network must be installed at the monitoring site.
1.5 Camera PTZ Control
The camera's pan/tilt control interface uses RS485 communication. Since there is only an RS232 controller inside the S3C2440, a RS232 to RS485 conversion interface is designed using the MAX485 chip. The circuit principle is shown in Figure 4.
The data flow direction of RS485 in Figure 4 is controlled by the level of GPE13 port.
2 System Software Design
The system software includes lower computer software, server software and client software. The lower computer software is deployed on the remote image monitoring device. This software is started as a Linux daemon process, responsible for compressing the sampled image data, packaging the compressed image, and then uploading it to the monitoring server through Socket communication. If the GPRS/CDMA wireless transmission module is used, the upper computer software will automatically perform PPP dialing after the system is started and establish a TCP/IP communication pipeline. The client software is deployed on a PC connected to the Internet, which provides end users with functions such as browsing monitoring images and setting monitoring parameters. The server software is also deployed on a computer connected to the Internet. This computer has a fixed IP or domain name on the Internet. The server software is started as a background process and acts as a bridge for communication between the client and the remote image monitoring device. Because the IP address of the remote monitoring device is dynamic and cannot be directly addressed by the client, the server is needed as an intermediate bridge for communication between the two parties.
The lower computer software completes the hardware initialization and control functions in the remote image monitoring device through the interface provided by the driver, and is also responsible for image compression and transmission. It is the control center of all devices, so here we focus on describing the workflow of the lower computer software, as shown in Figure 5.
In order to save power, some high-power devices and equipment such as SAA7113, cameras and night vision infrared lights only work when needed, so these devices are disconnected from the power supply during initialization.
The lower computer program reads the device ID number (the ID number is unique) stored on the device, as well as the domain name/IP address and port of the monitoring server, and then the lower computer program actively connects to the monitoring server as a Socket connection client. After the connection is successful, the device ID number is sent. At this time, if a monitoring client wants to view the image of a remote monitoring device, it only needs to send a request to the monitoring server and tell the server the device ID number to connect. The server will establish a Socket connection channel for the client and the remote monitoring device based on the Socket handle corresponding to the ID number.
3 Conclusion
The remote image wireless monitoring system has been successfully applied in the ice coverage monitoring of high-voltage transmission lines. In the field all-weather environment, it can timely and accurately monitor the ice thickness of high-voltage transmission lines and issue early warning processing information, thus effectively avoiding the occurrence of cable break accidents.
Remote image monitoring technology has developed along with the development of computer technology, digital communication technology, network technology, automatic control technology, and LSI and VLSI integrated circuits, and this system based on the ARM9 embedded processor is the concentrated embodiment of the cross-cutting and integrated development of these technical disciplines. Practice has proved that the low power consumption, high performance and multi-function characteristics of the ARM9 processor meet many special needs of remote image monitoring and are a good choice for realizing remote image monitoring.
Previous article:Using single chip microcomputer to simulate 2272 software decoding
Next article:Design and implementation of IDE hard disk interface based on ARM920T microprocessor
Recommended ReadingLatest update time:2024-11-17 05:24
- Popular Resources
- Popular amplifiers
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- Modern Product Design Guide
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Analog Discovery 2 Review (3) Frequency Response Test Tool
- Initialization and configuration of TCP/IP stack Development of network applications
- Transformer secondary side
- Help: Canaan K510 kit text display abnormal guess and solution progress
- EEWORLD University Hall----Hard Rock Technology STM32 Motor Control
- TI CC1352P dual-band multi-protocol wireless solution
- 【Free Trial】DFRobot micro:bit Programming Car-McQueen
- It’s strange, why are the phones sold in Huawei Experience Stores cheaper than those sold online?
- How is the storage period of components calculated?
- Mifare card reader development experience