Abstract A design and implementation method for real-time monitoring of temperature and humidity is proposed. The design process is explained and a hardware connection diagram is given. In order to realize the transmission of measurement data, some software design schemes are introduced. The designed measurement system can meet the real-time monitoring of temperature and humidity.
Keywords Temperature and humidity measurement; SHTll chip;
MSP430F149
chip
This paper will introduce a temperature and humidity measurement system implemented by a digital temperature and humidity sensor SHTll and an ultra-low power microcontroller MSP430F149. The system can conveniently realize real-time monitoring of temperature and humidity.
1 Chip Introduction
SHTll is a digital temperature and humidity sensor produced by Sensirion. It is a fully calibrated digital output sensor that integrates temperature sensitive elements, humidity sensitive elements, signal amplifiers and conditioners, 14-bit A/D converters and two-wire serial interface circuits. The chip can directly provide a digital output with a resolution of 14 bits in the temperature range of -40 to 120°C and a digital output with a resolution of 12 bits in the humidity range of 0 to 100% RH. Since the chip has the advantages of fast response speed, strong anti-interference ability and high cost performance, the SHTll chip is used as the measurement unit.
The SHTll chip also has a heater inside, which can be used to achieve the following functions.
(1) The comparison of the relative temperature and humidity values measured before and after heating can determine whether the sensor is in a normal working state.
(2) Using a heater in a humid environment can avoid condensation of the sensor, and at the same time can shorten the response time and improve the measurement accuracy.
(3) A heater is also required when achieving high-quality dew point measurement.
2 Hardware Design
In the hardware design, the temperature and humidity signals are converted into analog voltage signals through the temperature sensitive element and humidity sensitive element inside the SHTll. The analog voltage signals are amplified by the signal amplifier and conditioner inside the SHTll, and then converted to digital, calibrated and corrected by the A/D converter. Finally, the relative temperature or humidity data is transmitted to the ultra-low power microprocessor MSP430F149 through the bidirectional data port DATA of the two-wire serial interface. When the MSP430F149 microprocessor receives the data, it displays the temperature and humidity values through the P4 and P5 ports via LEDs. Since the P1 port has an interrupt function, the specific parameters of the alarm can be input through the matrix keyboard. After comparison, if an alarm is required, the temperature and humidity alarms are output through the P3 port through the relevant peripheral circuits. The specific hardware connection is shown in Figure 1.
Because SHTll is accessed through a two-wire serial interface, the hardware interface circuit is very simple. It should be noted that the DATA data line requires an external resistor. The clock line SCLK is used for synchronous communication between the ultra-low power microprocessor MSP430F149 and SHTll. Since the interface contains completely static logic, there is no requirement for the minimum frequency of SCLK.
The temperature and humidity values can be displayed by LED. If you need to save pins, you can use a shift register to realize the static display of LED. For example, the 8-bit shift register SN74HC595D chip. The operating voltage of this chip is 2~6 V, and it can be directly connected to the MSP430 series microcontroller. Part of the connection circuit is shown in Figure 2.
Among them, the serial cascade is realized through the serial output pin of SN74HC595D, so that the display of two digital segments can be controlled. P4.1 and P4.2 of the microprocessor are respectively connected to the latch input signal port RCLK and the shift clock signal port SRCLK to generate latch signals and shift clock signals respectively. OE is grounded to enable the output. Based on the above circuit, the number of displayed bits can be increased by increasing the number of SN74HC595D.
The matrix keyboard consists of row lines and column lines. The input of the keyboard is mainly captured by scanning. Scanning means that the microcontroller continuously sets the row lines to low level in turn, and then checks the input status of the column lines. Figure 3 is the keyboard circuit.
3 Software Design
3.1 Measurement Design
At the beginning of the program, the microprocessor first uses a set of "start transmission" timing to indicate the initialization of data transmission, and then issues an 8-bit command code, which contains 3 address bits (must be set to 000) and 5 command bits. After sending the command code (the meaning of the command code is shown in Table 1), the DATA data line is set to the input state to wait for the response of SHTll. After SHTll receives the above address and command code, it pulls down the DATA data line to a low level at the 8th clock falling edge as a response signal. After the 9th clock falling edge, SHTll restores the DATA data line to a high level, which indicates that the measurement instruction has been correctly received. After the DATA data line is restored, SHTll starts to measure the current temperature or humidity. After the measurement is completed, the DATA data line is pulled down to a low level again, which indicates that the measurement has ended. After the microprocessor detects that the DATA data line is pulled low, it gives a clock signal. SHTll then transmits 2 bits of measurement data and 1 bit of verification data.
The microprocessor needs to confirm each byte by pulling down the DATA data line. First, the high byte data is output at 8 clock falling edges. At the 9th clock falling edge, the microprocessor pulls the DATA line low as a response signal, and then releases the DATA line. At the next 8 clock falling edges, SHTll sends low byte data; at the next clock falling edge, the microprocessor pulls the DATA line low again as a response signal for receiving data. At the last 8 clock falling edges, SHTll sends verification data. If the microprocessor does not respond, it means that the communication is over. After the measurement and communication are completed, SHTll automatically enters sleep mode. After testing, the system can monitor temperature and humidity.
3.2 LED display design
The microprocessor outputs data to SN74HC595D serially through the P4.0 port. After outputting one byte, if a latch signal is given, the SN74HC595D will output in parallel and display the data on the digital tube. If no latch signal is given, but the second byte continues to be output, then the first SN74HC595D outputs the previous byte of data to the input pin of the second SN7 4HC595D through the serial output pin. When the output is finished, the two SN74HC595Ds store two bytes of data respectively. At this time, if the microprocessor gives a latch signal, the two SN74HC595Ds display the data on the two digital tubes through parallel output.
3.3 Keyboard input design
Since all column lines are pulled up to 3.3 V, all column lines are high when no key is pressed. If a low level is output on the P1.7 pin and a high level is output on other pins of the row line, when the "S01" key is pressed, P1.0 is low; when the "S02" key is pressed, P1.1 is low; when the "S03" key is pressed, P1.2 is low; when the "S04" key is pressed, P1.3 is low. By setting the output of a row line, the corresponding state on the column line can be obtained, thereby obtaining the keyboard input value. Similarly, if a low level is output on other column lines in turn, the input values of other keys can be obtained. Through this scanning method, keyboard input can be achieved. The keyboard scanning result is shown in Figure 4.
It can be seen that when the 4, 0, 5 and 6 keys of the keyboard are pressed, the single chip microcomputer can receive accurate data. After the parameters are entered, the microprocessor will compare the data with the stored parameters each time it measures the data, and an alarm will be issued if it exceeds the limit.
4 Conclusion
This paper introduces the implementation scheme of the digital temperature and humidity monitoring system, the hardware connection and the design of each functional part. After testing, the system can realize real-time measurement and monitoring of temperature and humidity, meeting the design requirements.
Previous article:Design of CMOS Pseudo-Differential Class E RF Power Amplifier
Next article:Design of educational robot hardware system based on TMS32OLF24O7A
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- 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
- 【EVK-NINA-B400 Evaluation Kit】+New Project
- There is a reason to enter the IT industry early
- Studying Things to Gain Knowledge 04: Finite Angular Displacement is Not a Vector
- Sinlinx A33 Development Board Linux Interrupt Programming 2--- Program Framework
- Insights on Faster, Better Wi-Fi Deployment in Asia
- 【Project source code】NIOS digital photo frame based on dual SDRAM image cache
- 2.4g antenna impedance Π type circuit debugging
- A comprehensive review of power chips at home and abroad (with core technologies, main products, key applications, main customers, competitive advantages, etc.)
- I am going to do a DVI acquisition and storage project. What is the idea of implementing it?
- Last day: Watch the power supply seminar to share 3000 yuan - How to correctly complete the modular DC-DC system design