introduction
Intelligent sensors, which are composed of sensor technology, communication technology and computer technology, have attracted people's attention in process control and signal monitoring due to their high accuracy, good reliability and diverse functions, and have become a hot topic of research at home and abroad. This paper designs a wireless sensor system for real-time monitoring of environmental information. In practical applications, it can accurately measure and reliably transmit environmental parameters, reflecting the advantages of digitalization, intelligence and wirelessness of sensor systems.
The system is based on the MSP430F149 ultra-low power microcontroller and is equipped with a new type of micro low-power sensor. It can measure and process the temperature, humidity, light intensity, harmful gas concentration and other parameters of the measured environment in real time. It is battery-powered and wirelessly transmitted, avoiding the cumbersome wiring and having good portability.
System hardware design
The entire sensor system includes a microprocessor module (16-bit single-chip microcomputer MSP430F149, calendar clock chip, reset circuit and peripheral circuit), a sensor measurement module (temperature and humidity sensor, light intensity sensor, semiconductor combustible gas sensitive element MQ306A), a memory module (Flash memory SST25VF020), a data communication module (serial communication, wireless communication), and a power supply module (LT1962EMS83.3, LT1761ES5-5, LTC3459ES6). The system block diagram is shown in Figure 1.
Microprocessor Module
MSP430F149 is an ultra-low power microcontroller produced by TI. It can operate under the conditions of 1.8 V ~ 3.6 V voltage and 1 MHz clock. It has 5 power saving modes and the current consumption is 0.1μA ~ 400μA. It can fully save power during data detection and meet the energy-saving requirements under battery power supply. It has powerful processing capabilities (RISC structure, 8MHz crystal, drive instruction cycle 125ns) and rich on-chip peripherals (60KB+256B Flash, 2KB RAM, 12-bit A/D conversion, 2 serial ports/
SPI interfaces, 48 I/O ports, etc.).
PCF8563 is an industrial-grade, low-power, multi-function clock/calendar chip with an I2C bus interface launched by Philips. The various alarm functions, timer functions, clock output functions, and interrupt output functions of PCF8563 can complete various complex timing services, and even provide a watchdog function for the microcontroller. The device's internal clock circuit, oscillation circuit, low voltage detection circuit (1.0 V) and two-wire I2C bus communication method not only make the peripheral circuit more concise, but also increase the reliability of the chip. Moreover, after each read and write of data, the embedded word address register automatically generates an increment. Its connection circuit is shown in Figure 2.
Sensor measurement module
Light intensity sensor
The system uses TI's TSL230B to measure the light intensity of the surrounding environment. The device adopts advanced LinCMOSTM technology and is mainly composed of polysilicon photodiodes and monolithic CMOS current-frequency integrated converters. High-resolution illuminance/frequency conversion can be completed without external components. Light of a certain spectrum can be converted into current, and then converted into the corresponding pulse frequency by the current/frequency converter. The frequency of the output square wave or triangle wave is completely determined by the illumination amplitude, with high resolution, and can be directly connected to the microprocessor, as shown in Figure 3. S0 and S1 are sensitivity control terminals, which actually adjust the sensitivity by changing the photosensitive area above the device; S2 and S3 are full-scale selection terminals; OUT is the frequency signal output terminal, which enters the capture input of the microcontroller. By calculating the difference in the counter value between two capture times, the output frequency value can be calculated. According to the frequency-energy relationship curve shown in Figure 4, the light intensity (unit: μW/cm2) can be obtained.
Temperature and humidity sensor
The temperature and humidity are measured using the SHT11 intelligent humidity/temperature sensor developed by the Swiss company Sensirion. It uses the patented CMOSens technology (the integration of CMOS and sensor technology) and has an external size of only 7.5 mm × 5 mm × 2.5 mm. SHT11 has an I2C bus interface, a simple interface circuit, and features digital output, no debugging, no calibration, and good consistency.
The SHT11 mainly includes relative humidity sensor, temperature sensor, amplifier, A/D converter, calibration memory (E2PROM), random access memory (RAM), status register, cyclic redundancy check code (CRC) register, two-wire serial interface, control unit, heater and low voltage detection circuit; it can output full calibrated relative humidity and temperature values; it has dew point value calculation output function; the humidity value output resolution is 14 bits, the temperature value output resolution is 12 bits, and it can be programmed to 12 bits and 8 bits; it has data transmission verification function. This sensor has the advantages of excellent quality, ultra-fast response, strong anti-interference ability, and high cost performance. Its working principle is shown in Figure 5. [page]
Gas Sensor
The system uses the semiconductor combustible gas sensing element MQ306A. This sensor is a tin dioxide semiconductor gas sensing element with the characteristics of high sensitivity, high stability, long life, simple driving circuit, and large electrical signal output. It is suitable for the detection of combustible gas leaks in homes, factories, and commercial places. The sensor obtains the change of element resistance through the change of voltage on a fixed or adjustable external load resistor. The measurement circuit passes the output signal of the sensor through a low-pass Butterworth filter and a low-power operational amplifier LMV324 to achieve impedance matching, and enters the 12-bit A/D conversion of the single-chip microcomputer MSP430F149 to obtain the resistance change value. Then, the relationship between the device resistance and the gas concentration is reflected according to the sensitivity characteristic curve of MQ306A.
Memory Module
The memory module uses SST25VF020 from SST, which is based on high-performance SuperFlash technology, uses standard 8-pin SOIC package and ultra-thin WSON package, uses fewer pins, and can reduce circuit board space, energy consumption and cost compared with non-volatile memory solutions such as E
EPROM. It provides the latest automatic address increment (AAI) data write mode, which can reduce the data write time of the entire flash memory by 50% compared with the single-byte data write mode. The size of SST25VF020 is 2Mbit, with low power consumption, flexible and fast erasure, and write protection.
Data communication module
The wireless communication module uses the nRF401 wireless transceiver developed by Nordic Company of Norway. The nRF401 can work in the 433.92MHz/434.33MHz ISM frequency band. It uses
FSK modulation and demodulation technology, has strong anti-interference ability, and uses PLL frequency synthesis technology, has good frequency stability, and the transmission power can reach 10dB, the receiving sensitivity can reach -105dB, the data transmission rate can reach 20kb/s, and the working voltage range is +3V~5V. The peripheral circuit of the nRF401 wireless transceiver is simple, and it can be directly connected to the serial port of the microcontroller. The working frequency is locked at 434.33MHz in the design.
The ANT1 and ANT2 pins of nRF401 are the input of the low noise receiving amplifier LNA when receiving and the output of the transmitting power amplifier (PA) when sending. The antenna can be connected to nRF401 in a differential manner, and a 50 Ω single-ended antenna can also be connected to nRF401 through a differential conversion matching network. The actual application distance can reach about 300 m.
This system uses RS232 serial port to realize serial communication between PC and sensor system, and uses MAX3232 for driving.
Power Module
The system is powered by three AA batteries and uses LT1962, LT1761, and LTC3459ES6 power devices to provide appropriate operating voltage for the microcontroller, sensors, etc.
System software design
Design of single chip microcomputer control software
The measurement and control program is developed using the development environment IAR Embedded Workbench for the MSP430 series microcontroller, which supports both assembly language and C language. This system uses C language to develop the measurement and control program, and uses the JTAG interface of the MSP430 series microcontroller. The program can be easily debugged and the code downloaded through the FET simulator provided by TI. All programs are modularly designed, and the main process is shown in Figure 6.
Host computer software design
The host computer control software is programmed using VC++6.0 and Access2002. It is mainly divided into data processing module and database module according to its functions, as shown in Figure 7.
[page]
The data processing module mainly completes the functions of screen display of data and printing and output of reports. The database module mainly realizes the functions of querying, counting, deleting and printing data records. The database provides a variety of constraints for fast query, such as query by time period, query by sensor type, query by measurement and control machine, etc. The statistical data can be displayed in the form of tables, dynamic curves, histograms, etc.
Conclusion
This system realizes the real-time wireless monitoring of the data collected by the sensor system when the computer cannot or is difficult to control the controlled object by the wired system (especially the operation site in a harsh environment). The system has low power consumption and can collect and process data in various environments.
References:
[1]. MSP430F149 datasheet http://www.dzsc.com/datasheet/MSP430F149_4.html.
[2]. RISC datasheet http://www.dzsc.com/datasheet/RISC+_1189725.html.
[3]. PCF8563 datasheet http://www.dzsc.com/datasheet/PCF8563+_318649.html.
[4]. TSL230B datasheet http://www.dzsc.com/datasheet/TSL230B+_662876.html.
[5]. SHT11 datasheet http://www.dzsc.com/datasheet/SHT11+_607252.html.
[6]. LMV324 datasheet http://www.dzsc.com/datasheet/LMV324+_452921.html.
[7]. SOIC datasheet http://www.dzsc.com/datasheet/SOIC+_1182477.html.
[8]. SST25VF020 datasheet http://www.dzsc.com/datasheet/SST25VF020+_1118311.html.
[9]. nRF401 datasheet http: //www.dzsc.com/datasheet/nRF401+_521026.html.
[10]. RS232 datasheet http://www.dzsc.com/datasheet/RS232+_585128.html.
[11]. PC datasheet http:// www.dzsc.com/datasheet/PC+_2043275.html.
[12]. MAX3232 datasheet http://www.dzsc.com/datasheet/MAX3232+_1107769.html.
[13]. LT1962 datasheet http://www.dzsc.com/datasheet/LT1962_1065087.html.
[14]. LT1761 datasheet http://www.dzsc.com/datasheet/LT1761_1062032.html.
[15]. LTC3459ES6 datasheet http://www. dzsc.com/datasheet/LTC3459ES6+_1002982.html.
[16]. MSP430 datasheet http://www.dzsc.com/datasheet/MSP430+_6.html.