You are on page 1of 8

Scientific Journal of Control Engineering February 2014, Volume 4, Issue 1, PP.

8-15

The Design of FSAE Race Car Speed Display System Based on 51 Single Chip
Youying Hua, Yuanyuan Li #
College of Electrical and Electronic Engineering, Shanghai University of Engineering Science, Shanghai, China, 201620
#Email:

liyuanyuanedu@163.com

Abstract
Students Formula One racing speed display system is through the speed of acquisition, signal analysis and display output to achieve the speed display. The topics selected the Hall sensor to collect the vehicle wheel edge speed; 89C51 micro-controller and four digital cathode tube to simulate the real-time analysis and display output of the speed signal. In the subject of the implementation process, the signal from the Hall sensor is converted to the rising edge signal to input 89C51; MCU internal timer and counter counts the rising edge number; C language program to count the rising edge of signal and convert it into the speed signal. Finally use digital tube to display car speed. After testing, the system run well, has high reliability and can show the car speed clearly. Keywords: Car Speed Display; Hall Sensor; 89C51; C Language

INTRODUCTION
Auto industry has travelled 100 years of development. Car dashboard technology constantly developed and evolved. Speed is an important parameter in the process of driving. Now, types, specifications and grades of speedometers are various. There are traditional mechanical shaft speedometer, frequency conversion electronic speedometer and more advanced intelligent digital speedometer based on MCU.[1,2] Automobile speed display is an important part of the automotive performance analysis and automotive instrument display. As to the FSAE racing speed display system, by extracting the FSAE racing speed, after the software programming, through digital tube display to achieve. This paper selects the Hall sensor to acquire speed signals, 89C51 microcontroller for signal processing, through a four common cathode LED output speed.

1 The Working Principle of Hall Sensor


Hall sensor is a kind of magnetic sensor. It can be used to measure the magnetic field and its variation, and can be used in many magnetic field related occasions. Hall sensor is divided into: Hall element and Hall IC. The former is a simple Hall plate; it often needs to be used after Hall voltage amplified. The latter one integrates the Hall chip and its signal processing circuit on a single chip. Hall sensor signal processing circuit is divided into linear circuit and switch circuit. Hall switch circuit, also known as the Hall-digital circuit, composed by voltage regulator, Hall plate, differential amplifier, Schmitt trigger and output stage. Under the action of external magnetic field, when the magnetic induction exceeds the conduction threshold BOP, Hall circuit output tube on state, output low level. Thereafter, further increase B, still maintaining the conduction state. If the value of B is reduced to BRP, the output [ 3, 4 ] tube is turned off, output high level. The design of this article is mainly about Hall switch circuit .

1.1 Hall Effect


Hall effect discovered in 1879 by A.H.Hall, which defines the relationship between the magnetic field and induced voltage, it is completely different from conventional induction effect. As shown in Figure 1, an energized semiconductor slice, applying a magnetic field B which perpendicular to the slice surface, the lateral sides of the slice will appear a voltage U H , this phenomenon is the Hall effect. U H called Hall voltage. The origin of this
-8http://www.sj-ce.org

phenomenon is because the carrier in energized semiconductor film forced by the Lorenz force generated from the magnetic field, respectively deflect and accumulate to the film lateral sides. Thus forming an electric field, is known as the Hall field. The electric field force generated by Hall electric field is contrary to Lorenz force which prevents the carrier accumulation until it is equal to the Lorenz force. At this time, the film both sides establish a stable voltage. This is the Hall voltage.

Wwidth of semiconductor chip (m), Llength of semiconductor chip (m), dthickness of semiconductor chip (m), BPerpendicular to the film surface magnetic field (T), Iconductor current (A), U H Hall voltage (V)

FIGURE 1 HALL EFFECT DIAGRAM

Although many years ago we know and understand this effect, but before the material technology has achieved significant progress, the sensor based on Hall effect was not practical. Until it appears high strength constant magnet and signal regulation circuit work in low voltage. According to the design and configuration, the Hall effect sensor can be used as a switch sensor or a linear sensor. [5]

1.2 Hall Wheel Speed Sensor


The Hall wheel speed sensor is composed of a sensing head and the ring gear, the consists of a permanent magnet, Hall element and electronic circuit, as shown in Figure2.[6] Its working principle is the magnetic field lines of the permanent magnet through Hall element to the gear, the gear is equivalent to a collect-magnetic appliance. When the gear tooth top is close to the sensor head, the magnetic field lines passing through the Hall element is mass, the magnetic field is relatively strong; When the alveolus near the sensor head, the magnetic field lines passing through the Hall element is dispersed, the magnetic field is relatively weak. Gear rotates, the magnetic field lines density through the Hall element changes which causing changes in Hall voltage. Hall element will output a mV sine wave voltage. This AC signal should be converted into a standard pulse voltage via the electronic circuit. The Hall element output mV sinusoidal voltage which amplified into a V voltage signal by the amplifier, then input Schmitt trigger. By triggers, the sinusoidal signal convert into a standard pulse signal and sent to the amplifier stage amplification output. Hall wheel speed sensor input 12 V power supply voltage, the output voltage is between 11.5 V and 12 V .

FIGURE2 HALL SENSORS SCHEMATIC

1.3 The Advantages and Disadvantages of Hall Wheel Speed Sensor


Hall wheel speed sensor has the following advantages: Output voltage amplitude not affect by the effect of
-9http://www.sj-ce.org

rotation; High frequency response, the response frequency up to 20kHz, equal to the speed of the frequency of the detected signal when the 1000km/h; Strong ability of anti-electromagnetic interference; Hall sensors are not afraid of contamination or corrosion from dust, oil, water vapor and smoke.

2 51 Micro-controller
51 microcontroller is all compatible with the Intel 8031 instruction microcontroller collectively, is one of the most widely used 8-bit microcontroller, which is widely used in industrial measurement and control system. Now, many companies have compatible appliance for 51 series; 51 series will occupy a large market for a long period of time at present and even the future. 89C51 is a member in 51 family, its development of technology is mature and powerful. 89C51 pinout diagram as shown in Figure 3, it is a kind of low voltage, high performance CMOS 8 bytes microcontroller with 4K bytes of flash programmable and erasable read only memory. Microcontrollers EEPROM can be repeated 100 times and the device is compatible with the industry standard MCS-51s instruction set and pinout .[7-10] The main features of the 89C51:

FIGURE 3 PIN DIAGRAM

(1) Compatible with the MCS-51. (2) 4K bytes programmable flash memory lifetime: 1000 write / erase cycles. (3) Data retention time: 10 years. (4) Fully static operation: 0Hz-24MHz. (5) Three program memory lock. (6) 128*8-bit internal RAM. (7) 32 programmable I/O lines, two 16-bit timer/counter. (8) 5 interrupt sources. (9) Programmable serial channel. (10) Low-power mode of idle and power-down. (11) On-chip oscillator and clock circuit.

3 Based on 51 Microcontroller Speed Display System Design


3.1 System Block Diagram

FIGURE 4 SYSTEM BLOCK DIAGRAM - 10 http://www.sj-ce.org

This system design concept: Using Hall speed sensor and the signal acquisition tooth plate, which installed in car tire and has same speed with car tire, to collect car wheel rotational speed. And through the signal conversion circuit in Hall sensor convert the speed signal to the rising edge signal, then transmit to the microcontroller. After the program calculating, four common cathode LED display real-time vehicle speed. System block diagram in Figure 4.

3.2 Hall Sensor Acquisition Speed


As shown in Figure 5 is the schematic diagram of the installation position of Hall sensor when acquisition wheel speed. According to the principle of magnetic induction, when the tooth top is close to the sensor head, the magnetic field lines between plate and sensor head is mass; When the alveolus near the sensor head, the magnetic field lines is dispersed. When the plate rotates with same speed with the tire speed, by change of tooth and alveolus, form a changing magnetic field. According to Hall principle, variation of the magnetic field can be converted into high and low voltage. Through the signal amplifying and conditioning, the sensor output stability and produce a clear high and low level of voltage signal.[11,12]

FIGURE 5 SCHEMATIC DIAGRAM OF THE INSTALLATION POSITION OF HALL SENSOR

This paper selects the Hall element HAL3144E to analog Hall sensor; using NdFeB magnet to analog signal acquisition gear disc. Then observe the influence of the output of Hall element to speed display system. Between the voltage and output terminals of the Hall element is in parallel with a 10k color ring resistance, which play a step-down effect. The input is connected with a 24V DC power supply, and the output is connected to the oscilloscope to observe the output waveform. After the circuit is well connected, the NdFeB magnet is rhythm to be near/far from Hall element, through the oscilloscope, waveform can be observed clearly. The waveform signal has the obvious upper/lower jump.

3.3 The Microcontroller Peripheral Circuit Design[13]

- 11 http://www.sj-ce.org

FIGURE 6 SPEED DISPLAY SYSTEM PERIPHERAL CIRCUIT

Based on 51 microcontroller peripheral circuits, 89C51 microcontroller as the core; RST connection reset circuit; X1,X2 connected to 12M external crystal oscillator; the P3.5 port connected to the input signal from the Hall sensor, P0 ports connected to four common cathode LED to display output. Speed display system peripheral circuit shown in Figure 6.

3.4 Program Flow Chart[14,15]

FIGURE 7 PROGRAM FLOW CHART

The program flow chart shown in Figure 7, wherein the part of the main program are as follows: void main(void) { Disbuf[0] = 0 // Boot, initialize the buffer 0000H Disbuf[1] = 0 Disbuf[2] = 0 Disbuf[3] = 0 init_timer() while(1) {
- 12 http://www.sj-ce.org

if(Flag_Fresh) { Flag_Fresh = 0 DisplayFresh() // Refresh the digital tube display } if(Flag_clac) { Flag_clac = 0 ClacSpeed() // Calculation speed, and the results into a digital tube buffer Tcounter = 0// Cycle timing reset TH1=TL1 = 0x00// Pulse counter reset } } } The main function is first defined digital tube buffer, initialization buffer 0000H. Next, initialize the timer, the timer initialization function will be detailed later. Then, perform while (1) infinite loop cycle, during the cycle, to judge the digital tube refresh flag. When the digital refresh flag is 1, refresh the digital tube, and the flag is set to 0. Finally, judge the computing flag. When it is 1, calculate the car speed, and put the calculated results into digital tube buffer, then reset cycle timing and pulse counter. Ready for the next round of the loop.

4 Overall System Debugging and Testing


We use the signal generator to simulate, as shown in Figure 8. Set the frequency square wave signal by the signal generator and access to P3.5 of microcontroller, then observing the output of the digital tube. Data analysis and adjusting the parameters of the system, make the actual value to achieve the best theoretical value.

FIGURE 8 SYSTEM DEBUGGING AND TESTING

In the actual match, the scale factor 0.5886 in speed calculation formula of the system program should be obtained from calculation. The gear disc tooth number: 10 teeth; the FSAE racing tire radius: 0.26m. So the size of each tooth corresponding tire length is 0.1635m. Digital tube display speed is the unit of time the car driving distance. Therefore, in unit time (s), tire running distance is the car speed. Microcontroller counting gear disc unit time (s) turned tooth number, the racing distance traveled per unit time can be calculated. Through practical operation, by counting unit of time around the tooth number, calculate the actual speed. Calculation of actual speed: (n is the number of teeth per unit time), finally we can obtain the scale factor for speed formula is 0.5886. Because the theoretical calculation and the actual measured error, therefore, we set a calibration coefficient k. Through the experiment, repeated adjustment of calibration coefficients, we will obtain a calibration coefficient which was similar with the theory of frequency conversion for speed. This calibration coefficient k=1.71, which make calculation and the actual measured most similar. Table 1 is the
- 13 http://www.sj-ce.org

calculation and design of frequency and speed comparison table.


TABLE1 CALCULATED FREQUENCY - SPEED AND ACTUAL SPEED - FREQUENCY TABLE The set frequency Hz 60 Predicted speed km/h 35.316 Oscilloscope displayed frequency Hz Digital display actual speed km/h

80

47.088

100

58.86

110

64.746

120

70.632

140

82.404

160

94.176

5 Conclusion
In the experimental testing and debugging process, we found that there is a certain deviation between the actual speed and the theoretical speed when enter the same frequency.

FIGURE 9 LINEAR FIT OF THE THEORETICAL SPEED AND THE ACTUAL SPEED

Through the test, we can get the relative error between the theoretical speed and the actual speed. The relative error formula: (actual speed theoretical speed)/actual speed*100%. Error fitting curve is shown in Figure 9. Through the analysis, we found that the experimental errors exist, but the errors are less than 3.5%. So it is little impact on the system, so FSAE racing speed display system based on 51 microcontroller enforceability.

REFERENCES
[1] Yang Zhongmin . Car Dashboard Development Status [J] Auto Electric, 2004, (4) :1-3 [2] Zhao Lijun, Luo Nianning, Cui shengmin. A Digital Speedometer Design [A]. 2007 China Automotive Engineering Society - 14 http://www.sj-ce.org

Annual Conference Proceedings [C]. Beijing: Mechanical Industry Press,2007.1007-1010 [3] Song Fuchang. Automotive Sensor Identification and Detection Graphic [M]. Beijing: Electronic Industry Press,2006:98-104 [4] Zhou Runjing, Hao Xiaoxia. Sensors and Detection Technology [M]. Beijing: Electronic Industry Press,2009.4:1-15 [5] Chen Yuzhong. Hall Sensor Speed Measurement System Design [J]. Science Technology and Engineering, 2010,10(30):7529-7532 [6] Zhao Yan. Sensor Principle and Application [M]. Beijing: Peking University Press,2010.2:155-179,217-252 [7] Anonymous. An Engine Speed Measurement Based on MCU [DB/OL]. Http://www.doc88.com/p-993594268631.html, 2011-11-07 [8] Dillipku.Das, Sandeep Sheetal. DATA ACQUISITION USING AT89c51 AND PCL-207[DB/0L]. http://ethesis.nitrkl.ac.in/1053/ [9] Yuan Guici, Ding Shoucheng. 89C51-based Digital Car Dashboard Hardware Circuit Design [J]. Science Technology and Engineering, 2008,8 (22) :6153 -6155 [10] Shamim Choudhury. Motor Speed Measurement Considerations When Using TMS320C24x DSPs[R],2001 [11] Hu Xianzhi. Optical Devices and Applications [M]. Beijing: Electronic Industry Press,2010.1:221-234 [12] Guo Yuesong. Photoelectric Switch Speed Measurement System [J]. Nanjing: Nanjing University of Information Science, 2011 [13] Liu Yuangui, Ma Cong, Gao Ge. Altium Designer Electronic Design & Application Tutorial [M]. Tsinghua University Press,2011:21-40 [14] Gao Feng. Single-chip Microcomputer Principle and Interface Technology (Second Edition) [M]. Science Press, 2011: 12-49, 137-253 [15] Liu Li, Wang Xiang. MCS-51 Microcontroller-based Speed Measurement System [J]. Machinery, 2007,3 (34) :58-60

ABOUT THE AUTHORS


Youying Hua, Female, Undergraduate, research directions for automation (automotive electronics). Now work in Shanghai tobacco group Shanghai cigarette factory.Email: 980204568@qq.com Yuanyuan Li, Female, Graduate, Associate Professor, PhD candidate, Director of the Department of Automation. Principally engage in surface acoustic wave technology, wavelet transform technology, sensor technology and other aspects of research. In sensor technology and the application of wavelet analysis in automotive electronics, wavelet transform processor, the wavelet transform SAW sensor research has accumulated a certain theoretical and technical basis. Email: liyuanyuanedu@163.com

- 15 http://www.sj-ce.org

You might also like