1. Design Overview
This design uses the USB port as the power supply port, uses the DS18B20 temperature sensor to collect temperature information, uses the AT89C2051 single-chip microcomputer for control, and uses a four-digit common anode digital tube display to achieve temperature measurement and display (the system block diagram is shown in Figure 1). This design can cultivate students' interest in learning single-chip microcomputers and improve their production and programming capabilities.
Figure 1 System Block Diagram
2. Circuit Principle
The PROteUS simulation software is used for schematic design and program simulation. The circuit is shown in Figure 2.
Figure 2 Circuit diagram
1. Power supply
The USB port is used for power supply. The USB adapter can be connected to the USB port of the circuit board or directly to the USB port of the computer . In this way, resources can be saved and a more ideal working voltage can be obtained. The appearance of the USB port and the definition of the power port are shown in Figure 3.
Figure 3 USB port appearance and power port definition
2. Temperature signal acquisition
The DS18B20 (see Figure 4 for appearance) intelligent digital temperature sensor is used as the temperature signal acquisition device.
Figure 4 DS18B20 appearance
(1) Working principle of DS18B20
The read/write timing and temperature measurement principle of DS18B20 are the same as those of DS1820, except that the number of bits of the obtained temperature value is different, and the delay time of temperature conversion is reduced from 2s to 750ms. The temperature measurement principle of DS18B20 is shown in Figure 5. Among them, the oscillation frequency of the low temperature coefficient crystal oscillator is little affected by temperature, and is used to generate a fixed frequency pulse signal to counter 1. The oscillation frequency of the high temperature coefficient crystal oscillator changes significantly with temperature, and the generated signal is used as the pulse input of counter 2. Counter 1 and the temperature register are preset to a base value corresponding to -55℃. Counter 1 subtracts the pulse signal generated by the low temperature coefficient crystal oscillator. When the preset value of counter 1 is reduced to 0, the value of the temperature register will be increased by 1, counter 1 will be re-preset, and the pulse signal generated by the low temperature coefficient crystal oscillator will be counted again. This cycle continues until counter 2 counts to OH and stops accumulating the temperature register value. At this time, the value in the temperature register is the measured temperature. The slope accumulator in FIG5 is used to compensate and correct the nonlinearity in the temperature measurement process, and its output is used to correct the preset value of counter 1.
Figure 5 DS18B20 temperature measurement principle diagram [page]
(2) Main features of DS18B20
1) The adaptable voltage range is 3.0V~5.5V, and it can be powered by the data line in parasitic power supply mode.
2) Only one line is needed between DS18B20 and microprocessor for two-way communication.
3) Support multi-point networking function, multiple DS18B20 can be connected in parallel on the only three wires to achieve multi-point temperature measurement in networking.
4) No peripheral components are required, all sensor elements and conversion circuits are integrated in a circuit that looks like a transistor.
5) The temperature measurement range is -55℃~+125℃, and the accuracy is ±0.5℃ at -10℃~+85℃.
6) The programmable resolution is 9 to 12 bits, and the corresponding resolvable temperatures are 0.5°C, 0.25°C, 0.125°C and 0.0625°C, respectively, which can achieve high-precision temperature measurement.
7) At 9-bit resolution, it takes a maximum of 93.75ms to convert the temperature to digital, and at 12-bit resolution, it takes a maximum of 750ms to convert the temperature value to digital.
8) Directly output digital temperature signal and transmit it serially to CPU via a one-wire bus . CRC check code can also be transmitted at the same time, which has strong anti-interference and error correction capabilities.
9) When the power polarity is reversed, the chip will not burn out due to heat, but it will not work normally.
DS18B20 follows the single bus protocol. Each temperature measurement must go through four processes: initialization, transmission of ROM commands, transmission of RAM commands, and data exchange.
3. AT89C2051 microcontroller
The AT89C2051 microcontroller is used as the main control component (see Figure 2).
4. Digital tube display
A four-digit common anode digital tube is used for dynamic display, and the temperature display is retained to one decimal place. When programming, P3.2~P3.5 is used as the bit selection end of the dynamic display of the digital tube, and Pl.0~Pl.7 is used as the segment selection bit of the dynamic display of the digital tube. When P3.2 outputs a high level, the "1" digital tube is selected, and when P3.3 outputs a high level, the "2" digital tube is selected, and so on. In the circuit, P3.2~P3.5 are connected to 4 NPN transistors as drivers. Pl.0~Pl.7 are connected to 8 resistors for current limiting.
3. Reference Program
This design uses the microcontroller C language for programming. Due to space limitations, the reference programs are not listed here one by one.
4. Production and debugging
The design is relatively simple to debug. As long as the installation and welding are correct and the program is written accurately and completely, it is generally easy to realize the function.
The debugged object is shown in Figure 6.
Figure 6 Actual picture
Previous article:Application design of contactless IC card reader for public transportation
Next article:Development of Fixed Telephone Short Message Terminal Based on 80C31
Recommended ReadingLatest update time:2024-11-16 16:33
- Popular Resources
- Popular amplifiers
- Virtualization Technology Practice Guide - High-efficiency and low-cost solutions for small and medium-sized enterprises (Wang Chunhai)
- usb_host_device_code
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
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
- W806 Lighting
- Download the information and watch the video to win a prize | Tektronix HDMI 2.1 test solution is now available for download, and you can also watch the supporting video
- Things to note when using C/C++ to write programs based on TMS320 series DSP
- Generate sine wave data using microcontroller DAC and C language
- RISC-V RVB2601 First Experience--Section 4--Sensor Module Interface
- Based on micropython-1.9.4 ESP8266 motor control firmware
- MATLAB reads txt file data and processes it
- Easy to use, LiChuang EDA. Haha!
- [Start at 10:30] Interpretation of TI's latest smart lock, visual doorbell, and network camera solutions, and recommendations for its core components
- C6678 multi-core DSP development - connected domain marking of vlib application