Design of Remote Image Wireless Monitoring System Based on ARM9

Publisher:创意探险Latest update time:2010-01-27 Keywords:S3C2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

Keywords:S3C2440 Reference address:Design of Remote Image Wireless Monitoring System Based on ARM9

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

Engineers share: 5 key points of LED driver design
1. Chip heating This is mainly for high-voltage driver chips with built-in power modulators . If the chip consumes 2mA of current and 300V of voltage is applied to the chip, the chip power consumption is 0.6W, which will of course cause the chip to heat up. The maximum current of the driv
[Power Management]
Practice of DC motor drive based on ADI Blackfin ADSP
The DC motor is mainly used to control the garage. The following is the implementation principle: 1. Principle of PWM circuit of DC motor The conduction time of transistor is also called conduction angle а. If the on and off time of modulation transistor is changed, that is, by changing the size of conducti
[Power Management]
Practice of DC motor drive based on ADI Blackfin ADSP
Capacitor step-down LED driver circuit
The capacitor step-down circuit is a common low-current power supply circuit. It is also often used in LED drive circuits due to its advantages such as small size, low cost, and relatively constant current. Figure 1 is an actual LED drive circuit using capacitor voltage reduction: Please note that most applicat
[Power Management]
Capacitor step-down LED driver circuit
Design of drive circuit and protection circuit in the main circuit of frequency converter
01Drive and protection Let's use an example to talk about the drive and protection of the switch components in the main circuit of the inverter. The circuit diagram is as follows: As shown in the figure, when the driving pulse WG3# is at a low level, point B is at a low level. When the IGBT is turn
[Embedded]
Design of drive circuit and protection circuit in the main circuit of frequency converter
Application design of constant current LED drive system
The DC-DC converter from the battery to the LED can both step up the supply voltage to the standard LED forward voltage and step down the supply voltage to the forward voltage, and keep the LED current constant (for constant brightness). At the same time, when the overall input current is higher, a larger inductor is
[Power Management]
Application design of constant current LED drive system
Linux-2.6.32 transplanted on mini2440 development board - SD card driver transplanted
1 Register SD device driver in the kernel Linux-2.6.32.2 already comes with the SD card driver for the S3C2440 chip. We only need to add the SD platform device structure to the initialization code. Open arch/arm/mach-s3c2440/mach-mini2440.c and add the following red code after the nand flash platform structure:
[Microcontroller]
ADDA series PCF8591 driver
/*****************************This part is the driver of the I2C bus****************************************/ #include reg52.h #include intrins.h #include I2C.H #define NOP() _nop_() /* define a null instruction*/ #define _Nop() _nop_() /* define a null instruction*/   sbit SCL=P2^0; //I2C clock  sbit SDA=P2^
[Microcontroller]
Scientific and technological innovation drives the development of new energy storage to a higher level
New energy storage is an important technology and basic equipment supporting the new power system, and plays an important role in promoting high-quality energy development, promoting energy structure transformation and optimizing power systems. In the past two years, China's energy storage market has continued to grow
[New Energy]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号