Research on infrared light vehicle speed management system based on ARM

Publisher:快乐球球Latest update time:2015-08-26 Source: eechinaKeywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction  

Vehicles should travel at a speed that matches the road conditions on the highway. If they travel too fast, accidents are likely to occur. If they travel too slowly, they will become a stumbling block for the following vehicles. However, some drivers often violate traffic rules by not following 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 measurement device called "electronic dog" has appeared on the market. When approaching the radar speed measurement area, this device can capture the radar speed measurement information in advance and alarm, so that the illegal vehicle escapes punishment, and the potential for accidents still exists. Therefore, it is particularly necessary to study a reliable speed measurement 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 its 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 to work as appropriate, which can effectively improve the strength of traffic control. 

2 System working principle 

The system consists of a modulated infrared light sensor, 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, each of which is equipped with an infrared light-emitting tube that can emit 38KHz and emits modulated infrared light all the time. 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 from 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, turns on the internal counter to start 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 the counter 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 started. Similarly, if the vehicle passes through the light-controlled speed measurement area at a low speed of V


3 System Hardware Design 

3.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. The received modulated light pulse signal is sent to the amplifier for amplification, and after threshold detection, it becomes a logic level pulse output synchronously with the synchronous oscillator, and then through pulse synchronous demodulation, the photoelectric signal related to the vehicle's motion state is obtained and output through buffering. 

 
3.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, gate G 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 to enter the interrupt service subroutine. The difference N between 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. [page]

3.3 ARM core board and touch display system The 

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


4 System Software Design 

4.1 uclinux system transplantation 

Although uclinux currently supports ARM architecture without MMU, the specific ARM processor chip used has different storage system, different on-chip peripherals, and different interrupt systems. Therefore, it is necessary to add or modify specific codes related to the LPC2294 chip. 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.

4.2 Device driver design 

Since the uclinux 2.4.x kernel is non-preemptive, the process time slice is 10ms, and the real-time performance is not high. However, since there is only one high-real-time task in this system, the capture of the vehicle passing signal, the TIMER1 device driver can be used to operate the timer on the LPC2294 to achieve the double-edge capture of the CAP1.0 pin signal. The TIMER1 device driver consists of a driver initialization function, a clearing function, a device information structure, open, release, read, ioctl and other methods, and an 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 value of the counter 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 to the mem.c file, add the timer1_init () call to the chr_dev_init () function, and compile to get the new kernel. 

4.3 MiniGUI transplantation 

At present, the common GUI systems under the embedded Linux platform include: MicroWindows, QT/Embedded, XWindows, OpenGUI, MiniGUI and many other options. Considering the ease of use, cross-platform and development cost, this paper uses MiniGUI of Feynman Company to develop the GUI human-computer interaction graphical interface. To facilitate 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 characteristics, 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 the MINIGUI extension library libmgext support, 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. 

4.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. 

5 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 CAN/CAN bridge in bus network control
Next article:Research on Automobile Electric Power Steering System Based on ARM Single Chip Microcomputer

Recommended ReadingLatest update time:2024-11-16 13:28

IAR Embedded Workbench for Arm version 9.40 improves code security by integrating PACBTI
IAR Embedded Workbench version 9.40 introduces seamless compatibility with the Pointer Validation and Branch Target Identification (PACBTI) extension, protecting embedded applications from a variety of security attacks. Uppsala, Sweden – June 7, 2023 – IAR, a global leader in embedded software and services, has rele
[Embedded]
ARM processor model
ARM has many CPU instruction sets, CPU architectures, and CPU series. This article aims to introduce ARM's CPU product line. The following figure shows the ARM CPU product line: First of all, it is necessary to understand the naming rules of ARM: ARM's naming rules are roughly divided into three categories 1. "I
[Microcontroller]
ARM processor model
Design of remote electrical parameter measurement system based on STM32 and Ethernet
  Abstract Aiming at the inconvenience of electricity consumption and charging management in various places, this paper studies the remote electric parameter measurement technology based on ARM and Ethernet. This technology is mainly used for the collection and storage of electric parameters. The main controller adopt
[Test Measurement]
Design of remote electrical parameter measurement system based on STM32 and Ethernet
Classification and functions of ARM microprocessor instructions
    The instruction set of the ARM microprocessor is of the load/store type, that is, the instruction set can only process data in registers, and the processing results must be placed back in the registers, while access to the system memory must be completed through special load/store instructions.     The instruction
[Microcontroller]
Add boot startup in arm linux
Microprocessor: S5PV210 Operating system: Linux 3.0.8 Preface:     In the product, the external communication of the Linux system in the arm development board should basically be blocked, and related operations should only be performed through the product's related APP.     Therefore, it is necessary to add the APP t
[Microcontroller]
The relationship between ARM core and architecture
1. The core and architecture of ARM processor core Architecture Common CPUs ARM1 V1 ARM2 V2 ARM2As、ARM3 V2a ARM6、ARM600、ARM610、ARM7、ARM710
[Microcontroller]
The relationship between ARM core and architecture
A digital shaft angle conversion method based on ARM microcontroller and CPLD
Introduction Synchronous machines, sine-cosine resolvers, etc. are widely used in fire control, aerospace, automatic control and other fields to realize the transmission of shaft-angle information between systems. Due to the wide application of computer technology in the above fields, digital to shaft-angle conversion
[Power Management]
A digital shaft angle conversion method based on ARM microcontroller and CPLD
Registration is now open for Arm Tech Symposia
The industry-renowned Arm® Tech Symposia annual technology conference will kick off at the Ritz-Carlton Hotel in Pudong, Shanghai on November 19, 2024, and will move to the Renaissance Shenzhen Bay Hotel on November 21. As Arm's most important annual technology event, this year's Arm Tech Symposia, with the
[Network Communication]
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号