51 Single-Chip Microcomputer Implementation of Electronic Speedometer

Publisher:温暖梦想Latest update time:2011-12-28 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Overview

Traditional car tachometers have two functions: one is to indicate the instantaneous speed of the car with a pointer, and the other is to record the accumulated mileage of the car with a mechanical counter. Modern cars are developing in the direction of high speed. As the speed of the car increases, the traditional speedometer driven by a flexible shaft is facing unprecedented challenges. This is because the flexible shaft is prone to breakage when rotating at high speed due to the limitation of the alternating stress limit of the steel wire. At the same time, if the flexible shaft is arranged too long, it will cause excessive deformation or motion hysteresis. Moreover, for different car models, the installation position of the tachometer will also be limited by the length and curvature of the flexible shaft. All these factors have led to the rapid development of electronic tachometers based on non-contact speed sensors.

2 Principle of mileage accumulation

The speed ratio of the speedometer indicates the number of revolutions of the speedometer shaft (flexible shaft) when the car travels one kilometer. The speedometer based on the single-chip microcomputer adopts a Hall-type non-contact speed sensor. For each revolution of the speedometer shaft, the Hall sensor will sense and send out 8 pulses. Now take the car with a speed ratio of 1:624 as an example? The car travels one kilometer? Then the number of pulses sent by the Hall sensor is 8×624=4992, or in other words, each pulse represents 1/4992 kilometers of mileage. These pulse signals are input to the single-chip microcomputer as external interrupt sources, so that each pulse generates an interrupt, and each pulse is counted through the interrupt service program. In this way, when the count reaches 4992, it means that the car has traveled 1 kilometer, and then the cumulative unit is added by one and stored in the EEPROM unit. Finally, the mileage counting function can be realized by refreshing the LCD display. However , it should be noted during programming that the external interrupt of the MCS-51 series microcontroller has two triggering modes, namely level triggering and edge triggering. This design uses the edge triggering mode, that is, the negative jump is used to cause the interrupt.

The speed indicator can use a double-coil automobile tachometer head, which consists of an air-shaft core and a drive circuit. The air-shaft core usually consists of three parts: a magnet, a pointer connected to the shaft, and two coils at 90 degrees to each other. The shaft is the only movable part of the core. The rotation angle of the magnet always tends to the synthetic direction of the magnetic field strength vector of the two coils. The magnetic field strength is proportional to the voltage applied to the coil. Therefore, by changing the polarity and amplitude of the voltage, the shaft assembly can theoretically rotate within the range of 0 to 360 degrees. Obviously, as long as the two coils can be driven according to a certain rule, the pointer deflection position can be linearly related to the input quantity, that is, the following formula is satisfied:

θ=KVinn

Where θ is the pointer deflection angle, in degrees; K is the angle constant, in degrees/V; Vin is the input voltage, in V.

The sum of the magnetic field strength vectors of each coil must follow the deflection angle θ. Considering that the shaft assembly always points to the direction of the sum of the two orthogonal vectors Hsine and Hcosine, its direction can be obtained by the following formula:

θ=arctan Hsine/Hcosine

And from this we can conclude:

θ=arctan sinθ/cosθ

It can be seen from the above formula that when Hsine changes according to the sine function of θ and Hcosine changes according to the cosine function of θ, the direction of the total magnetic field intensity obtained is the same as the direction of the angle θ. Since the direction of the shaft assembly is the same as the direction of the sum of the magnetic field intensity vectors, the pointer will always point to the direction of the angle θ.

Figure 1 shows the internal block diagram of the LM1819 driver, which consists of a charge pump, a shaper, a function generator, etc. The input speed signal is buffered by the internal triode and then input to the charge pump for F/V frequency voltage conversion. The two output terminals change according to the sine and cosine functions of the input quantity. The minimum driving capacity of pins 2 and 12 is ±20mA (±4V). The common end of the coil is connected to pin 1 to provide feedback signals for the internal function generator and provide reference voltage for the 5.1V Zener diode. In this circuit, K = 54°/V, and the input Vin is actually the potential difference between pins 4 and 8. Pin 8 is both the output of the Norton amplifier and the input of the function generator. Generally, the voltage of pin 4 is 2.1V, so:

θ=K(V8-Vref)=54(V8-2.1)

Since V8 varies in the range of 2.1V to 7.1V, LM1819 can drive the crosshead to rotate in the range of 0° to 270°

.

Figure 2 shows a circuit schematic diagram of a car tachometer. This is a typical single-chip microcomputer minimum application system. The single-chip microcomputer AT89C2051 is famous for its low price, low power consumption, high reliability and easy programming. X25045 is an auxiliary chip of the MCS-51 series single-chip microcomputer circuit, which mainly performs reset, voltage detection, watchdog and EEPROM functions. The use of this chip greatly improves the reliability of the system, reduces the number of peripheral chips, and can realize the power-off storage of mileage accumulation. LCM1010 is a ten-digit eight-segment LCD display module with backlight, using a three-wire serial interface. It has the characteristics of low power consumption and easy programming. The display is divided into two lines. The first line of 6 digits displays the accumulated mileage, and the second line of 4 digits (1 decimal place) is used to display the subtotal mileage. In the figure, K1 is the subtotal mileage reset key, and R4 is used to adjust the viewing angle contrast of the LCD display. The chip X25045 is a CMOS serial EEPROM with a programmable μP monitor launched by Xicor. It has 4096 bits and is organized as 512×8. It has a 4-byte page write mode and 100,000 use cycles, and the data can be stored for 100 years. In order to ensure the reliable refresh of the units of the cumulative mileage unit or the decimal places of the subtotal unit, when these units are close to the limit of the use cycle, the page change method can be adopted to move these data to the new unit to continue counting. The pulse signal emitted by the Hall sensor can be divided into two paths after shaping. One path is sent to the INT1 end of the microcontroller for cumulative mileage counting, and the other path is sent to the speed signal input end (pin 10) of the LM1819 driver. Then the drive circuit outputs the corresponding sine and cosine drive signals at pins 2 and 12 according to the frequency of the input signal. The magnetic field generated by the cross coil acts on the magnet to deflect the shaft assembly to a corresponding angle. However, it should be noted that the size of capacitor C3 will change the smoothness of the needle deflection. The larger the C3, the better the smoothness, but at the same time the time delay will also increase. If C3 is too small, the needle will shake. C4 can be used to adjust the linearity and hysteresis error of the circuit. The value of R4 can change the indication scale point of the needle. 5 Conclusion



This design uses the single-chip microcomputer AT89C2051 to realize mileage accumulation, subtotal, clearing and storage, and uses the LM1819 integrated circuit to drive the cross coil meter head, thereby realizing the indication of vehicle speed. This design scheme has low cost, good pointer stability, fast response speed, strong shock resistance, high reliability and cost performance. It has been proved by actual use that this odometer can completely replace the traditional speedometer driven by a flexible shaft. Of course, this is only one implementation scheme. The cross coil meter head can also be driven by the single-chip microcomputer through software, that is, the single-chip microcomputer controls the sine coil and cosine coil of the meter head respectively, and the LM1819 integrated circuit is omitted. This will not be repeated here.

Reference address:51 Single-Chip Microcomputer Implementation of Electronic Speedometer

Previous article:51 single-chip computer password lock that can prevent multiple password attempts
Next article:Application of Information Button DS1991 in 51 Single Chip Microcomputer System

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

Naxin Micro releases new automotive-grade programmable stepper motor driver NSD8381-Q1
December 15, 2023, Shanghai - With the rapid popularization of intelligent new energy vehicles, a series of high-end configurations such as adaptive headlights, centralized thermal management systems, and HUD head-up displays are gradually becoming industry standards. This trend has also led to a rapid incre
[Power Management]
Naxin Micro releases new automotive-grade programmable stepper motor driver NSD8381-Q1
Design considerations and measurement methods for motors and drives
  With the rapid development of the Internet of Things and motor control technology, the degree of automation in factory production is getting higher and higher. Industrial robots were originally only used in the production of high-end products such as automobiles, but now they are becoming more and more popular. Many
[Test Measurement]
Design considerations and measurement methods for motors and drives
Design of Linux CAN bus driver based on MCP2515
1 Introduction        CAN (Controller Area Network) bus, or controller area network bus, is a serial communication network that effectively supports distributed control or real-time control. Due to its high performance, high reliability, unique design and suitable price, it is widely used in industrial field control,
[Microcontroller]
Design of Linux CAN bus driver based on MCP2515
Analysis of LED drive circuit using capacitor voltage reduction
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 application c
[Power Management]
Analysis of LED drive circuit using capacitor voltage reduction
Explaining high current LED driving technology
One of the most popular features in today's mobile phones is a built-in digital camera that can take high-resolution photos and videos. With the advent of broadband 3G networks, the demand for high-resolution photos and new applications such as video conferencing continues to increase the performance of integrated
[Power Management]
High-efficiency white LED driver solution--Semtech SC442
Semtech's SC442 is a 10-channel high-efficiency 120- white light LED driver with an input voltage of 4.5V-21V. The high-efficiency boost converter can make the output voltage up to 42V, which is very suitable for medium to large LCD displays . The current level is programm
[Power Management]
High-efficiency white LED driver solution--Semtech SC442
Driving LED offline lighting to its full potential
 While it may be years before a  viable screw-in  LED replaces incandescent bulbs, the use of LEDs in architectural lighting is growing, offering greater reliability and energy savings potential. Like most electronics, a power supply is needed to convert the input power into a form usable by the LEDs. In a streetlight
[Power Management]
Driving LED offline lighting to its full potential
Analysis of the application of LED driver power supply in LED lamps
LED is short for light emitting diode. Due to its many advantages such as environmental protection, long life, high photoelectric efficiency (the current luminous efficiency has reached 100LM/W), and earthquake resistance, its application in various industries has been rapidly developed in recent years. In theory, t
[Power Management]
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号