Vehicle restriction is an effective measure to solve urban traffic congestion. It has been proven in practice and its effect has been recognized by the society. Most cities use the scheme of restricting vehicles based on the last digit of the license plate, such as the odd-even restriction. There are a series of disadvantages to restricting vehicles based on license plate numbers: the restricted numbers, time and road sections are too confusing and difficult to remember; on the other hand, it restricts some vehicles that really need to travel, which has a certain impact on the daily life order of some citizens; some families even evade vehicle restrictions by buying a second car, which is contrary to the original intention of the restriction.
In view of the above situation, this paper combines single-chip microcomputer technology with radio frequency identification technology to design a device for counting vehicle travel days. The vehicle is equipped with an electronic tag to interact with the road collection unit, and the road collection unit identifies and records vehicle information. The license plate information is sent to the traffic control center server, and the travel days calculation system calculates the vehicle's travel days as the basis for collecting congestion fees, thereby achieving the purpose of vehicle restriction.
1. Methods of restricting urban vehicles
At present, the restriction of vehicles in cities is mainly based on the last digit of the license plate. For example, in Beijing, vehicles are divided into different groups according to the last digit of the license plate, and one or several groups of vehicles with the last digit of the license plate are restricted every day of the week. This method uses administrative means to forcibly restrict vehicle travel, which is not humane enough.
This paper proposes to collect congestion fees based on the number of days a vehicle travels to achieve the purpose of limiting vehicle traffic. The system simulation diagram is shown in Figure 1. The system mainly consists of a vehicle electronic tag, a collection unit, and a congestion fee calculation system of the traffic control center. When a vehicle passes through the gantry across the lane, an identification unit is installed on the gantry to activate the electronic tag working circuit. The vehicle electronic tag and the identification unit interact with each other and send the license plate information to the identification unit. The collection unit receives the license plate information, stores it in the internal chip, and sends the stored data to the traffic control center server at regular intervals. The vehicle electronic tag consists of a radio frequency chip and a microprocessor. The collection unit above the road includes a radio frequency signal receiving module, a control module, and a data sending module. The radio frequency signal receiving module consists of a receiving antenna and a reader. The control module controls the reception, storage, and transmission of data.
The main functions of the traffic control center congestion fee calculation system are to count the number of vehicle travel days and calculate the congestion fee. This paper mainly studies the acquisition of vehicle travel days. For the congestion fee calculation part, each city can formulate a congestion fee collection plan based on its own actual situation and the number of vehicle travel days.
The system functional block diagram is shown in Figure 2. The main work is divided into three stages.
1.1 Wireless RF signal transmission and reception stage
When a vehicle passes near the front of the gantry where the acquisition unit is installed, it is in the radiation area of the reader antenna inside the acquisition unit, and the electronic tag starts to send an encrypted carrier signal to the reader. The two are microwave communications, and the communication frequency reaches 2.4 GHz. The sleep-wake-sleep mode is used to control data transmission for the received vehicle electronic tags to avoid repeated transmission of vehicle information and reduce power consumption.
The ALHOLA time-division algorithm is used to identify multiple vehicles to prevent collisions when multiple tags are sending information. The data transmission between the electronic tag and the reader uses verification and encryption to ensure data transmission security.
After the reader demodulates the received information, it sends the data to the control module.
1.2 Control module information processing and data transmission
The control module first determines whether it is a local vehicle based on the first two digits of the license plate (only local vehicle travel data is recorded). If it is a local vehicle, it is stored, otherwise it continues to read the next piece of information. The license plate information is encoded with the date of the day and stored in the memory.
The control module uses a microprocessor as the control chip, and an external storage chip is used to save data. The Ethernet controller chip is used to connect to the external Ethernet network through the RJ45 interface. The transmission protocol complies with the standard TCP/IP protocol and sends data to the traffic control center server.
1.3 Congestion Charge Calculation System
The collection unit sends the vehicle travel information of the day to the traffic control center server. The vehicle travel information in each unit is screened, duplicate data is removed, and the vehicle travel information of the day is obtained.
At the end of the month or year, vehicle travel information is counted to obtain the total number of travel days per month or year, and then congestion fees can be charged based on the number of vehicle travel days.
The traffic control center shall make necessary public announcements on the road sections where the collection units are installed and the rates of congestion fees. The traffic control center shall inform the car owners of the number of days they travel in that month and the amount of congestion fees to be paid by text message every month. At the end of the year, the traffic control center shall summarize and calculate the congestion fees that the vehicles shall pay for that year and notify the car owners of the time to pay the congestion fees. For behaviors such as overdue payment and arrears, the traffic control center may impose appropriate fines on the vehicles as necessary warnings. For behaviors such as deliberate destruction of electronic tags to evade vehicle identification, education and fines shall be adopted to ensure the vehicle identification rate and improve the effectiveness of urban vehicle restrictions.
2 Hardware Design
The system hardware structure mainly includes the RF transceiver chip CC2430, Ethernet controller RTL8019AS, storage chip, and network isolation transformer. The CC2430 chip automatically completes the packaging, encoding, and modulation of the data signal at the sending end, converts it into RP, and then sends it to the antenna through the back-end input/output matching circuit to complete the signal transmission. The receiving end demodulates and unpacks the useful signal received from the antenna through CC2430, performs CRC check, and finally stores the data. The 8051 microcontroller inside the CC2430 chip controls the Ethernet controller RTL8019AS to send data. The main chips used are RTL8019AS, CSl93C46 (64×16 b E2PROM), 74HC573 (8-bit latch), and 62256 (32KBRAM). In order to allocate the address space well, CSI93C46 is used for read (or write) operations to set the I/O base address and Ethernet physical address of the RTL8019AS port. As the central processor, 8051 can control the RF chip to sleep or wake it up to send and receive data. The two external interrupt input terminals of 8051 are connected to switches K1 and K2 respectively. The function of switch K1 is to use external interrupts to exit the power-down mode of the microcontroller, and the function of switch K2 is to realize the data transmission control inside the microcontroller. As the central processor, the 8051 microcontroller not only needs to control the transmission and reception of wireless signals, but also needs to control the Ethernet controller. In the software design, it is necessary to determine whether the license plate information is a vehicle in this city, store the data, and send or receive the control signal sent by the traffic control center according to the clock timing to perform data transmission operations; the RF transceiver chip is mainly used as the sending and receiving device of the system. It is used to realize the given vehicle information. Its main function is that it can realize the data interaction between the electronic tag and the acquisition unit; the RTIL8019AS chip is mainly used to realize the communication between the microcontroller and the remote PC through Ethernet. The serial port of 8051 is changed to an RJ 45 interface that can be involved in Ethernet. The data transmission follows the standard TCP/IP protocol. [page]
2.1 Electronic Tags & Readers
The CC2430 is a true system-on-chip (SoC) CMOS solution that improves performance and meets the low-cost, low-power requirements of ZigBee-based 2.4 GHz ISM band applications. It combines a high-performance 2.4 GHz DSSS (direct sequence spread spectrum) RF transceiver core with an industrial-grade, compact and efficient 8051 controller. The CC2430 integrates the ZigBee RF front end, memory and microcontroller on a single chip, using an 8-bit MCU (8051) with 32 KB/64 KB/128 KB of programming flash and 8 KB of RAM, as well as an analog/digital converter (ADC), a timer, an AES-128 security coprocessor, a watchdog timer, a sleep mode timer with a 32 kHz crystal oscillator, a power-on reset circuit, a power-off detection circuit, and 21 programmable I/O pins. The object code of the 8051 core of CC2430 is compatible with the standard 8051 microprocessor, and the software can be developed using the standard 8051 assembler and compiler. The 21 programmable I/O pins can be set by software to set the bits and bytes of a group of SFR registers, so that these pins can be used as normal I/O ports or as peripheral I/O ports connected to ADC, timer or USART components.
The CC2430 circuit connection diagram is shown in Figure 3. The circuit uses the CC2430 chip as the core component of the electronic tag and the reader in the acquisition unit. A 32.768 kHz quartz resonator and two capacitors are selected to form a 32.768 kHz crystal oscillator circuit; a 32 MHz quartz resonator and two capacitors are selected to form a 32 MHz crystal oscillator circuit (the specific crystal oscillator circuit diagram is omitted). The voltage regulator can power all internal power supplies that require a 1.8V voltage. The capacitor is used as a decoupling capacitor for power supply filtering to improve the stability of the chip. In the circuit, J2 is the I/O pin JTAG emulator interface. J1 is the CC2430 chip expansion output port, and the SPI port and the entire P0 I/O port are mainly reserved on the expansion output port. Two light-emitting diode indicator lights are designed as circuit debugging indicators. An unbalanced antenna is used. In order to make the antenna perform better, an unbalanced transformer is connected between the antenna and CC2430. The non-balanced transformer is composed of a capacitor, three inductors and a PCB microwave transmission line. The entire structure meets the RF input/output matching resistance (50 Ω) requirement.
In the electronic tag, the microcontroller chip 8051 controls CC2430, and sends the data to be sent to CC2430 through the SPI port. CC2430 automatically completes the packaging, encoding, and modulation of the data signal, converts it into an RF signal, and sends it to the antenna through the back-end input/output matching circuit to complete the signal transmission. The data reception in the acquisition unit reader demodulates and unpacks the useful signal received from the antenna through CC2430, performs CRC check, and then sends it to the microcontroller chip for processing and outputs it through the RS 232 conversion chip. After the above process, data is sent and received. The schematic diagram of the RF transceiver design is shown in Figure 4. The dotted line part is the reader part, which is sent to the Ethernet controller through the RS 232 serial port.
2.2 Ethernet Controller
For Ethernet data transmission, we use the Realtek RTL8019AD Ethernet controller, which has excellent performance and low price and occupies a considerable proportion in the market. Its main performance is as follows:
(1) Comply with EthernetⅡ and IEEE 802.3 (10Base5, 10Base2, 10BaseT) standards;
(2) Full-duplex, with simultaneous transmission and reception at a rate of 10 Mb/s;
(3) Built-in 16 KB SRAM for transmit and receive buffering, reducing the speed requirements for the main processor;
(4) Support 8/16-bit data bus, 8 interrupt request lines and 16 base address selections;
(5) Supports UTP, AUI, BNC automatic detection, and also supports automatic polarity correction for 10BaseT topology;
(6) Allows 4 diagnostic LED pins to be programmable output;
(7) 100-pin PQFP package reduces PCB size.
Figure 5 shows the interface circuit of 8051 microcontroller controlling RTL8019AS to realize communication with Ethernet. The network interface adopts UTP RJ 45 interface. The main chips used are RTL8019AS, CSI93C46 (64×16 b E2PROM), 74HC573 (8-bit latch), 62 256 (32 KB RAM). [page]
In order to allocate the address space, the port I/O base address and Ethernet physical address of RTL8019AS are set by reading (or writing) CSI93C46. CSI93C46 is a Serial E2PROM with a 4-wire SPI serial interface and a capacity of 1 Kb. It mainly stores the configuration information of RTL8019AS. RTL8019AS receives the status of the DO pin of CSI-93C46 through ESDO by controlling the CS, SK, and DI pins of CSI93C46. After RTL8019AS is reset, it reads the content of CSI93C46 and sets the value of the internal register. If the content in CSI93C46 is incorrect, it will not work properly. First, write the configured data into CSI93C46 through the programmer, and then solder it into the circuit.
10BaseT wiring is used to mark Ethernet communication through twisted pair cables, and RTL8019AS has a built-in 10BaseT transceiver, so the network interface circuit is relatively simple. An external isolation LPF filter 0132 is connected, TPIN+/- is the receiving line, and TPOUT+/- is the sending line. After isolation, they are connected to the RX+/- and TX+/- ends of the RJ 45 interface respectively.
The clock circuit is connected to a 20 MHz crystal oscillator and two capacitors through T1 and T2 to achieve full-duplex mode.
LED0 and LED1 are each connected to a light emitting diode to reflect the communication status: LED0 represents LED_COL, which means there is a communication conflict; LED2 represents LED_RX, which means that an information packet is received from the Internet.
2.3 Hardware transmission performance and power consumption
The free space propagation distance is related to the transmission power, receiving sensitivity and the carrier frequency used. Its mathematical expression is:
Where: d is the propagation distance; Lp is the free space loss; c is the speed of light; f is the carrier frequency. From theoretical calculations, it can be seen that the maximum identification distance of CC2430 can reach 1500 m. In practice, due to factors such as external interference, obstacle obstruction and air quality, the identification distance cannot reach the theoretical length. Table 1 shows the test results of long-distance data transmission and reception using CC2430. Assume that the data packet size is 32 B and the data rate is 1 MHz. 100 data packets are sent from the electronic tag to the acquisition unit and from the acquisition unit to the electronic tag respectively, and the number of correct data packets received is recorded. It can be seen that within a range of 40 m, the acquisition unit can realize the identification of all vehicles without packet loss. In actual use, various other interferences may be encountered, and anti-interference ability is one of the issues that the system needs to consider.
The system uses low-power devices. The active devices in the electronic tag include voltage conversion chips and CC2430, whose operating currents are 3.5μA, 27 mA (receive)/25 mA (send). And it adopts the sleep-wake-sleep working mode, and the power consumption is lower when in sleep mode. Just add a battery to meet 3 to 5 years of use. Achieve low-cost, low-power, high-performance system requirements.
3 Software Design
The software design is divided into the wireless transceiver part of CC2430 and the data transmission part of the single-chip control Ethernet. The difficulty of software design lies in the transceiver of RF chip data. The following mainly introduces the control of RF data transceiver and Ethernet data transmission, and briefly analyzes the operation of these two aspects.
3.1 RF Data Transmission Protocol
The data transmission between the electronic tag and the collection unit follows the ZigBee wireless network transmission protocol. The ZigBee protocol is based on the IEEE 802.15.4 standard and operates in the unlicensed 2.4 GHz frequency band. It specifies technical standards for networking, security, and application software. It consists of a group of sublayers, each of which provides a specific set of services for its upper layer: the data entity provides data transmission services, and the management entity provides all other services. Each service entity provides a service interface to the upper layer through a service access point (SAP), and each SAP provides a series of basic service instructions to complete the corresponding functions. The architecture model of the ZigBee protocol stack is shown in Figure 6. The IEEE 802.15.4 standard defines the physical layer (PHY) and the medium access control sublayer (MAC); the ZigBee Alliance defines the design of the network layer and application layer (APL) framework. The application layer framework mainly includes three parts: the application support sublayer (APS), the ZigBee device object (ZDO), and the application object specified by the manufacturer. [page]
The ZigBee protocol stack solves the networking problem very well. The entire protocol stack has good security, strong hierarchy, low power consumption, and can realize mesh network. In the ZigBee 2006 protocol stack, the underlying drivers of CC2430 have all been solidified in the protocol stack and can be called directly. The CC2430 chip is selected as the hardware core chip of the wireless communication module, and the ZigBee 2006 protocol stack is selected in the software part to realize the communication function between wireless modules.
3.2 RF data transmission and reception processing program
The software IAR 7.30B is used to develop the program. The system software is based on the ZigBee 2006 protocol stack provided free of charge by TIChipcon, and is based on the GenericApp routine in the Zstack-1.4.3-1.2.1 version. The following are the programs for the serial port part and the data receiving and sending parts.
3.2.1 Serial port initialization
Mainly set the halUARTCfg_t structure member values:
By assigning values to halUARTCfg_t, you can set the baud rate, number of characters, data bits, stop bits, parity bits, etc. Among them, callBackFunc is a custom serial port callback function, that is, once there is data transmission at the export, OSAL will automatically switch to the custom callback function and perform the custom operation.
3.2.2 Data Reception
When data is sent to the application layer via wireless, the application layer sends an AF_INCOMING_MSG_CMD message event.
Here it means receiving the AF_INCOMING_MSG_CMD message event, then calling the information processing function GenericApp_MessageMSGCB (MSGpkt) of the received message event, starting to receive data and sending and receiving data by calling the serial port HalUARTWrite (uint8 port, uint8*buf, uintl6 len) write function.
3.2.3 Data transmission
When data is input into the serial port callback function, the application layer will send a GENERICAPP_SEND_MSG_EVT message event.
Call the GenericApp_SendTheMessage() data sending function, which is the AF_DataRequest() function in the ZigBee 2006 protocol stack provided by TI/Chipcon. The specific form is as follows:
The program is written in Franklin C51 language, which is easy to read, portable and develop.
3.3. 1 Initialize RTL8019AS
Reset operation is performed by connecting RTL8019AS' RESDRV through C51's P3.4. RSTDRV high level is effective, as long as a high level of more than 1μs is applied to the pin.
Initialize page 0 and page 1 related registers. The registers of page 2 are read-only and cannot be set. The registers of page 3 are not compatible with NE2000 and do not need to be set.
(1) CR = 0x21, select the register of page 0;
(2) TPSR = 0x45, the starting page address of the send page, initialized to point to the page of the first send buffer, that is, 0x40;
(3) PSTART=0x4c, PSTOP=0x80, construct buffer ring: 0x4C~0x80;
(4) BNBY = 0x4c, set the pointer;
(5) RCR = 0xcc, set the receive configuration register, use the receive buffer, only receive data packets with the own address (and broadcast address data packets) and multicast address packets, discard packets smaller than 64 B, and do not receive data packets with check errors;
(6) TCR = 0xe0, set the transmit configuration register, enable CRC automatic generation and automatic verification, and work in normal mode;
(7) DCR = 0xe8, set the data configuration register, use FIFO cache, normal mode, 8-bit data DMA;
(8)IMR=0x00, set the interrupt mask register to mask all interrupts;
(9) CR = 0x61, select the register of page 1;
(10) CURR = 0x4d, CURR is the pointer of RTL8019AS to write memory, pointing to the next page of the page currently being written, and points to 0x4c + 1 = 0x4d when initialized;
(11) Set the multi-address registers MAR0~MAR5 to 0x00;
(12) Set the network card address registers PAR0~PAR5;
(13) CR = 0x22, select the register of page 1 and enter normal working state.
3.3.2 Sending Frames
The data to be sent is encapsulated in frame format and sent to the send buffer in RTL8019AS through the remote DMA channel, and then a transmission command is issued to complete the frame transmission. It is necessary to set the Ethernet destination address, Ethernet source address, and protocol type, and then set the data segment according to the set protocol type. After that, the remote DMA is started, the data is written into the RAM of RTL8019AS, and then the local DMA is started to send the data to the Internet.
RTL8019AS cannot store the entire data packet into FIFO through DMA channel at one time, so it must wait for the previous data packet to be sent before constructing a new data packet. To improve the sending efficiency, the design divides the 12-page send buffer into two 6-page send buffers, one for data packet sending and the other for constructing new data packets, which are used alternately.
Through debugging, a constructed ARP request packet was received using a PC, and the receiving effect was quite satisfactory.
4 Conclusion
By using the wireless transceiver function of CC2430 and combining the microcontroller with Ethernet to achieve remote communication, a set of urban traffic restriction system for vehicle identification is designed. The system uses the advantages of CC2430 such as low power consumption, low cost and high performance to achieve vehicle identification. The information interaction between the roadside collection unit and the remote computer is realized by using the RTL8019AS Ethernet controller with superior performance and low price. The system mainly completes vehicle identification and vehicle information transmission. After testing, it can accurately identify vehicles and meet the requirements of travel days statistics. The traffic control department can use the vehicle model information to count the number of vehicle travel days as the basis for collecting congestion fees, thereby realizing vehicle restrictions.
Previous article:Design of automatic metering feeding system based on single chip microcomputer 8031
Next article:Application of alarm system in chip
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- 5G high-frequency board material selection and multi-layer board design requirements
- EETALK: What changes has the epidemic brought about in technology?
- "Playing with the board" + Yu Zhennan's STM32 development board experiment 4
- Tomorrow is the winter solstice. Do you eat dumplings or glutinous rice balls?
- 【Home smart dashboard】MQTT communication, PC host computer design
- My 2000th post
- Showing goods + NVIDIA AI small board
- Circuit diagram of two-wheeled electric vehicle
- [Domestic RISC-V Linux Board Fang·Starlight VisionFive Trial Report] Python output HELLOWORLD
- Solutions for control loop design