Low-power wireless temperature and humidity measurement system based on nRF905

Publisher:QianfengLatest update time:2011-08-06 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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]

First of all, ATmega16L has an advanced RISC structure, most instructions are executed in a single clock cycle, and it is an 8-bit microcontroller with the highest MIPS/mW capability. In addition, it also has a 512 B E2PROM, which can store user information when the power is off, and uses FLASH storage technology, which allows the internal storage unit of the microcontroller to be repeatedly erased and written online for more than 1,000 times.
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 The
temperature 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.

Reference address:Low-power wireless temperature and humidity measurement system based on nRF905

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

Design and implementation of wireless communication for LED screen based on nRF905
introduction ZigBee Alliance defines two types of physical devices: one is full function device FFD (full function device); the other is reduced function device RFD (reduced function device). The construction of the network requires the participation of the coordinator (FFD). The entire network formation proces
[Microcontroller]
Design and implementation of wireless communication for LED screen based on nRF905
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号