Product Categories

Industry News

Infrared Communications in the use of temperature and humidity transmitter

2010-11-24 21:52:38

1. Overview

  In meteorology, industrial and agricultural production, national defense, environmental protection, aerospace, scientific research departments often need to measure humidity and temperature. With the development of science, there is growing attention to the temperature and humidity testing and control, and a great deal of research work, particularly in the field environment under adverse conditions, how real-time accurate and efficient temperature and humidity measurement,comparison andis very important. Therefore, measurement of hand-held close-range and long distance transmission route is not high operability, put forward using infrared communication technology, combined with high-precisiontemperature and humidity sensors(Temperature & Humidity Sensor), designed the temperature based on infrared communication humidity transmitter integration.

  Infrared communication is a non-contact control technology, with information transmission and reliable anti-interference ability, low cost, easy implementation, low power consumption significant advantages, has been widely used in many electronic devices, and more and more applications to the computer in.

  Infrared communication is mainly by the receiving and sending of two parts. Sender using SCM binary signals to be transmitted as a series of pulse code modulation serial signal transmitting through the infrared emission control infrared signal. Infrared receiver to receive IR signals, the signal detection, amplification, shaping obtained TTL level encoded signal, and then sent to the relevant microcontroller to decode and make a deal.

  2. Binary signal modulation and demodulation

  Infrared communication transmitter instruction is expressed in binary number, usually when they launch command carrier signal with a square wave modulation of these binary pulse train signal into a series of commonly used modulation method is pulse position modulation and pulse width modulation of two.

In this paper, PWM modulation code, it was composed of four ms low and high lead 9ms pulse, 8-bit data is code, 16-bit ID and 8-bit data against code, we want to extract that data code. A PWM code "0" is a high and 0.58ms 0.58ms low level, composed by "1" is a high and a 0.58ms 1.58ms low level constituted.

  Demodulation of binary signals by the integrated infrared receiver HS0038 to complete, a pulse train input, the output terminal outputs low, otherwise the output high.

Decoding the binary signals from the MCU to complete the infrared receiver circuit, which sent the infrared receiver by decoding the binary coding waveform, reducing the sender sends the data.

  Binary signal modulation infrared emission from the MCU to complete the circuit, it is the encoded binary signal into a frequency modulated 38KHz (HS0038, as this selection of infrared receiver, the receiver frequency is 38kHz) of the intermittent pulse train, the equivalent of binary signals code multiplied by the frequency of 38KHz pulse signal received intermittent pulse train, which is modulated infrared emitting diodes used to send the signal.

  

  3. System hardware design

  Infrared emission part of the circuit diagram shown in Figure 1, mainly by the PIC16F73 microcontroller and an external circuit. Microchip PIC16F73 microcontroller produced by the United States 8-bit microcontroller, using Harvard structure, which makes instruction and fetch operations can overlap, so as to achieve high execution speed. It has only 35 single-byte instruction, in addition to the jump instruction is 2-cycle instruction, other instructions are single cycle instructions. Compared to other 8-bit microcontroller saves 1 / 2 of program space, and has four: one of the speed advantage.

 

Figure 1 IR transmitter circuit

  Figure 1 SE303 is the infrared emitting diodes, when PB0 = 1, the transistor 9013 turns on, SE303 infrared emission power, in fact, is the frequency of firing the 38KHz pulse train; the other hand, the transistor 9013 deadline, SE303 deadline, do not launch.

  Figure 1 SHT75 Sensirion Switzerland CMOSens-based technology company launched a new type of temperature and humidity sensors(Temperature & Humidity Sensor). It is a new sensor based on the concept of intelligent design, the sensor detect the temperature and humidity testing, signal processing, digital conversion, serial digital communication interface, digital calibration all integrated into a highly integrated, small volume Among the chip, using it can simultaneously measure the target temperature and humidity, and digital outputs.

  CMOSens technology will not only temperature and humidity sensors(Temperature & Humidity Sensor) together, but will also signal amplifier, analog / digital converter, calibration data memory and other circuit all integrated in one chip. As part of the sensor and circuit together, so that the sensor has a humidity sensor than other types of far superior performance. The first is the increase of the sensor signal strength, enhanced anti-jamming performance of the sensor to ensure the long-term stability of the sensor, while the A / D conversion, while complete, reduce the sensor's sensitivity to interference. Secondly, the sensor chip loaded calibration data to ensure only the humidity sensor each have the same function, which has a 100% interchangeability.

 

Figure 2 IR receiver circuit

  Infrared receiver part of the circuit diagram shown in Figure 2, in this system we use infrared receiver HS0038 is the integration of black epoxy resin, not fluorescent, daylight and other light interference, containing magnetic shielding, high sensitivity, low power consumption . Power in the launch tube with a small case of transmitting the signal, its reception range of up to 36m, it can, and COM, TTL compatible circuits. HS0038 income for the vertical side of the light type, it receives the infrared signal frequency is 38kHz, cycles of about 27μs, while the signal detection can, amplification, shaping, encoded by TTL level signals. Three pins are, the demodulated output signal, +5 V power supply.

  PIC16F73 decoded by SHT75 humidity and temperature data, temperature and humidity through a linear process of compensation and other treatment, then the results sent to LED display, but also the result of hardware circuit by PWM output commonly used in engineering or 0-10V Four-20mA.

  IV. Implementation of the various parts of the system function

  System software using C language, using modular design methods. Part of the program is divided into transmitter and receiver part of the program. Transmitter section includes the main program, coding procedures, launch procedures; receiving section includes the main program, decoding process, temperature and humidity data processing, LED display program, 93C four-6 reading and writing process, regular drivers, interrupt service routine, PWM output program and so on.

  Main program is the control and management of the core. After the first power system for system initialization, the initialization key to complete the crystal chip set, the definition used by the chip pin, bi-directional input and output pins to set the direction, the initialization of the timer , PWM module initialization, interrupt initialization and so on. The definition of chip pin to do the rational allocation of resources, for example, in various time periods for each IO functions to be assigned for what is good, because in the main program interrupt initialization is up and running we should at any time after waiting for an interrupt signal, implement the various parts of the system functions mainly defined interrupt initialization interrupt trigger, interrupt service routine, interrupt form, and so on. After initialization, the system started normal operation, coded, infrared emission, temperature and humidity testing, the reception, conversion, calculation, decoding, etc, and there should be PWM output operation.

  Temperature and humidity data processing program includes the humidity and temperature calculation, testing, the results were linear compensation. SHT75 relative humidity digital output characteristic curve shown in Figure 3, can be seen from Figure 3, the humidity was some non-linear output characteristics, and therefore to adopt formula (1) be amended, which SORH relative humidity for the sensor measurements, The coefficients shown in Table 1.

 
Table 1 Coefficient of linear compensation

Figure 3 Moisture output characteristics

  Humidity and the current temperature value is also related, so also its temperature compensation, the compensation formula as formula (2) shows, the coefficients shown in Table 2.

Table 2 Temperature compensation coefficient

  In addition, temperature and humidity treatment program also has the following features: First, set the temperature and humidity measurements of the resolution, the default measurement resolution was 12bit (humidity), a four-bit (temperature), can also be decreased to 8bit and 12bit, usually in the high-speed or ultralow-powerapplications using this function; second is the "low battery monitoring function, which can be monitored to the Vdd voltage is lower than 2. Four 7V (SHT75 normal operating voltage range is 2. IV V ~ 5.5V) of the state, an accuracy of ± 0.05V; Third, it could be programmed chip heating element can be off, turn the temperature after the SHT75 by about 5 ℃ (9 ℉), increasing power consumption 8mA @ 5V, this function is mainly to compare the heating temperature and humidity values before and after, you can verify the integrated performance of the two sensor elements in high humidity (> 95% RH) environment, the heat sensor also can prevent condensation, and shorten the response time and improve accuracy.

  LED total of four, each 8, a total occupancy of 12 IO channels. LED for real-time display the current temperature or humidity value. LED in the first four to distinguish temperature and humidity values, if the bit is not displayed or a negative sign (-) represents the temperature, if the digital display (H) represents the humidity. Display the corresponding value after three, the last one is decimal.

  6 memory chips with modified four-93C temperature and humidity alarm value upper and lower limits. In the measurement process, if temperature or humidity value reaches the alarm value, the buzzer will sound.

  5.CRCChecksum

  In modern industry, the use of micro-controller for data communicationin industrial controland more extensive. As the transmission distance, site conditions, and many other possible uncertainties, microcontrollers and sensor data communication between the often unpredictable errors will occur. To ensure reliability of data transmission, SHT75 integrates a cyclic redundancy check (CRC-cyclicredundancy check) hardware. CRC error detection is a powerful technology, sending messages, the sender sends the information according to the calculation of the specific content of a known CRC value, and sent along with the string of information; and the receiver is based on the information received string with the same method to generate a CRC value, if the CRC value and received the same, you can send that information is correct. Although we can not guarantee with 100% CRC error is detected, it can greatly increase the chance of error is found, and it requires very little hardware consumption can be achieved, it is widely used as a CRC check means.

  SHT75 used CRC code (also known as the polynomial code) for theIt can detect the following errors: All the odd dislocation, double fault, burst length of burst error is less than equal to 9, most of the long burst error burst length. After measuring the temperature or humidity, according to the measurement information to generate a CRC value, and then sent to the micro-controller along to. Micro-controller based on the information received by the same method to generate a CRC value, if the CRC value, and received the same, you can send that information correctly; failing that, the sensor re-measurement data and then sends the same way.

  SHT75 the CRC value of the generation algorithm is based on SHT75 generation circuit to simulate the hardware, the hardware generation circuit shown in Figure IV:


Figure IV CRC values generated by hardware circuits

  CRC algorithm is as follows:

  (1) the value of the CRC register is initialized to SHT75 status register (0000 3 2 1 0 ssss), the default value of 00H;

  (2) to compare each of the data and bit7;

  (3) If the data bits and bit7 the same, the CRC value in the right shift register, so bit0 = '0 '; otherwise CRC value of the right shift register, and then bit IV and bit5 RP, again making the bit0 = '1 ';

  (D) to receive new data bit, and then repeat (2);

  (5) SHT75 generated CRC value must be reversed (bit0 = bit7, bit1 = bit6,..., Bit7 = bit0) before and after the final calculation results.

  6. Experiment and results

  After completion of the work of development and debugging, the product of a long period of stability testing, the existing problems was improved. In order to better application of the transmitter in practical projects, also to match the measured Po measuring test center. The results shown in Table 3. ,

  7. Conclusion and outlook

  The integration of temperature and humidity transmitter, compact structure, stable performance, high accuracy, the output signal linearity, easy to debug and calibration, product consistency, and after a measurement unit of measurement certification, and successfully applied to glass production line. Based on the above characteristics, infrared communications technology-based integration of temperature and humidity transmitter has a very wide range of applications.

  In the following work, we must constantly improve, improving the product. In order to collect real-time temperature and humidity values of the points saved in order to facilitate access and draw on historical data or historical temperature and humidity out of real-time value curve, four 6 plans to 93C storage capacity greater FM2 into four C256, the memory capacity to 32Kbyte. In addition, to facilitate the acquisition date and time at temperature and humidity values preserved, the calendar can be extended real-time clock chip, and the FM2 can be hung on the same four-C256 I 2 C bus.