Wireless temperature and humidity monitoring system based on CXA1191 and SHT11

Publisher:RadiantEyesLatest update time:2014-10-29 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
    In industrial and agricultural production, meteorology, environmental protection and other departments, it is often necessary to measure and control the ambient temperature and humidity. Accurate temperature and humidity measurement is even more important for industries such as biopharmaceuticals, food processing and papermaking. With the improvement of the automation and intelligence of measurement technology, various temperature and humidity acquisition systems have been widely used. Traditional temperature and humidity measurement adopts wired transmission. Generally, analog temperature and humidity sensors are used to directly convert non-electrical quantities into electrical quantities, and then send them to PCs or single-chip microcomputers for subsequent processing. Its disadvantages are: first, the wiring workload is large and the cost is high. When the transmission distance is long, it will also introduce large errors and interference; second, analog humidity sensors generally need to design signal conditioning circuits and need to go through complex calibration and calibration processes. Therefore, the measurement accuracy is difficult to guarantee, and the linearity, repeatability, interchangeability, consistency and other aspects are often unsatisfactory. Although there are some wireless temperature and humidity acquisition solutions, their transmission part is mostly implemented by expensive dedicated wireless modules. When a large number of nodes need to be deployed in the application, the system cost of using dedicated modules will be greatly increased, which is difficult to meet the user needs in low-cost, multi-node application environments, such as some small-scale, individual agricultural environmental control.
    In order to improve the cost performance of the system, this paper proposes a low-cost temperature and humidity acquisition solution based on CXA1191, which is mainly aimed at application requirements with high precision, small data volume, large number of nodes and cost sensitivity. This solution combines broadcast reception technology with modern digital technology. On the basis of in-depth research on the principle of CXA1191 receiving circuit, it combines encoding devices and single-chip microcomputer systems to realize low-cost wireless transmission of digital signals. The system uses high-performance SHT11 temperature and humidity sensors to measure temperature and humidity. It uses its high integration characteristics to simplify the design, reduce costs, and improve the practicality of the system.

1 Overview
    The temperature and humidity acquisition system adopts a master-slave distributed structure. The system consists of a PC, a convergence node and multiple wireless sub-nodes distributed in different locations. The convergence node and the sub-nodes use wireless communication, and the PC communicates with the convergence node through the RS232 bus. The convergence node obtains the on-site temperature and humidity parameters from each sub-node, and uploads the collected data to the PC for processing and display via the RS232 bus. The node consists of transmitting and receiving circuits, encoding circuits, single-chip microcomputer systems, keyboards and displays. The transmitting circuit is built with discrete components and adopts AM modulation. The receiving circuit uses CXA1191 to amplify, mix and filter the RF signal, and convert the wireless signal to the intermediate frequency. The intermediate frequency processing is completed by the detection circuit and the encoding and decoding circuit. The system structure and node structure are shown in Figure 1 and Figure 2. The RS232 communication function in Figure 2 is only unique to the aggregation node, and the SHT temperature and humidity acquisition device is only unique to the sub-node.

a.JPG



2 Receiving Circuit
    At present, wireless data communication is mostly implemented by dedicated modules, and there are many wireless data transmission modules available on the market. These dedicated modules are simple to use and fully functional, so even designers with less experience in RF development can quickly get started. The disadvantage is that the price is high, and the cost performance is not ideal when facing applications with small data volume, low functional requirements and a large number of nodes. However, if you design the circuit yourself, it is often difficult to implement due to the high difficulty of RF design, large debugging workload and lack of experience of designers. The receiving circuit structure is the most complex. Taking the above factors into consideration, this article adopts a compromise solution, that is, using the internal circuit of CXA1191 with a few external components, which not only realizes the function of RF reception, but also simplifies the structure. Developers only need basic radio knowledge to complete the design independently.
    CXA1191 is a single-chip large-scale radio circuit. It is quite popular in China because of its high integration, few peripheral components and excellent performance. Most of the popular "Tesun" radios use this chip. CXA1191 includes all the functions of AM/FM radio, from antenna input, high frequency amplifier, mixing, local oscillator, intermediate frequency amplifier, detection to audio power amplifier. Figure 3 shows the FM circuit of CXA1191 used in the design (the detection and decoding part in the figure is an extension of this design).

b.JPG


    When the CXA1191 is in the FM receiving state, the wireless signal first passes through the bandpass filter, and then enters the 12th pin to complete the high-frequency amplification internally. The amplified signal is mixed with the local oscillator to produce a 10.7 MHz intermediate frequency signal. In the normal radio mode (as shown by the dotted line in the figure), the intermediate frequency signal is selected by the 10.7 MHz ceramic filter and connected to the 17th pin. After internal frequency discrimination, detection and audio amplification, the speaker is driven to produce sound.
    Through the above analysis, it is not difficult to find that the structure of the CXA1191 can be divided into two parts: 1) low noise amplifier, mixing, filtering part (that is, the circuit for obtaining the 10.7 MHz intermediate frequency signal), which is the general structure of a general superheterodyne receiver; 2) frequency discrimination, detection and amplification, which is its proprietary structure for audio signal demodulation processing. Its general structure can be used as the RF front end of digital communication. For example, if there is an ASK (amplitude shift keying) signal with a carrier frequency within 87 to 109 MHz, the signal can pass through the bandpass filter and enter the high-frequency amplifier and mixing circuit. By properly adjusting the local oscillator, a 10.7 MHz ASK signal can be obtained at the output of the ceramic filter. This signal still retains the original modulation information, but the carrier frequency is reduced. This is exactly the intermediate frequency ASK signal we want to obtain. After detecting and decoding this signal, we can get the required digital signal. Experimental verification shows that this idea is feasible.
    The specific design is shown in Figure 3. The modification method is very simple. On the basis of the original CXA1191 frequency modulation circuit, disconnect the connection between the 10.7 MHz filter and pin 17, and connect the output of the filter to the detection circuit behind. Other functions of CXA1191, such as medium wave and short wave reception, are not used, and the circuits associated with them can be omitted, which greatly reduces the task of design and debugging. In actual debugging, it is necessary to pay attention to properly adjust the two tuning circuits of the high-frequency amplifier and the local oscillator, and observe the output of the ceramic filter at the same time, and try to maximize the output amplitude and minimize the noise and distortion.

3
    When the transmitting circuit sends data, the microcontroller first sends the data to be sent to PT2262 for encoding. The 17th pin of F12262 outputs the encoded pulse, and the high-frequency oscillator generates an ASK signal under this pulse modulation and transmits it through the antenna. As shown in Figure 4. The pulse signal controls the base of the transmitting tube to turn on and off, and the output amplitude of the oscillator also changes accordingly, and there are only two states of maximum value and zero value, that is, the required ASK signal is obtained. The oscillator is connected in a Clapper form, in which the base-emitter capacitor and the collector-emitter capacitor are used. The surface acoustic wave device SAW frequency stabilization is used to make the circuit very stable. SAW works in a series resonant state, so that part of the inductance of L1 is connected to the base-collector to form a capacitor three-point oscillator. The formula for calculating the operating frequency of the oscillator is c.JPG, and this design sets the oscillation frequency at 90MHz.

d.JPG



4 Encoding and
    decoding circuit The encoding and decoding function is completed by PT2262/PT2272. PT2262/PT2272 is a pair of wireless transmitter and receiver chips with address and data encoding functions. Its 7, 8, 10 to 13 pins are data terminals, 1 to 6 pins are address terminals, and the transmission is started when the 14th pin is low level. The 17th pin serially outputs the coded pulse signal containing the address and data. Figure 5 is the decoding circuit.

e.JPG


    During decoding, the ASK signal from the 10.7 MHz filter is first detected by VD, C1, and R2, and then amplified by LM358 and sent to the decoding input pin 14 of PT2272. When decoding is successful, VT changes from low to high, and the decoded data appears on the data pin for the microcontroller to read. It should be noted that the address code settings of the transmitting and receiving chips must be the same. PT2272 must perform two address comparisons on the received signal. Only when the address is correct can there be valid data output.

5 Temperature and humidity acquisition circuit
    The temperature and humidity acquisition is based on SHT11, which is a new temperature and humidity sensor based on CMOSensTM technology launched by Sensirion. SHT11 integrates temperature sensor, humidity sensor, signal conditioning, analog-to- digital converter , calibration parameters and I2C bus interface into the sensor, which not only improves the performance of the sensor, but also reduces the cost and size. It is also very convenient to interface with the microcontroller, and is an ideal choice for embedded system temperature and humidity testing.
    The SHT11 interface is very simple, including only four pins: power supply (Vdd), ground (GND), serial clock input (SCK), and serial data (DATA). Each measurement requires three processes: "start transmission", "send command", and "read data". DATA changes state after the falling edge of SCK and is valid at the rising edge of SCK.
    "Start transmission" is used to initialize SHT11, which is completed by a specific timing of SCK and DATA, as shown in Figure 6. At the rising edge of the SCK clock, DATA flips to a low level, and when the next SCK rising edge arrives, DATA flips to a high level, thus completing the "start transmission" timing.

f.JPG


    The next command to be sent is a 1-byte command, including 3 address bits and 5 command bits. The transmission of the command requires 8 SCK cycles. After the command transmission is completed, SHT11 will give a DATA low-level pulse between the 8th and 9th SCK falling edges to indicate correct reception.
    If a measurement command is sent ("00000101" represents relative humidity RH, "00000011" represents temperature T), the external controller must wait for the measurement to end. SHT11 indicates the end of the measurement by giving a DATA low-level pulse. Then transmit 2 bytes of measurement data and 1 byte of CRC parity. The external controller needs to confirm each byte by pulling down DATA to a low level. The data transmission timing is shown in Figure 7.

g.JPG


    After obtaining the digital value of temperature and humidity, it is necessary to convert it into actual physical quantity according to the formula provided in the SHT11 manual. The temperature sensor of SHT11 uses the bandgap material PTAT, which has excellent linear performance. The digital value can be directly converted into temperature value according to the following formula:
    h.JPG
    Where SOT is the measured value, and the values ​​of d1 and d2 are shown in Table 1.

i.JPG


    The humidity sensor is nonlinear and needs to be calculated using the following correction formula:
    j.JPG
    SORH is the relative humidity measurement value of the sensor, and the values ​​of the coefficients c1c2c3 are shown in Table 2.

k.JPG


    When the actual measured temperature is significantly different from 25°C, the temperature correction coefficient of the humidity sensor should be considered:
    m.JPG
    the temperature correction coefficient is shown in Table 3.

m.JPG



6 The system control
    node is based on the single-chip microcomputer system, which controls the coordinated work of each functional unit. The single-chip microcomputer has four main control tasks:
    1) Control the transceiver circuit to complete the reception and transmission of data;
    2) Interpret the command sent by the aggregation node into the corresponding control action (sub-nodes have it), collect and store the data of each sub-node (master node has it);
    3) Timing control SHT11 to complete the temperature and humidity data collection:
    4) Communicate with the PC and upload the temperature and humidity data.
    The single-chip microcomputer selects the low-power MSP430 . MSP430 is a 16-bit, ultra-low-power hybrid single-chip microcomputer with a reduced instruction set. It has extremely low power consumption, rich on-chip peripherals and convenient and flexible development methods, and is very suitable for embedded applications.
    The aggregation node and the sub-node adopt a simple master-slave communication protocol. The aggregation node sends a query command containing the node address code to each node in turn at regular intervals. The slave nodes are all programmed with different addresses, and only respond to commands that match their own addresses, and send the collected temperature and humidity data back to the master node. In order to improve the anti-interference ability of the system, an error retransmission mechanism is introduced in the software. After the aggregation node sends a query command to the child node, if no data is received within the specified time, the query command is initiated again. If the query fails three times, the node is considered to be faulty and the node number is recorded. After obtaining
the data from each slave node, the aggregation node packages the data and uploads it to the PC. The PC uses VC6.0 to design the host computer software, uses the MSComm control to realize serial port communication with the aggregation node, realizes the temperature and humidity display interface, and performs digital filtering on the measured data to effectively improve the measurement accuracy. The software flow charts of the aggregation node and the master node are shown in Figures 8 and 9.

n.JPG



7 Conclusion
    Wireless temperature and humidity measurement is widely needed in the field of industrial and agricultural production. Solutions based on dedicated wireless modules are difficult to meet low-cost application requirements. This paper proposes a new idea of ​​using CXA1191 to implement the RF front end, combining digital technology and high-performance SHT11 temperature and humidity collectors to design a wireless temperature and humidity measurement system with high cost performance. After actual testing, the system works stably. The data accuracy is within 3%, which can well meet the actual application needs.

Reference address:Wireless temperature and humidity monitoring system based on CXA1191 and SHT11

Previous article:Application of CPCI Single Board Computer in Airbus Inflight Entertainment System
Next article:Research on the Automobile Remote Monitoring System Based on GPRS

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号