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:
|
|
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.
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
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Thank you for having you +EE @【chat, laugh, make noise】
- How to write C/C++ code in DSP? + Data types in c6000
- What role does power supply potting glue play in power supplies, and why do power supplies need potting?
- 37 "Ten Thousand Miles" Raspberry Pi Car——ROS Learning (VSCode Debugging ROS)
- How to pack .mpy files into esp8266 micro python firmware package?
- Beidou short message development board based on STM32F103RET6
- Want to know more about UWB? Just read this article.
- When downloading a program to a PCB board in SWD mode, what will happen if the PCB board's own power is not disconnected?
- I would like to ask you guys, what is the value of the bypass capacitor for the LT1763 chip?
- Many people ask whether the soft board can run at high speed...