Research on infrared light vehicle speed management system based on ARM

Publisher:码字先生Latest update time:2010-02-24 Source: EDNKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

Vehicles should drive at a speed that matches the road conditions on the highway. Driving too fast is prone to accidents, and driving too slow will become a stumbling block for the following vehicles. However, some drivers often violate traffic rules by not driving at the prescribed speed, resulting in frequent accidents. In order to collect evidence and correct violations, the traffic control department currently uses radar speed measurement systems (using the Doppler effect) to measure the speed of illegal vehicles and collect evidence, and impose penalties.

However, recently, an anti-radar speed measuring device called "electronic dog" has appeared on the market. When approaching the radar speed measuring area, this device can capture the radar speed measuring information in advance and alarm, so that the illegal vehicle escapes punishment, but the potential for accidents still exists. Therefore, it is particularly necessary to study a reliable speed measuring and management system that can accurately measure the speed of the car and will not be discovered by the "electronic dog".

The new speed measurement system with infrared light sensor and ARM as core components studied in this paper will not be discovered by the "electronic dog" when measuring speed. It can not only identify the size of the car speed V, but also measure the value (+△V) of the speed exceeding the upper speed limit (Vmax) or the value (-△V) below the lower speed limit (Vmin). According to this information, the evidence collection system (printing, taking pictures) can be driven as appropriate, which can effectively improve the intensity of traffic control.

1 System Working Principle

The system consists of a modulated infrared light sensor [1], Philips' LPC2294 ARM embedded processor, a color LCD display with a touch screen, and an alarm camera system, as shown in Figure 1. In Figure 1, points M and N are two points on the guardrail on one side of the road. They are respectively equipped with infrared light-emitting tubes that can emit 38KHz and continuously emit modulated infrared light. The modulated infrared light is received by the photoelectric receivers placed at the corresponding two points M' and N' on the guardrail on the other side, forming a light-controlled speed measurement area. When a vehicle passes through the light-controlled speed measurement area, the light emitted by point M is first blocked. The first photoelectric detector M-M' converts the optical signal into an electrical signal and sends it to the signal conditioning circuit. After amplification and shaping, it is sent to the ARM processor. ARM receives this trigger signal, opens the internal counter and starts counting, and the value of time t increases accordingly. When the car reaches point N, the second photoelectric detector N-N' converts the optical signal into an electrical signal and sends it to the ARM processor through the signal conditioning circuit to stop counting, and the value of t is determined. The speed V is obtained by dividing the distance L between points M and N by t. If the calculated V value is within the set safe speed range, the display screen will display the current safe speed value, and the camera and alarm circuit will not work; if the V value exceeds the set range, the speed offset △V = Vmax-V is calculated, and the vehicle is displayed as speeding, and the camera and alarm circuits are activated. Similarly, if the vehicle passes through the light-controlled speed measurement area at a low speed of V


2 System Hardware Design

2.1 Photoelectric transmitting and receiving system

The principle of the photoelectric transmitting and receiving system is shown in Figure 2. The oscillator generates a signal with a frequency of 38KHz to drive the infrared light-emitting tube to emit light. The photoelectric receiver receives the light pulse emitted by the infrared light-emitting tube, and the received light pulse signal is connected to the input end of the detector through the adjustment potentiometer [2]. The received modulated light pulse signal is sent to the amplifier for amplification, and after threshold detection, it becomes a logic level pulse synchronized with the synchronous oscillator. Then, through pulse synchronous demodulation, the photoelectric signal related to the vehicle's motion state is obtained and output through buffering.


[page]

2.2 Signal Reception and Timer Operation

As shown in Figure 3, when no vehicle passes through the light-controlled speed measurement area, points M' and N' can always receive 38KHz modulated infrared light, both output high level, and the temporary steady-state circuit is in a steady state. The output of gate G is logic 1, and UL is always high. When a vehicle passes through the light-controlled speed measurement area, the light emitted by point M is first blocked, UM changes from high level to low level first, and the temporary steady-state circuit 1 is triggered and enters the temporary steady state, as shown after time t1 in Figure 4. At this time, UM' is low level, G gate is triggered, and the output UL is low level. CAP1.0 of the ARM system captures UL from high level to low level, and a falling edge capture occurs. The value of T1TC is automatically loaded and transferred to the capture register T1CR, and an interrupt is generated. The interrupt service subroutine is entered to read the value of T1CR and save it.

Then, when the car reaches point N, that is, at time t2, the transient steady-state circuit 2 is triggered, UN' changes to a high level, and then changes to a low level UN'' through the NOT gate. At this time, the output of the G gate changes from a low level to a high level, and the CAP1.0 of the ARM captures the change of UL from a low level to a high level, a rising edge capture occurs, and the value of T1TC is automatically loaded into the capture register T1CR, and an interrupt is generated, entering the interrupt service subroutine. The difference N of the two capture registers T1CR and the working frequency f of the counter are calculated to obtain the time difference t2-t1 when the vehicle passes through the two test points M and N.

2.3 ARM core board and touch display system

[page]

The core board of the system adopts DEVICEARM2200 industrial control board, which is embedded with Philips' LPC2294ARM7TDMI-S embedded processor, with a maximum frequency of 60MHz, 8M PSRAM memory and 16M NANDFlash, and its performance fully meets the requirements of high-speed vehicle speed measurement system. Due to its small package and extremely low power consumption, it can be powered by battery, so it is very suitable for working in the field without external power supply.

The circuit connection is shown in Figure 5: the display screen uses a 320×240 color LCD screen, and the AB0 to AB16 of the LCD controller S1D13503 is connected to the address bus A1 to A17 of the LPC2294, operating in 16-bit bus mode; the data bus DB0 to DB7 of the S1D13503 is connected to the external memory data line D0 to D7 of the LPC2294, and DB8 to DB15 is connected to VDD to achieve the 8-bit data bus connection with the LPC2294; its hardware configuration is completed by two high-speed CMOS static memories IS61C1024 to S1D13503 VD0 to VD15. The four-wire resistive touch screen can detect the touch signal and convert the analog signal into position coordinate data through the touch screen controller FM7843, and pass it to the LPC2294 for processing [3].

3 System Software Design

3.1 uclinux system transplantation

Although uclinux currently supports the ARM architecture without MMU, the specific ARM processor chip used has different storage systems, different on-chip peripherals, and different interrupt systems, so it is necessary to add or modify specific codes related to the LPC2294 chip [6]. Including: adding chip model, startup code and data structure describing the model; modifying the interrupt system related code and adding irq.h, irq.c and irqs.h files in the include/asm-armnommu/arch-lpc/ directory to realize system interrupt; adding dma.h, memory.h, processor.h and other header files in the include/asm-armnommu/arch-lpc/ directory, and defining the register addresses including clock, serial port, interrupt controller, etc. in the hardware.h file; creating files time.h, timex.h and serial.h in the include/asm-armnommu/arch-lpc/ directory to realize the transplantation of clock serial port driver; modifying the config.in file in the arch/armnommu/config directory to set the menu configuration and modifying files such as mach-lpc/makefile, linux-2.4.x/makefile and arch/armnommu/makefile.

3.2 Device Driver Design

[page]

Since the uclinux 2.4.x kernel is non-preemptive, the process time slice is 10ms, and its real-time performance is not high. However, since there is only one high-real-time task in this system, that is, the capture of the vehicle passing signal, the timer on the LPC2294 can be operated by the TIMER1 device driver to realize the double-edge capture of the CAP1.0 pin signal. The TIMER1 device driver consists of the driver initialization function, the clearing function, the device information structure, the methods such as open, release, read, ioctl, and the interrupt service program. When loading the kernel module, the uclinux system will first execute the initialization function timer1_init(), register the character device by calling result = register_chrdev (MAJOR_NR, DEVICE_NAME, &timer1_fops); and judge whether the device registration is successful based on the return value result; when the kernel unloads the module, the clearing function timer1_cleanup() is executed, and the character device is deregistered by calling unregister_chrdev(MAJOR_NR, DEVICE_NAME). The device information structure is used to describe the open, release, read and other operation methods of the device: Among them, when the system and application use this timer for the first time, first execute the timer1_open(struct inode *inode, struct file *filp) method to call the request_irq(IRQ_timer1, timer1_irq_handle, SA_INTERRUPT, "my" DEVICE_NAME, NULL) function to register the interrupt response function, configure the timer T1IR, T1PR, T1TC, T1TCR and other registers to complete the timer initialization, and use the interrupt switch function local_irq_save() and local_irq_restore() to control the critical section; finally, the uclinux system receives the hardware interrupt and calls the interrupt service program; when the system and application no longer use the timer, call timer1_release(struct inode *inode, struct file *filp) to close and release it. The interrupt service program timer1_irq_handle (int irq, void *dev_id, struct pt_regs *regs) completes clearing the interrupt source, resetting the timer counter, and reading the counter value in the capture register through the macro inl (T1CR) provided by uclinux and calling the system function copy_to_usr() to copy the data from the kernel space to the user space. Finally, copy the device driver timer1.c to the linux-2.4.x/driver/char directory, and add the function timer1_init() to timer1.c to complete the device registration. Add the timer1_init() external function description in the mem.c file, add the timer1_init() call in the chr_dev_init() function, and compile to get the new kernel [4].

3.3 MiniGUI Porting

At present, common GUI systems under embedded Linux platforms include: MicroWindows, QT/Embedded, XWindows, OpenGUI, MiniGUI and other options. Considering factors such as ease of use, cross-platform and development cost, this paper adopts MiniGUI of Feynman Company to realize the development of GUI human-computer interaction graphical interface [5]. For the convenience of debugging, VMware software is used to establish a host machine of Linux platform under Windows system, enter the Linux environment, download the function library source code package libminigui-str-1.6.2.tar.gz and resource file package minigui-res-str-1.6.tar.gz from www.minigui.com and expand them .

In order to realize its cross-platform feature, MiniGUI uses GAL (Graphics Abstraction Layer) and IAL (Input Abstraction Layer) to isolate the upper layer of MiniGUI from the operating system. Therefore, first create the lcdgal.c file, refer to the native graphics engine data structure and Framebuffer driver to write the interface function according to the GAL interface; then put the LCD driver lcddriver.clcddriver.h and the LPC2294 header file lpc2294.h in the /src/gal/native directory under libminigui and modify the Makefile.am file. Add ialinput.h and ialinput.c to the /src/ial directory of libminigui to write the IAL interface function, and add the touch screen controller driver fm7843.c and fm7843.h to the /src/ial directory, and modify the Makefile.am file. Add support for the MINIGUI extension library libmgext, cross-compile in Threads mode and link the obtained MiniGUI static link library with the cross-compiled user application to generate a target file that can run on the target board, and finally install the resource files required to run MiniGUI on the transplanted uclinux system.

3.4 User Interface Design

The user interface mainly includes a main window for displaying speed information and a dialog box for vehicle speed alarm. With MniniGUIMain( int argc, const char* argv[ ] ) as the entry point, the display area is defined, two concurrent threads are created using the CreateThreadForMainWindow() function, the thread entry function address is defined and the thread identifier is returned; the initialization operation of timer1 is completed in the main thread, the main window is created through hMainWnd =CreateMainWindow( &Createinfo ) and the various properties of Createinfo are configured, the ShowWindows( hMainWnd, SW_SHOWNORMAL ) function is called to display the window as the user main interface, and finally enter the message loop. The monitoring thread and the main thread are started at the same time. After that, the monitoring thread monitors the vehicle speed information data in real time in the background and sends the corresponding message to the main thread through SendMessage(). The message processing and speeding alarm judgment can be implemented in the main window procedure function SpeedWinProc(). The SET and About drop-down menus in the main form are implemented by the CreatMenu() and CreatePopupMenu() functions, which are used to pop up the speed setting dialog box and the system description dialog box respectively. The menu handle is assigned to the hMenu property of the main form and the corresponding menu processing code is added to the form procedure function. When the menu is clicked by the administrator, the form will receive the corresponding MSG_COMMAND message, and the system will execute the speed setting processing program or the system description display program under the corresponding menu according to the message. In the speed setting dialog box, the button uses the ordinary "OK" button CTRL_BUTTON, and the two static boxes CTRL_STATIC respectively identify the functions of the two single-line edit boxes CTRL_SLEDIT: "Upper speed setting" and "Lower speed setting". The two edit boxes are used to receive the upper and lower speed limits entered by the administrator. The speed setting value in the edit box is input by the digital button implemented by the CTRL_COOLBAR control through the MSG_GETTEXT message. The creation of each control is realized by calling the Createwindow function with the control class name.

4 Conclusion

The modulated infrared light vehicle speed recognition system can not only accurately measure the vehicle speed, but also avoid the capture of the "electronic dog" type anti-speed measurement device, making it difficult for illegal vehicles to escape punishment. It plays an important role in improving the quality of traffic control, eliminating potential accidents, and ensuring the safety of people's lives and property. It can also be used in other speed measurement occasions, and its application prospects are very broad. Since the sensor head is only sensitive to 38 kHz modulated infrared light, other infrared light has almost no effect on it, so the system has strong anti-interference ability. The system uses an ARM embedded processor, uclinux operating system and touch screen. It not only has good human-computer interaction, but also has strong upgrade and expansion capabilities, stable operation, and great application prospects.

Keywords:ARM Reference address:Research on infrared light vehicle speed management system based on ARM

Previous article:Design of automobile center console panel based on capacitive sensing technology
Next article:Design of automobile headlight motion control system based on LIN bus

Recommended ReadingLatest update time:2024-11-16 23:57

NVIDIA and Ampere Computing Collaborate to Create Arm-Based Cloud Native Server Platform for Cloud Gaming
NVIDIA and Ampere Computing Collaborate to Create Arm-Based Cloud Native Server Platform for Cloud Gaming The AICAN platform will bring native compatibility and high performance, greatly accelerating the transmission speed of cloud mobile games. BEIJING – August 29, 2022 – NVIDIA and Ampere
[Network Communication]
NVIDIA and Ampere Computing Collaborate to Create Arm-Based Cloud Native Server Platform for Cloud Gaming
Design of LCD driver terminal based on ARM9 and Linux
1 Introduction At present, the existing LCD driver terminals are mainly designed by combining microcontrollers with front-end and back-end software. This type of terminal can only display pictures in font mode. The display data of this type of terminal is stored in its own NAND Flash. In the process of human-machine
[Microcontroller]
Design of LCD driver terminal based on ARM9 and Linux
Some thoughts on learning embedded systems (ARM)
I learned MCU quickly, and I was very good at 51 and AVR. Maybe it was because of the influence of my previous studies, I thought it would be easier to learn ARM. When I started to learn ARM, I realized how "painful" it was to get started. I was tortured by tutorials and materials every day. I didn't understand much
[Microcontroller]
A New Measuring Instrument Based on ARM and LPC2214
  At present, the wheel alignment instruments used at home and abroad mainly adopt contact positioning. Due to the limitations of its measurement principle, its detection operation process is very complicated and cannot achieve rapid detection, making it difficult to be widely used in train manufacturers and train ins
[Test Measurement]
A New Measuring Instrument Based on ARM and LPC2214
ARM programmer's Model learning
ARM supports three data types: byte, half-word, and word. (V4 and above, the current low-end mobile phone chips are basically V5 version ARM9) There are 2^32 values ​​that can be expressed. For signed data values, there are values ​​on the negative half axis, and for unsigned data, there are values ​​only on the r
[Microcontroller]
ARM programmer's Model learning
Samsung s5pv210 boot process (ARM Cortex-A8)
S5PV210 has 96Kb IRAM and 64Kb IROM. DRAM0 address: 0x2000_0000——0x3FFF_FFFF(512MB) (built-in memory) DRAM1 address: 0x4000_0000——0x7FFF_FFFF(1024MB) (extended memory) SROM address: 0x8000_0000——0xAFFF_FFFF(128MB*6)(extended memory) IROM address: 0xD000_0000——0xD000_FFFF(64Kb) ISRAM address: 0xD002_0000——0xD003_7FFF(
[Microcontroller]
How to use keil to determine the cold start and hot start of ARM
Microprocessor: LPC2114 Compilation environment: Keil MDK V4.10 Ideas: The reset of the microcontroller system is often divided into cold start and hot start. The so-called cold start is also known as the power-on reset. After the cold start, the contents of the RAM inside and outside the chip are random, usuall
[Microcontroller]
How to use keil to determine the cold start and hot start of ARM
Design and implementation of video surveillance terminal based on ARM9
Video surveillance system is an important part of security system. It is intuitive, convenient and rich in information and is widely used in many occasions. Traditional digital video surveillance is generally based on PC platform + video capture card. This solution has the disadvantages of large system volume, high
[Microcontroller]
Design and implementation of video surveillance terminal based on ARM9
Latest Automotive Electronics Articles
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号