Design of reversing audio and video system based on embedded Linux

Publisher:EuphoricVoyageLatest update time:2013-03-01 Source: dzscKeywords:Linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  introduction

  Electronic information and digital image processing technology have been widely used in various fields, and the informatization of vehicle-mounted systems has become an important symbol of the modern automobile industry. Today's reversing radar systems can provide a lot of help to drivers. Most of them use ultrasonic ranging technology, which can directly display the distance between the rear of the car and obstacles. However, due to the scattering characteristics of ultrasonic waves, if there are sharp protrusions on the ground or angular objects in the air, the system cannot effectively "detect" them. If a visual function can be added to the existing reversing system, the driver can clearly see the situation behind the car without having to look back when reversing. This paper designs a visual safety reversing system, which uses an embedded Linux operating system kernel to drive a USB camera to realize real-time monitoring of the situation behind the car, and activates the voice alarm function by judging whether the ultrasonic ranging reaches the threshold.

  1 System design

  As shown in Figure 1, the system consists of a main control module, an ultrasonic transceiver module, a USB camera image acquisition module, a voice alarm module, and an LCD display module. The main control module uses Samsung's S3C2440 microprocessor based on the ARM9 core, with a maximum frequency of 533 MHz and a fast processing speed. Software programming technology is used to control its peripheral circuits and provide various signals required by the peripheral circuits, simplifying the design difficulty of the peripheral circuits.


  2 System Hardware Design

  2.1 Main control module

  The composition of the main control module hardware platform with S3C2440 as the core is shown in Figure 2.


  2.2 Ultrasonic transmitting circuit

  The schematic diagram of the ultrasonic transmitting circuit is shown in Figure 3. The transmitting circuit is mainly composed of the inverter 74LS04 and the ultrasonic transmitting transducer T1, and uses the 40 kHz square wave signal output by the PWM timing counter inside the CPU.


  One path is sent to one electrode of the ultrasonic transducer (pin 1 of T1) after passing through a first-stage inverter (U1C and U1E are connected in parallel to form a first stage); the other path is sent to the other electrode of the ultrasonic transducer (pin 2 of T1) after passing through two-stage inverters (U1D is the first stage, U1B and U1A form the second stage). This push-to-switch form adds square wave signals to both ends of the ultrasonic transducer to increase the emission intensity of the ultrasonic wave. Two inverters are connected in parallel at the output end to improve the driving ability. The upper resistors R1 and R2 can improve the driving ability of the inverter 74LS04 to output a high level on the one hand, and enhance the damping effect of the ultrasonic transducer on the other hand.

  2.3 Ultrasonic receiving circuit

  The schematic diagram of the ultrasonic receiving circuit is shown in Figure 4. CX20106A is a dedicated chip for infrared detection and reception, commonly used in infrared remote control receivers for televisions. Its advantages are simple and easy to use, simple circuit connection, and reduced trouble in production debugging. When CX20106A receives a 40 kHz signal, it will generate a low-level falling pulse at pin 7. This signal can be connected to the external interrupt pin of ARM as an interrupt signal input. [page]


  2.4 USB camera image acquisition module

  A USB digital camera using the Vimicro ZC0301 chipset. Compared with analog cameras, its advantages are: the CMOS image sensor can directly generate raw image data; the hardware supports standard JPEG compression; it has a mainstream high-speed USB bus device interface, etc. For cameras, the information transmission type on the USB bus is usually real-time transmission. The USB device side provides several communication ports, and a logical communication pipeline is established between the host and the port for data transmission. In the device initialization phase of the camera, the host communicates with port 0, and the driver detects the camera model and all port information. Entering the data transmission phase, the host establishes a communication pipeline with the detected real-time input port, and transmits back the image data captured by the camera in real time.

  2.5 Voice Alarm Module and LCD Display Module

  The voice alarm module uses the XF-S3011 Chinese speech synthesis chip produced by Anhui Zhongke University iFlytek Information Technology Co., Ltd. It is a single-chip processor designed for embedded applications and has the ability to synthesize any Chinese text. XF-S3011 receives commands and data sent by the host computer through the serial port (UART). The commands and data are packaged and sent in the form of frames, and the maximum length of the data allowed to be sent is 200 bytes. Its driving circuit is designed in a triode driving mode. When the distance measured by ultrasound is less than the set threshold, S3C2 440 sends a control command to XF-S3011 to start the voice alarm to remind the driver to pay attention. The display module uses Donghua 3.5-inch TFT LCD (resolution is 320×240), and uses the Frame. Buffer device under embedded Linux to drive the LCD.

  3 System Software Design

  This paper chooses the embedded Linux operating system. It has the characteristics of being customizable, stable kernel, powerful, and supporting multiple hardware platforms. First, a cross-compilation development environment is established on a PC (host) equipped with the Linux operating system, and the S3C2440 control module is used as the target board. Then, the low-level driver and top-level application required for this design are written on the PC using the C language with good portability, and then the cross-compilation debugging tool is used to compile and link to generate executable code, and finally ported to the target board.

  3.1 Design of video image acquisition and LCD display program

  Step 1, use the USB camera driver spca5xx of the ZC0301 chip group to dynamically load. The source code of this driver consists of 4 parts: the initialization module of the device module, the uninstallation module, the upper software interface module and the data transmission module. Unzip it under kernel/driver/usb and apply the patch. When compiling the system kernel, make menueonfig in the kernel directory of arm linux; select Video for linux under Multimedia device under <*>, load the Vide04linux module, and provide programming interface functions and related data structures for the video acquisition device; (M) select SPCA5XX.

  Step 2: Use Linux's Video4linux to access the USB camera device, collect video images, and capture real-time data streams. The program flow is shown in Figure 5.


  Define the data structure for the program:


  This design uses MiniGui to load jpeg to achieve real-time LCD display of images collected by USB camera. When compiling the program, jpeg library support is added. The idea of ​​programming is to continuously collect images from the camera and store them in /tmp/l.jpg. In MiniGUI, the Linux graphical user interface support system, images are loaded through the loadbitmap function, but the image will not be automatically updated after loading, and cannot automatically change according to the changes of 1.jpg. Therefore, a timer should be set in the program to refresh the screen every 100 ms, which basically realizes real-time update. [page]

  3.2 Design of Ultrasonic Distance Measurement Driver

  The function of the ultrasonic generator program is to generate a square wave with an ultrasonic signal frequency of about 40 kHz by the PWM timing counter. Timer0 is used, and Timerl is turned on for timing. The ultrasonic rangefinder main program uses external interrupts to detect the returned ultrasonic signal, and once it is found, it immediately enters the interrupt program. After entering the interrupt, Timerl is immediately turned off to stop timing, and the ranging success flag word is assigned a value of 1. The program flows are shown in Figures 6 to 8.


  When the main program detects the successful reception flag, the distance between the rear of the vehicle and the obstacle can be calculated using the following formula (the speed of sound C at 20°C is taken as 344 m/s during design):

  S=(C·T1)/2

  Wherein, T1 is the count value of the counter Timerl.

  This part of the program can be designed as a character device driver under Linux. The Linux system provides a device driver interface function struct file_operations data structure to realize the opening, reading, writing, releasing and controlling of the ultrasonic sensor device. The initialization and parameter setting of the timer and external interrupt related registers are completed in the open() interface function. It is defined in this device driver. The data structure of file_operations is:


  The s3c2440_sonar_open() function is used to open the device. The s3c2440_sonar_rcad() and s3c2440_sonar_write() functions are used to read and write the device. The s3c2440_sonar_re-lease() function completes the release of the interrupt. The s3c2440_sonar_ioctl() function is used to control the timing interrupt and ranging value in the device. The copy_to_user() function and put_user() function are used to realize data transfer. The device is opened under the application to realize data transfer between kernel state and user state. The module initialization function s3c2440_sonar_init() realizes device initialization, interrupt initialization and processing, device registration, etc. The static void s3c2440_sonar_exit() is used to stop interrupts and release resources when the module is unloaded.

  3.3 Voice alarm program design

  When the measured distance value is less than the threshold, S3C2440 sends a control command to XF-S3011 to start the voice module. The following is part of the code that makes up a voice synthesis command frame:


  After the command is synthesized, it can be sent to the XF-S3011 module. In the embedded Linux system, first open the XF-S3011 device file, then write the command frame to the file, and finally close the device file.

  Conclusion

  This paper uses an embedded Linux operating system and Samsung's S3C2440 microprocessor to design a safe reversing system with visual and voice alarms, which has high practical value. In the process of displaying video image processing, the distance between the rear of the car and the obstacle can be measured by ultrasound. When the distance value is less than the preset distance, there will be a voice alarm to the driver. The experiment has verified that the system runs stably, allowing the driver to accurately grasp the road conditions behind the car, and improves the safety of reversing.

References:

[1]. S3C2440 datasheet http://www.dzsc.com/datasheet/S3C2440_589562.html.
[2]. 74LS04 datasheet http://www.dzsc.com/datasheet/74LS04_772886.html.
[3]. U1C datasheet http://www.dzsc.com/datasheet/U1C_1541774.html.
[4]. U1B datasheet http://www.dzsc.com/datasheet/U1B_2041186.html.
[5]. CX20106A datasheet http://www. dzsc.com/datasheet/CX20106A_113.html.
[6]. ZC0301 datasheet http://www.dzsc.com/datasheet/ZC0301_732115.html.

Keywords:Linux Reference address:Design of reversing audio and video system based on embedded Linux

Previous article:Application of S3C44B0X in Embedded Socket Communication System
Next article:Design of DRM test receiver

Recommended ReadingLatest update time:2024-11-17 01:57

From Linux to RISC-V: Only through collaboration and sharing can the true value of open source be revealed
As the industry's first truly open source processor architecture, RISC-V has attracted much attention since its launch. For the industry, the impact it has brought to the industry and the ecosystem is probably no less than the launch of Linux. Picture: Almost all the world's first-tier semiconductor manufacturers h
[Semiconductor design/manufacturing]
From Linux to RISC-V: Only through collaboration and sharing can the true value of open source be revealed
How to rebuild rootfs in buildroot
The make command build all targets You don't want to do this (until Buildroot is configured). First you need to configure Buildroot by specifying the target board. According to the manual you can either start from scratch, or create a Buildroot configuration file for your AT91SAM9X25 board from a similar board, e.g. c
[Microcontroller]
Linux Embedded System Application for Advanced 2.6 Kernel
    With the rapid development of information technology combining multimedia technology and communication technology and the widespread application of the Internet, the PC era has also transitioned to the post-PC era. In the post-PC era with the rapid development of digital information technology and network technolog
[Microcontroller]
Design of TV transmitter control unit based on S3C2440
With the development of radio and television, the application of TV transmitter technology is becoming more and more extensive. In order to effectively ensure the quality of TV signals, the importance of TV transmitter monitoring is more prominent. This paper gives a design method for intelligent control of TV trans
[Microcontroller]
Design of TV transmitter control unit based on S3C2440
U-Boot-1.1.6 is transplanted to MINI2440 development board (2) - S3C2440 related modifications
Now that we have a general understanding of U-Boot's compilation process, let's start transplanting. (I couldn’t find Zhihu’s code highlighting function...) Start porting: First modify the top-level Makefile: Add support for u-boot.dis to facilitate subsequent analysis (add $(obj)u-boot.dis): -------Makefile
[Microcontroller]
Design of matrix keyboard based on ARM and its linux driver implementation
  1. Introduction   ARM microprocessors have been widely used in industrial control, consumer electronics, communication systems and other fields. Matrix keyboard is a commonly used keyboard form, which designs the keys into M rows and N columns, so that a total of M+N signal lines are required, but M×N keys can be
[Microcontroller]
Design of matrix keyboard based on ARM and its linux driver implementation
Interface Design of Handheld Digital Waveform Table Based on LabVIEW8.6 and S3C2440
The virtual instrument program designed by LabVIEW is transplanted to the portable handheld device running WindowsCE. It can greatly improve the efficiency of embedded system software development. Specifically, an interface design that effectively solves the problem of alternating display of data waveforms is propos
[Test Measurement]
Interface Design of Handheld Digital Waveform Table Based on LabVIEW8.6 and S3C2440
s3c2440 bare metal - LCD programming - 2 - LCD controller
1. LCD controller block diagram As can be seen from the figure above, the S3C2440 LCD controller is used to transmit video data and generate necessary control signals, such as VFRAME, VLINE, VCLK, VM, etc. In addition to control signals, the S3C2440 also has a video data port, namely VD . By s
[Microcontroller]
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号