O Introduction
The measurement of temperature and humidity is widely used in greenhouse management of agricultural production, warehouse grain storage management, manufacturing industry, meteorological observation, constant temperature and humidity air-conditioned room scientific research and daily life. It can be said that temperature and humidity are a very important factor affecting daily production and life as well as scientific research. At present, many fields in China, such as agricultural production, still use the traditional method of combining temperature measuring instruments with manual transcription and management, which is not only inefficient, but also causes many serious losses due to misjudgment and poor management.
The system uses the low-power microcontroller ATmega16L with built-in SPI and two-wire serial interface as the control chip, uses the wireless transceiver node composed of nRF905 chip, and uses the digital temperature and humidity sensor SHT11 to complete the temperature and humidity measurement system of the environment. At the same time, the system reserves the MAX232 interface to facilitate communication with the PC, realizing the real-time display and monitoring functions of temperature and humidity.
1 System Description
As shown in Figure 1 and Figure 2, the block diagram of the sending and receiving modules of the low-power temperature and humidity wireless measurement system is shown.
Figure 1 is the wireless sending module, which uses Atmega16L as the main control core to control the temperature and humidity sensor SHT11 to collect the temperature and humidity of the environment, and then uses the nRF905 wireless transmission module to send the collected temperature and humidity data to the temperature and humidity measurement wireless receiving module for corresponding processing.
Figure 2 is a temperature and humidity measurement wireless receiving module, which uses Atmega16L as the main control core, uses nRF905 wireless transmission module to receive temperature and humidity data, and then uses MAX3232 to upload to the PC, and uses related host computer software for real-time monitoring.
2 Hardware circuit design
2.1 3.3 V power supply module
The voltage required for this design is 3.3 V, so the LM1117-3.3 power supply system is used, as shown in Figure 3. The devices used in the wireless transmission module and the temperature and humidity measurement module are all low-power devices. For the transmitter, a 5 V battery can be used for power supply, which is very suitable for temperature and humidity measurement and collection in the wild. The receiver can be powered by a 5 V switching power supply. Its core component LM1117-3.3 is a low-dropout voltage regulator series. The voltage difference is 1.2 V output, and the corresponding load current is 800 mA.
2.2 Single-chip microcomputer control circuit
This design uses the high-performance, low-power 8-bit AVR microprocessor ATmega16L as the control chip. [page]
Secondly, the operating voltage range of Atmega16L is 2.7~5.5 V, and it has sleep mode, idle mode, power-down mode and power-saving mode. These various modes also make Atmega16L one of the best control chips for low-power products.
Finally, Atmega16L provides two-wire digital serial interfaces SDA and SCL, and the interface is simple. Supporting host and slave operation, the device can work in transmitter mode or receiver mode, and supports multi-host arbitration.
2.3 Wireless transceiver module
The wireless transceiver chip uses the single-chip wireless transceiver chip nRF905 from Nordic, Norway. The operating voltage is 1.9-3.6 V, and it works in three ISM channels of 433/868/915 MHz, with a maximum data rate of 100 Kb/s. The chip integrates a frequency synthesizer, a receiving demodulator, a power amplifier, a crystal oscillator and a modulator. Its main features are that it can automatically process headers and CRC redundancy checks, and it can be directly configured through the SPI interface. In addition, its power consumption is very low. When transmitting with an output power of -10 dBm, the current is only 11 mA, and when working in the receiving mode, the current is 12.5 mA. It also has built-in idle mode and shutdown mode, which makes it easy to achieve energy saving.
The application circuit of nRF905 is shown in Figure 4. The circuit mainly uses the circuit composed of nRF905 and peripheral devices to form a wireless transmission and reception circuit. Figure 4 shows a loop antenna diagram connected differentially with nRF905. Among them, the SPI interface pins MOSI, MISO, and SCK of the nRF905 module are connected to the SPI interface pins PB5 (MOSI), PB6 (MISO), and PB7 (SCK) of the Atmega16L respectively. The SPI interface of nRF905 works in slave mode and uses a loop antenna to transmit signals.
In order to make full use of energy, nRF905 sets two working modes and two energy-saving modes, which are determined by the three pins TRX_CE, TX_EN and PWR_UP respectively. Therefore, the design uses PA2~PA7 of Atmega16L to connect to the control detection of nRF905 for switching modes and coordinating communication. Table 1 shows the working modes and corresponding functions of nRF905.
[page]
2.4 Temperature and humidity measurement module Thetemperature and humidity measurement in this design uses the single-chip fully calibrated digital new relative humidity and temperature sensor SHT11 with a two-wire serial interface produced by the Swiss Sensiri2on company. SHT11 can be used to measure parameters such as relative humidity, temperature and dew point, and has the characteristics of digital output, no debugging, no calibration, no peripheral circuit and full interchangeability.
The relative humidity measurement range of SHT11's humidity/temperature sensor system is 0-100%, with a resolution of 0.03%RH and a maximum accuracy of ±2%RH. The temperature measurement range is -40-+123.8℃, with a resolution of 0.1℃.
The default resolution of the SHT11 sensor for measuring temperature and relative humidity is 14 bits and 12 bits respectively, which can be reduced to 12 bits and 8 bits through the status register, and has a reliable C2RC data transmission verification function. In addition, the power supply voltage range is 2.4-5.5 V; the current consumption is small: 550 μA when measuring, 28 μA on average, and 3 μA when sleeping. It is one of the best choices for low-power products.
The application circuit of SHT11 is shown in Figure 5. VDD and GND are connected through a 0.1μF decoupling capacitor, and the SCK and DATA of its I2C interface are directly connected to the two-wire serial interface of Atmega16L through a 4.7 kΩ pull-up resistor SCL and SDA for data transmission and exchange.
2.5 Host computer interface circuit
In order to facilitate monitoring, the host computer function is introduced and the serial communication module is added. The peripheral circuit of the dedicated conversion chip MAX3232 from 3.3 V to RS 232 level (±12 V) is shown in Figure 6, where the five capacitors are all taken as the typical value of 0.1μF. The serial port DB9 only uses three wires, the 5th terminal is connected to the system ground, and the 2nd and 3rd terminals are the receiving and transmitting terminals respectively. The DB9 interface is connected to the PC through a cross serial line, so that hardware serial communication can be completed.
3 System software design
System software design includes two parts: temperature and humidity measurement and wireless transmission and reception.
3.1 Temperature and humidity measurement
For temperature and humidity, they are not physical quantities that change rapidly. The changes in temperature and humidity are often slow. Therefore, based on this feature, the measurement and collection of temperature and humidity do not need to be carried out all the time. Instead, it is collected every T time (T depends on actual needs, and this system uses 1 s). The rest of the time, the MCU is in a dormant state due to the requirement of low power consumption. The program flow is shown in Figure 7. Among them, Atmega16L enters the dormant state by programming the sleep enable of SE, and enters the corresponding power saving mode after programming SM 2.0, and then wakes up Atmega16L through the timing interrupt of the timer, and then performs measurement and data transmission.
[page]
3.2 Wireless Transmission
and Reception For wireless transmission, after measuring the transmitted data, the reliability of data transmission should be considered, so a verification function is added, and in order to prevent the adverse consequences of accidental transmission failure, a timed waiting mode is adopted, and retransmission after timeout, and the sleep mode is entered only after receiving the command from the receiving host. The specific flow chart is shown in Figure 8.
For the receiving end, the task is to detect the wireless receiving module at all times and verify the received data. If the data is received correctly, the receiving end is informed by wireless transmission of relevant instructions so that it can enter the sleep power saving mode as soon as possible, and the temperature and humidity are displayed through the host computer; if the wrong data is received, no processing is performed and the receiving end is waited for to send data again.
The corresponding initialization procedure is as follows:
unsigned char RFConf[11]=
{
Ox00, //Configuration command //
0x6C, //CH_NO, configure the frequency band at 433.2 MHz
OxOC, //Output power is 10 dB, no retransmission, power saving is normal mode
0x44, //Address width setting is 4 B
0x02, 0x02, //Receive and send effective data length is 3 B
0xE0, 0xE0, 0xE0, 0xE0, //Receive address
0x1E, //CRC enable, 16-bit CRC check, external clock signal enable, 16 MHz crystal oscillator
};
for(unsigned char i=0; i<11; i++)
SPDR=RFConf[i];
//SPDR is the SPI data register of Atmegal-16L. For the corresponding configuration, see the data sheet.
In actual operation, the sending and receiving of nRF905 are realized by the following commands:
write transmit data command: 20H;
read transmit data command: 21H;
write transmit address command: 22H;
read transmit address command: 23H;
read receive data command: 24H.
4 Conclusion
The system uses the AVR series low-power microcontroller ATmega16L as the control chip and the low-power chip nRF905 as the wireless transceiver module. It designs and implements a temperature and humidity wireless measurement system based on the digital temperature and humidity sensor SHT11. These low-power products make the system consume less power and are particularly suitable for miniaturization, intelligence, and instrumentation of the system. The wireless transmission function replaces the tedious manual meter reading, making this system have a wide range of application prospects.
Previous article:Design of USB Bus Data Acquisition Device Driver
Next article:Design of intelligent temperature and humidity acquisition system based on CAN bus
Recommended ReadingLatest update time:2024-11-16 20:50
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Mission-oriented wireless communications for cooperative sensing in intelligent unmanned systems
- Principles of Digital Communications (Gallagher)
- Chip Manufacturing: A Practical Tutorial on Semiconductor Process Technology (Sixth Edition)
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- 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
- TMS320C6678 Evaluation Module
- Power Line Communication Simulation Reference Design for RS-485
- Buck circuit ripple test oscilloscope settings problem
- [RISC-V MCU CH32V103 Review] RTC Electronic Clock
- 2596 ADJ proportional resistance selection
- Reference design of a true wireless headset charging box with ultra-low standby power consumption
- Is there any D/E power amplifier related information recommended?
- Continue to ask for help and supplement the "Sketch of Halogen Lamp Driver Power Supply Schematic" drawing.
- TV remote control detailed introduction principle and composition
- Transformer noise