Smart test
Design and Realization of Digital Thermometer Based on RS-232
introduction
The measurement of temperature is closely related to industrial and agricultural production, such as greenhouse vegetables. The effect of temperature on them is obvious. People can taste various seasonal fruits in their lives. The big reason is that the growers have made reasonable adjustments to their growing environment and provided suitable temperature conditions. However, the existing temperature measurement system still has shortcomings. It cannot transmit data over long distances. The real-time effect is poor. It still needs to be strengthened. The purpose and significance of this design is to improve the existing equipment to obtain higher benefits and improve people's Quality of Life.
1, system scheme design
According to the preliminary idea, the receiving end can receive the data sent by the sending end through the signal line and display the data. The block diagram is shown in Figure 1.
The design and realization of digital thermometer based on RS-232
Figure 1 Block diagram of temperature measurement transmission system
This design decides to use 51 series single-chip microcomputer STC89C52 as the main control chip of the transmitter and receiver. The temperature sensor is used to collect the temperature at the transmitter and display on the LCD1620 of the transmitter and receiver respectively. At the same time, two temperature transmissions are used. For comparison, one can be used as a reference and the other can be changed to observe the effect. MAX232 is used for level conversion, and data is transmitted via the serial port RS-232.
2, hardware circuit design
The sender uses the single-chip microcomputer chip STC89C52 as the control chip, the digital temperature sensor DS18B20 collects the temperature and sends it to the single-chip microcomputer for storage, and the LCD1620 connected to the single-chip displays the collected temperature. The overall design block diagram is shown in Figure 2.
The design and realization of a digital thermometer based on RS-232
Figure 2 System design block diagram
The main control chip uses the STC89C52 single-chip microcomputer. In order to cooperate with its internal clock signal, an 11.0592MHz crystal oscillator is connected to the 18 and 19 pins. The reset circuit makes the capacitance high and connects it to low through a resistor. The other pins are connected to the input and output ports of the single-chip microcomputer as other modules.
The main control chip of the receiving end uses the single-chip microcomputer STC89C52, which has a crystal oscillator circuit and a reset circuit around it, and the specific connection method is the same as that of the sending end.
The main components used in the temperature acquisition circuit are: temperature sensor DS18B20, which is connected to the microcontroller: VDD is connected to the external power supply, GND is grounded, and DQ is connected to the I/O line of the microcontroller. The temperature acquisition circuit is shown in Figure 3.
The design and realization of digital thermometer based on RS-232
Figure three temperature acquisition circuit
LCD1620 is a widely used liquid crystal display. It has the advantages of clear display and high cost performance. Each pin of the LCD has its own specific function. The temperature data display circuit is shown in Figure 4.
The design and realization of a digital thermometer based on RS-232
Figure 4 Temperature data display circuit
In the design of the data transmission circuit, the serial port RS-232 and the MAX232 that conforms to all RS-232 standards and plays a role of level conversion will be used. The data input and output ports are respectively connected to the sending end and the receiving end for data transmission. , The design of the system is relatively simple, so the serial port type used is 9-pin RS-232.
3, system software development
The software part is mainly composed of main program flow (main), temperature acquisition flow (DS18B20), function module setting flow (mode), temperature display flow (LCD1620) and temperature alarm flow.
After the system is powered on, the serial port is initialized, and the sending end judges whether the temperature sensor has collected two channels of temperature data. After the data is collected, it is first displayed on the LCD screen of the sender, and then the main control chip of the sender judges whether the control switch is pressed. If it is pressed, the data is transmitted to the serial port and stored in the buffer, otherwise the test continues until it is detected. At the same time, the main control chip STC89C52 at the receiving end judges whether the buffer flag is set, and when set, the data is received and the information is displayed on the LCD screen. If the temperature exceeds the set alarm value, an alarm signal will be issued. normal display. The specific process is shown in Figure 5.
The design and realization of digital thermometer based on RS-232
Figure 5 System main program flow chart
4 Conclusion
It is of far-reaching significance to improve the degree and reliability of the temperature measurement system in production and life, so that it can effectively monitor and alarm the temperature in real time. Choose a scheme to design the hardware circuit of the system, and improve the lower temperature measurement system to further improve its performance.