Design of Digital Tachometer Based on Single Chip Microcomputer

Publisher:wmghyuLatest update time:2012-07-09 Source: 自动化与仪器仪表 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction

In industrial control, speed measurement is often required. Generally, a contact tachometer is used. This tachometer must be placed against the center of the shaft to measure. It is inconvenient to use, has great limitations, and is not very safe. Therefore, we designed a non-contact tachometer using a photoelectric sensor. The measurement range is from 1.0 to 9999 rpm, and the four-digit digital tube display is accurate to 0.1 rpm when the measured speed is less than 1000 rpm.

1 Measurement principle

A piece of aluminum foil is attached to the rotating shaft to be measured as a reflector. When the reflector moves to the front of the photoelectric sensor, the infrared beam emitted by the photoelectric sensor is reflected back and received by the infrared receiving tube on the photoelectric sensor, generating a pulse signal. We use the edge of this signal to trigger the high-precision timer inside the microcontroller for timing, with an accuracy of up to 1μs. When the reflector moves to the front of the photoelectric sensor again, the edge of the light reflection signal is used to stop the microcontroller timing. In this way, the rotation period t of the shaft is accurately measured, and then the microcontroller converts the period into the rotation speed and displays it through the LED digital tube.

2 Circuit structure and software design

The circuit structure is shown in Figure 1. Because of the requirement of small size and high display brightness, the scanning display mode is adopted. However, it is not possible to use one CPU to complete measurement and display at the same time. The scanning function will seriously affect the measurement of the CPU. Therefore, two AT89C2051 microcontrollers produced by ATMEL are used to perform the functions respectively. AT89C2051 has built-in 2KB EEPROM program memory and 128 bytes of RAM, and each pin can absorb 20mA of current and other good characteristics. CPU1 is used to measure the rotation period of the rotating shaft and convert it into speed, and then send the display data to CPU2. CPU2 usually just scans the display data continuously. When CPU1 sends data, CPU2 generates an interrupt, receives the data immediately, and then updates the display data, so that the data on the four-digit LED digital tube is immediately updated. The advantage of using two CPUs is that the circuit structure is clear, the programming is simple, and the modular design is realized. The serial interface mode 2 is used between the CPUs to communicate in the form of interrupts. The communication part of the program list of CPU2 is as follows:

Click to browse products in a new window
Click to browse products in a new window

3 Conclusion

After actual use, the tachometer we designed has achieved the pre-conceived purpose. It is easy to use and reliable. Moreover, because of this structural design, the input/output port of CPU1 is rarely occupied, so its function can be expanded. For example, we installed a switch to add the function of photoelectric counter (the probe is shared). In addition, we can also use CPU2 and four-digit LED common anode digital tube to form a universal display module. In addition to displaying numbers such as 0 to 9, it can also display characters such as A-J, L, O, P, q, r, U, Y, etc. In this way, if we want to use LED digital tube display when designing other circuits, we don’t need to program and make plates. Just use this universal display module, which is simple and convenient. If this display module does not expand the input and output lines, it can display up to five digits of seven-segment digital tubes.

Reference address:Design of Digital Tachometer Based on Single Chip Microcomputer

Previous article:Design of a control system for applying pesticides to fruit trees based on C8051F
Next article:Programming of Single Chip Microcomputer Clock Circuit

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号