This design uses AT89C51 as the core part of the entire control system, and collects temperature through DS18B20 through three buttons: mode switch key, plus key and minus key. The mode switch key can switch between normal display, upper limit temperature setting state, and lower limit temperature setting state. When the measured temperature is higher than the set upper limit value, the buzzer alarms and the LED red light flashes to alarm. When the measured temperature is higher than the set lower limit value, the buzzer alarms and the LED yellow light flashes to alarm. The system can easily realize temperature collection and alarm, and can set the upper and lower limit alarm temperatures as needed. It is very convenient to use, with the advantages of high accuracy, wide range, high sensitivity, small size, and low power consumption. It is suitable for temperature measurement in our daily life and industrial and agricultural production. It can also be used as a temperature processing module to sneak into other systems as an auxiliary expansion of other main systems.
3.1 Selection and Introduction of MCU
The CPU is the core of the entire control part. Considering the economy and meeting the needs, this design uses AT89C51 as the core of the entire control system. It contains a memory that can be used to program the system. Flash memory is powerful. When programming it, it can not only be operated online, but also can be operated using general methods. The compiled program is mainly stored in the chip, and its function is relatively powerful. Therefore, AT89C51 is selected as the control center of this design. The device pin diagram is shown in Figure 3-1:
Figure 3-1 AT89C51 pin diagram
AT89C51 Introduction: The erasable read-only memory of the microcontroller can be repeatedly erased 1000 times. The device is manufactured using ATMEL's high-density non-volatile memory manufacturing technology and is compatible with the industry-standard MCS-51 instruction set and output pins. Due to the combination of a multi-functional 8-bit CPU and flash memory in a single chip, ATMEL's AT89C51 is an efficient microcontroller, and the AT89C051 is a streamlined version of it. The AT89C51 microcontroller provides a highly flexible and inexpensive solution for many embedded control systems. The appearance and pin arrangement are shown in the figure.
3.2 Minimum system module
In this course design, according to the needs of the subject, the AT89C51 chip of the 51 series microcontroller of ATMEL Company is used as the control chip. In actual application, if only the microcontroller chip is used, it is impossible to achieve the designed purpose. There must also be matching circuits to form a complete control system to meet the design requirements. In this design, the AT89C51 chip and the matching circuits are mainly used to form the required modules for research. Some specific parameters in the module are mainly to use the P3 port as the 1602 command data control, clock, read and write control, and enable control interface, the P2 port as the key scan interface, and the P2.3 as the DS18B20 bus interface. P2.5 and P2.7 are used as alarm control interfaces. The circuit connection diagram 3-2 is as follows:
Figure 3-2 Data processing and control module
3.3 Temperature sensor design
3.3.1 Introduction to Temperature Sensor
DS18B20 can set 9~12 bit resolution, which has high accuracy. In order to meet the actual work needs, a relatively small sealing mode and a relatively wide voltage can also be used. The set resolution and alarm temperature are stored in EPROM and will not be lost after power failure.
The pinout of the temperature sensor DS18B20 is shown in Figure 3-3.
Figure 3-3 DS18B20TO-92 package temperature sensor
Pin function description:
VDD: Optional power pin, power supply voltage range 3~5.5V.
DQ: Data input/output pin. Drain is open circuit, high level in normal state.
GND: Ground power pin.
The components of DS18B20 mainly include: photolithography 64-bit ROM, temperature sensor, non-volatile temperature alarm triggers TH and TL, and configuration registers, which are arranged in a certain structure inside.
The serial number arrangement of the photolithography 64-bit ROM has a certain pattern. Generally, the first one is the 8-digit product label of different types, followed by the 48-digit serial number of the DS18B20, and the last one is the check code of all the previous serial numbers. Through summary, we can know that the role of the 64 photolithography ROM is to ensure that each DS18B20 is different, so as to meet the requirements of connecting multiple DS18B20 on the bus.
The high-speed memory mainly included in the DS18B20 temperature sensor is very easy to lose. The memory RAM is mainly composed of eight bytes, and the contents of these eight bytes are very different. The first byte is the lower eight bits, the second byte is the upper eight bits, the third and fourth bytes are non-volatile copies of the highest and lowest bits, and the fifth byte is a non-volatile copy of the structure register. The third, fourth, and fifth bytes refresh the content at each power-on reset. The sixth, seventh, and eighth bytes are used for internal calculations. The ninth byte is a redundant test. The main function of E2RAM is to store high and low temperature triggers TH and TL.
Through the communication protocol of DS18B20, we know that the temperature conversion when the host controls it mainly consists of three steps. Each time you read and write DS18B20, you need to reset it. After completing the setting, you need to send a command. Only after sending the corresponding command can you perform related operations. After receiving the reset request, the CPU needs to pull down and then release it. After a certain period of time, the signal can be reset.
3.3.2 Connection between temperature sensor and single-chip microcomputer The interface model used by the temperature sensor when connected to the single-chip microcomputer is P2.0, which belongs to the high-order address line in the single-chip microcomputer. The P2 port is an 8-bit bidirectional I/O with an internal pull-up resistor. In addition, it can drive 4 logic gate circuits when outputting buffers. The operation of the P2 port is not affected by external interference, and it can work normally even when the program is being written and checked. Figure 3-4 shows the composition of DS18820.
Figure 3-4 Interface connection between DS18B20 and microcontroller
3.4 LCD display module
The characters stored in this module are composed of different characters, including English letters, common mathematical symbols and Arabic numerals. Different characters have different codes. For example, the capital A in English letters represents 41h. If the display is used to send, the module will display 41h, but the letter A will be displayed on the LCD.
The controller of the 1602 LCD module mainly has 11 instructions. A large number of control instructions can better control the program and meet its working needs.
The LCD1602 liquid crystal module used is a standard 16-pin socket, and the interface circuit is shown in Figure 3.6
Figure 3.6 shows the connection diagram of the circuit
3.5 Overall block diagram of system hardware
The overall block diagram of the system hardware is shown in Figure 3.7
Figure 3.7 Overall block diagram of system hardware
single-chip microcomputers and peripheral devices. It is currently a relatively good tool for simulating single-chip microcomputers and peripheral devices. Although it has just started to be promoted in China, it has been favored by single-chip microcomputer enthusiasts, teachers engaged in single-chip microcomputer teaching, and scientific and technological workers dedicated to the development and application of single-chip microcomputers. The simulation component resources that Proteus can provide: simulate thousands of components such as digital and analog, AC and DC, and there are more than 30 component libraries. .Proteus can provide simulation instrument resources: oscilloscope, logic analyzer, virtual terminal, SPI debugger, I2C debugger, signal generator, pattern generator, AC and DC voltmeter, AC and DC ammeter. In theory, the same instrument can be called at will in a circuit. In addition to the existing instruments, Proteus also provides a graphical display function that can display the changing signals on the line in real time in a graphical way. Its function is similar to that of an oscilloscope, but it has more functions. These virtual instruments have ideal parameter indicators, such as extremely high input impedance and extremely low output impedance. These minimize the impact of the instrument on the measurement results. Proteus provides debugging methods Proteus provides a relatively rich test signal for circuit testing. These test signals include analog signals and digital signals.
Previous article:Design of Hall Effect Water Flow Meter Based on 51 Single Chip Microcomputer
Next article:Design of intelligent heart rate and body temperature detection system based on single chip microcomputer
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- Europe's three largest chip giants re-examine their supply chains
- Breaking through the intelligent competition, Changan Automobile opens the "God's perspective"
- The world's first fully digital chassis, looking forward to the debut of the U7 PHEV and EV versions
- Design of automotive LIN communication simulator based on Renesas MCU
- When will solid-state batteries become popular?
- Adding solid-state batteries, CATL wants to continue to be the "King of Ning"
- The agency predicts that my country's public electric vehicle charging piles will reach 3.6 million this year, accounting for nearly 70% of the world
- U.S. senators urge NHTSA to issue new vehicle safety rules
- Giants step up investment, accelerating the application of solid-state batteries
- Guangzhou Auto Show: End-to-end competition accelerates, autonomous driving fully impacts luxury...
- Keil and chip package
- RX3400 Application Note
- Mobile and portable popular data download collection
- Some Div+CSS material sites
- FPGA program loading and curing
- EEWORLD University ---- Training series for BQ76952 & BQ76942, 3-16S & 3-10S battery monit
- Calibration of artificial mains networks
- Using Dynamic Library to Realize Data Transfer between VXI Embedded Computers in Windows Environment
- TMS320F28335 generates SPWM
- Periodic feedback pure digital phase-locked loop based on actel fpga