Single-chip implementation of electronic speedometer
Abstract: This paper introduces an implementation scheme of electronic speed odometer based on single chip microcomputer. The principle of mileage counting and the principle of speed indication are discussed. The specific circuit schematic diagram of the vehicle speed odometer designed with single chip AT89C2051 and LM1819 driver is given. This article refers to the address: http:// 1 Overview The traditional car speed odometer has two functions, one is to use the pointer to indicate the instantaneous speed of the car, and the other is to use the mechanical counter to record the accumulated mileage of the car. Hyundai Motor is developing in the direction of high speed. With the increase of the speed of the car, the traditional speedometer driven by the flexible shaft is challenged unprecedentedly. Because the flexible shaft is rotated at high speed, it is easy to be limited by the alternating stress limit of the steel wire. At the same time, if the flexible shaft is arranged too long, deformation or excessive movement may occur. Moreover, for different models, the installation position of the odometer is also limited by the length and curvature of the flexible shaft. All of these have enabled the development of electronic tachometers based on non-contact speed sensors. The speed ratio of the speedometer indicates the number of revolutions that the speedometer's shaft (flexible shaft) turns when the car travels one kilometer. The speedometer based on single-chip microcomputer adopts Hall type non-contact type speed sensor. Each time the speedometer oscilloscope rotates, the Hall sensor will sense 8 pulses. Now take the model with a speed ratio of 1:624 as an example. When the car travels for one kilometer, the number of pulses emitted by the Hall sensor is 8×624=4992, or each pulse represents 1/4992 km. These pulse signals are input to the microcontroller as external interrupt sources, so that each pulse generates an interrupt, and each pulse is counted by the interrupt service routine, so that when the 4992 is full, it indicates that the car has traveled 1 km, and then Add one to the accumulation unit and store it in the EEPROM unit. Finally, the mileage counting function can be realized by refreshing the LCD liquid crystal display. However, it should be noted during programming that the external interrupt of the MCS-51 series MCU has two trigger modes, namely level trigger and edge trigger. This design uses the edge trigger mode, that is, the negative jump causes the interrupt. The speed indication can be a two-coil automobile tachometer, which consists of an air shaft and a drive circuit. The air shaft is usually composed of three parts: a magnet, a pointer connected to the shaft, and two coils of ninety degrees. . The rotating shaft is the only movable part of the watch core. The corner of the magnet always tends to the 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, It is theoretically possible to rotate the spindle assembly in the range of 0 to 360 degrees. Obviously, as long as the two coils can be driven according to a certain law, the pointer deflection position can be linearly related to the input amount, that is, the following formula is satisfied: θ=KVin Where θ is the pointer deflection angle in degrees; K is the corner 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 in the direction of the sum of the two orthogonal vectors Hsine and Hcosine, the direction can be obtained by the following formula? θ=arctan Hsine/Hcosine And thus can be derived: θ=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 strength obtained is the same as the direction of the angle θ, since the direction of the shaft component and the magnetic field strength vector sum are the same. Therefore, the pointer will always point in the direction of the θ angle. Figure 1 shows the internal component block diagram of the LM1819 driver. It consists of a charge pump, a shaper, a function generator, etc. The input speed signal is buffered by an internal triode and input to the charge pump for F/V frequency voltage. Conversion, the two outputs vary according to the sine and cosine functions of the input. The minimum drive capability of the 2 and 12 pins is ±20mA (±4V). The common end of the coil is connected to the 1 pin to provide feedback signals for the internal function generator. At the same time, it provides a reference voltage for the 5.1V Zener diode. In this circuit, K=54°/V, the input Vin is actually the potential difference between pin 4 and pin 8. The pin 8 is both the output of the Norton amplifier and the input of the function generator. Generally, the voltage of the 4-pin is 2. 1V, so there are: θ=K(V8-Vref)=54(V8-2.1) Since V8 is varied from 2.1V to 7.1V, the LM1819 can drive the crosshead to rotate from 0° to 270°. Figure 2 shows the circuit schematic of a car speed odometer. This is a typical MCU minimum application system. The AT89C2051 single-chip microcomputer is known for its low price, low power consumption, high reliability and easy programming. The X25045 is an auxiliary chip of the MCS-51 series single-chip circuit, mainly responsible for reset, voltage detection, watchdog and EEPROM functions. The adoption of the chip greatly improves the reliability of the system, reduces the number of peripheral chips, and realizes the cumulative power-down storage of mileage. The LCM1010 is a ten-digit, eight-segment, backlit LCD module with a three-wire serial interface that features low power consumption and ease of programming. The display is divided into two lines. The first line of 6 digits shows 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 clear key, and R4 is used to adjust the viewing angle contrast of the liquid crystal display. The chip X25045 is a CMOS serial EEPROM with a programmable μP monitor from Xicor, with 4096 bits organized by 512×8. It has a 4-byte page write mode and 100,000 cycles of use, and the data can be stored for 100 years. In order to ensure that the unit of the accumulated mileage unit or the decimal place of the subtotal unit is reliably refreshed, when these units are close to the limit life cycle, a page change method can be adopted to move the data to the new unit to continue counting. This design uses the AT89C2051 single-chip microcomputer to realize mileage accumulation, subtotal, clearing and storage, and drives the cross-coil head with LM1819 integrated circuit, thus realizing the indication of vehicle speed. The design is low in cost, good in pointer stability, fast in response, strong in shock resistance, high in reliability and cost performance. The actual use proves that the odometer can completely replace the traditional speed-driven odometer. Of course, this is only an implementation scheme. It is also possible to drive the cross-coil head by software from a single-chip microcomputer, that is, the sinusoidal coil and the cosine coil of the meter head are separately controlled by the single-chip microcomputer, and the LM1819 integrated circuit is omitted. This will not be repeated here. Self Test Gfci With Tr Outlet,20 Amp Gfci Plug,20 Amp Gfci Receptacle,Double Gfci Outlet Lishui Trimone Electrical Technology Co., Ltd , https://www.3gracegfci.com
2 mileage accumulation principle
3 speed measurement and indication principle
4 circuit schematic
   The pulse signal sent by the Hall sensor can be divided into two ways after being shaped, one way is sent to the INT1 end of the single chip for accumulating the mileage count, and the other way is sent to the speed signal input end (10 feet) of the LM1819 driver, and then the driving circuit is based on the input signal. The frequency outputs corresponding sine and cosine drive signals at pins 2 and 12, and the magnetic field generated by the Phillips coil acts on the magnet to deflect the shaft assembly at a corresponding angle. However, it should be noted that the size of the capacitor C3 will change the smoothness of the deflection of the hands. The larger the C3, the better the smoothness, but the time lag will increase, and the C3 will cause the hands to shake. C4 can be used to adjust the circuit. Linearity and hysteresis error; the value of R4 can change the indicated scale point of the hands.
5 Conclusion