Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

A low-Power portable meteorological instrument is designed. The meteorological detection system is mainly controlled by a low-power MSP430 single-chip microcomputer. It uses temperature sensor, humidity sensor, air pressure sensor, wind speed and wind direction measurement modules to measure temperature, humidity, air pressure, and wind speed. Wind direction measurement;

A low-power portable meteorological instrument is designed. The meteorological detection system is mainly controlled by a low-power MSP430 single-chip microcomputer. It uses temperature sensor, humidity sensor, air pressure sensor, wind speed and wind direction measurement modules to measure temperature, humidity, air pressure, and wind speed. Wind direction measurement; real-time Display of data through clock chip and 12864 liquid crystal; real-time storage and query of data through E2PROM. The weather meter has the characteristics of miniaturization, real-time, low power consumption and portability. The test results show that the weather meter The measurement accuracy can meet the requirements of ordinary meteorological measurement, and the stability is good, which is especially suitable for climate monitoring in small areas.

0 Preface

The measurement of temperature, humidity, air pressure, wind speed, wind direction and other meteorological parameters plays a very important role in daily life, agriculture, fishery, industry, forestry, navigation and other fields. The measurement of meteorological parameters in many areas mostly depends on local weather forecasts, but , The weather forecast has a wide range and cannot be accurate to the climate measurement in a small area. The cost of building a weather station is relatively high, and the cost performance is very low. Therefore, it is very necessary to design a small, portable comprehensive weather measurement instrument. In response to the above problems, this article A low-power portable meteorological instrument is designed. The meteorological detection system can effectively measure the temperature, humidity, pressure, wind speed, wind direction and other meteorological parameters in a small area. The accuracy can meet the requirements of ordinary meteorological measurement, and it also has real-time Display and real-time storage. The backtracking query function has the characteristics of low power consumption, miniaturization, portability, and low cost. It is suitable for meteorological measurement in various small areas and has a certain practical value.

1 System design and working principle

As shown in Figure 1, this meteorological measurement system uses a low-power single-chip MSP430F149 as the core control component, with temperature measurement module, humidity measurement module, air pressure measurement module, wind speed measurement module, wind direction measurement module, clock module, and E2PROM. LCD display It is composed of modules such as independent buttons.

The temperature, humidity, air pressure, wind speed, and wind direction are converted into electrical signals by various sensors, and the measurement data is obtained after processing by the single-chip microcomputer. Each data and the time information obtained by the clock chip are displayed on the liquid crystal together to realize the real-time display of meteorological parameters.

Data storage and query are realized through E2PROM and independent keys-press the storage key to store the current time and data; press the query key to query the previously stored measurement data. At the same time, it also has the function of automatic measurement. When automatic measurement, turn off LCD, the measured data is stored in E2PROM once every hour.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

2 hardware design

2.1 Introduction to MSP430

MSP430 is a series of ultra-low-power microprocessors launched by TI. Its remarkable feature is ultra-low power consumption. There are 5 low-power modes to choose from. The wake-up time is very short, only 6 μs, and at the same time It also has powerful processing power, high integration, and rich embedded modules (12-bit A/D, 16-bit timer, FLASH, etc.), which are mostly used in smart meters, smart home appliances, and battery-powered portable devices. This weather meter uses MSP430 The series of MSP430F149 single-chip microcomputer is the main control chip, which not only meets the design requirements, but also can directly use the internal integrated 12-bit A/D and 16-bit timers to reduce peripheral modules, thereby improving system stability. At the same time, it can also enable the microcontroller to enter Low power consumption mode effectively reduces system power consumption and saves energy.

2.2 Temperature measurement module

Currently commonly used temperature sensors are mainly analog and digital. The analog temperature sensors mainly include PT100, which has high accuracy and stable performance. The working temperature is between -200~650 ℃, but the temperature measurement circuit is composed of PT100. It is very complicated, with high power consumption and cost, and the accuracy requirements for temperature measurement in ordinary meteorological measurement are not very high. Therefore, the digital temperature sensor AD7416 with a relatively simple circuit is selected in this design.

AD7416 is a multifunctional temperature sensor. It uses 10-bit successive approximation A/D converter inside. The typical temperature conversion time is 400 μs, the resolution can reach 0.25 ℃, the measurement range is -40~125 ℃, and the lowest power consumption Up to 1.2 μW, using I2C bus for data transmission, and with over-temperature protection and sampling misplacement mechanism. Choosing this sensor not only meets the accuracy requirements, but also has a simple circuit and can achieve low power consumption. The temperature measurement circuit is shown in Figure 2. As shown, the lower 3 bits A0, A1, and A2 of the serial bus address are all grounded, and the serial address is 48H; its data pin SDA and clock pin SCL are connected with a pull-up resistor and connected to the I/O port of the single-chip microcomputer through I2C The control word is written into the bus to control the temperature measurement.

2.3 Humidity measurement module

Humidity sensors are mainly divided into two categories: capacitive and resistive. At present, the HS1101 capacitive humidity sensor is widely used, which has good stability, high accuracy, and protective cover, antistatic, dustproof, and resistant to chlorine. .Ammonia water, etc., the measurable humidity range is 1%~100% RH, and the accuracy can reach ±2% RH, which meets the requirements of ordinary meteorological measurement. When the relative humidity changes, the relative capacitance of HS1101 changes, and the change of the relative capacitance will cause The change of charging and discharging time, the relative humidity can be calculated only according to the frequency of charging and discharging when measuring.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

The humidity measurement circuit is shown in Figure 3. The relative humidity measurement is realized by a 555 multi-resonant circuit. HS1101 is connected as a capacitance variable between pins 2 and 5 of the TLC555 chip, and pin 7 is used as a short circuit of resistor R5, equivalent capacitance HS1101 is charged to the threshold voltage (about 0.67 V) through R3 and R4, and discharged to the trigger level through R4, and then R4 is short-circuited to ground through 7. The sensor is charged and discharged by different resistors R5 and R4 to form a charge and discharge cycle, forming a square wave .The square wave frequency measured by the single-chip microcomputer is converted into a humidity setting according to the conversion relationship of HS1101.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

2.4 Barometric pressure measurement module

The air pressure sensor uses the integrated pressure sensor MPX4115 with temperature compensation produced by Motorola in the United States. This chip has high reliability, economy and applicability and meets the requirements. Its output is proportional to the applied pressure, and the measurement range is 15~115 kPa. The output voltage range is 0.2~4.8 V. The relationship between MPX4115 output voltage and atmospheric pressure is as follows:

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

Where: VS is the power supply voltage; P is the atmospheric pressure. The output voltage of MPX4115 is sent to the internal A/D of the MSP430 single-chip microcomputer. Since the reference voltage of the internal A/D of the single-chip microcomputer is 2.5 V, which is less than the maximum output voltage of the pressure sensor, it is at the output of MPX4115 After dividing the pressure with resistance and inputting the single-chip microcomputer, according to formula (1), the pressure value is obtained by conversion. The pressure measurement circuit is shown in Figure 4.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

2.5 Wind speed measurement module

The wind speed measurement sensor uses the CS3144 Hall switch integrated circuit, which is a magnetic field sensitive circuit manufactured by the use of semiconductor integrated circuit technology. It consists of a voltage regulator, a Hall voltage generator, a differential amplifier circuit, a Schmitt trigger, and a temperature. The compensation circuit and the open circuit output of the collector, its input is the magnetic field induction intensity, and the output is a digital voltage signal.

In order to measure the wind speed, a three-wind cup wind speed component is selected, and a small magnet is added to the rotating body of the wind cup. The small magnet has a small volume, a small mass, and a strong magnet. Its magnetic field is suitable for being received by the Hall sensor and is convenient Shielding other magnetic fields in the environment can also reduce the impact of the mechanical system on the final induction, thereby making the measurement more accurate. The wind speed measurement circuit is shown in Figure 5. The CS3144 receives the magnetic field strength and outputs the digital signal and then converts it into a pulse by LM393 , And finally transmitted to the I/O port of the single-chip microcomputer, each time the small magnet turns a circle, it will output a pulse to the single-chip microcomputer to receive, use the single-chip microcomputer to count, get the number of turns per second, and then convert it into the current wind speed. The voltage comparator LM393 can also be used to adjust the sensitivity of the Hall element. The potentiometer is adjusted, and the comparison voltage of the reverse input terminal changes accordingly. When the comparison voltage becomes low, the input digital signal will also output pulses. The sensitivity becomes higher, otherwise the sensitivity becomes lower.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

2.6 Wind direction measurement module

In order to achieve better measurement results, the supercharged photoelectric encoder CHA3806 is selected for wind direction measurement. The supercharged photoelectric encoder generally outputs three pulse signals A, B, and Z. The Z signal is mainly used for synchronization or zero adjustment, AB The signal contains information such as the rotation direction and rotation rate of the measured object. Its mechanical structure is relatively simple. The average mechanical life can be more than tens of thousands of hours. It has strong anti-interference ability, high reliability, and 600 resolution. The encoder disc has a measurement range of 0°~360°, which meets the measurement requirements.

A large wind vane is added to the rotating shaft of the photoelectric encoder. When the angle of the wind vane changes, the photoelectric encoder will send out A and B digital pulse signals with a phase difference of 90°. When the angle is forward, A leads B It is 90°, when reverse, B leads A is 90°. The relationship between the number of output digital pulse signals and the angular displacement is proportional. Therefore, the corresponding angular displacement can be calculated by counting the pulse signals. Wind direction The measurement circuit is shown in Figure 6.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

The output A and B pulses of the photoelectric encoder are connected to the I/O port of the single-chip microcomputer, and a certain photoelectric encoder position is fixed to the north. Each time a position is rotated, A sends a pulse to be received by the single-chip microcomputer, and the single-chip microcomputer will judge B at this time The pulse is high or low at this time. If B is high, the photoelectric encoder is rotating forward at this time, and the count is increased by 1; otherwise, the photoelectric encoder is reversed, the count is reduced by 1, and the count is 600 Return to zero. The same angle less than 0 is subtracted from 599, and the final count value is multiplied by 0.6 to calculate the wind direction. In order to see the wind direction intuitively, use 0° as true north according to the wind direction notation. Every 22.5° is a category, which means: north wind, north north east wind, northeast wind, east northeast wind, east wind, east southeast wind, southeast wind, south east wind, south wind, south southwest wind, southwest wind, west southwest wind .Westerly wind

2.7 Man-machine interface module

Keyboard module: 6 independent keys are used, respectively corresponding to observation, query, storage, automatic measurement, up and down 6 functions. Up and down keys are used to view the measured values ​​in different periods in the query function. LCD module: use low Power consumption 12864 LCD, 3.3 V power supply, the working current is about 10 mA when the backlight is turned on, and the working current is less than 1 mA when the backlight is turned off. The current time, temperature, humidity, air pressure, wind speed and wind direction are displayed in real time when observing; when inquiring, the actual recorded measurement Value and measurement time; during automatic measurement, it can be controlled by the single-chip microcomputer to turn off the backlight to reduce power consumption and achieve low power consumption.

2.8 Other hardware modules

System power module: The circuit shares a voltage value of 3.3 V. 5 V. Because it is a portable product, it can be powered by a 5 V lithium battery. After entering the system, the 5 V voltage is passed through the LM1117 3.3 V to obtain a 3.3 V voltage to power the MSP430 microcontroller.

Clock module: The real-time clock adopts the low-power chip DS1302, which can automatically count the seconds, minutes, hours, days, weeks, months, new years and leap years compensation, expand the perpetual calendar function display, low power consumption, 2.5 V power supply, power The power consumption is less than 300 nA, and the accuracy is high, which meets the system requirements.

E2PROM module: Due to the large amount of data stored, the AT24C256 memory with larger storage space and lower cost is selected. This E2PROM has a capacity of 32 KB and is connected to the single-chip microcomputer through the I2C bus to realize data storage and reading.

3 software design

3.1 Software process

The software design of the meteorological instrument includes system initialization, temperature data collection, humidity data collection, air pressure data collection, wind speed data collection, wind direction data collection, clock, liquid crystal display, storage, and buttons, etc. 10 modules, the main process is shown in Figure 7, Figure 8 shown.

After the system is initialized, each sensor starts to collect data. The clock chip starts timing. The microcontroller starts to process the data. The LCD starts to display the data in real time. When different function buttons are triggered, the system enters the button interruption to perform functions such as storing and querying data.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

The data collected by the sensor is interfered by external factors, and it is possible to collect data with large errors. In order to ensure the accuracy of the measurement, the average value of every 10 collected data is taken as the final measurement data. Display. Save to reduce measurement error.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

3.2 Low-power design

The biggest advantage of MSP430 microcontroller lies in its low power consumption characteristics. The system program is designed according to low power consumption. In addition to the necessary equipment initialization, the rest of the program (keyboard trigger, timer, A/D conversion) is completed in interrupt. Most of the time in LPM1 low power consumption mode, only when the interrupt is triggered, it will be awakened. This design greatly reduces the system power consumption. In order to further reduce power consumption, when the measurement data is not observed, the system can enter automatic In the measurement mode, the single-chip microcomputer controls the liquid crystal and turns off its backlight to reduce power consumption.

4 Comparison and analysis of experimental results

After software and hardware debugging, the system successfully realized temperature, humidity, air pressure, wind speed, wind direction measurement, display, storage, and query functions. In order to test the accuracy of the meteorological instrument measurement, the system was set on January 21, 2013. The data read outside Nanjing at 18:45 and 14:45 on January 22, 2013 were compared with the actual weather conditions in Nanjing released at the same time by the Central Meteorological Observatory. The test results are shown in Table 1.

Design of Portable Meteorological Instrument Based on MSP430 Single Chip Computer

From the comparison results, it can be seen that the temperature, humidity, and air pressure issued by the Central Meteorological Observatory are basically the same, the wind direction is exactly the same, and the wind speed difference is slightly larger. Due to the wide range of weather forecasts, this meteorological instrument measures a small area. It’s normal for the measured value to have a small difference in the climate, and it can also indicate that the measured value of this design is more accurate in a small area.

The difference in wind speed in the comparison is slightly larger. One is due to the difference between the measurement range of the meteorological instrument and the weather forecast measurement range. The other is due to the low wind speed, the small magnetic steel has fewer turns, and the friction between the wind cup and the pillar. Factors such as low speed resolution, if the wind speed is larger, the measurement is more accurate. In short, the experimental comparison shows that the accuracy of the meteorological instrument designed in this paper meets the requirements of ordinary meteorological measurement, has good stability, and is suitable for climate measurement in a small area.

5 Conclusion

In view of the fact that the weather forecast range is too wide to be accurate to a small area; the cost of the weather station is too high; the current situation of the lack of portable weather instruments, a portable weather instrument based on the MSP430 low-power single-chip microcomputer is designed. The weather instrument integrates a variety of weather sensors. Systematic measurement of temperature, humidity, air pressure, wind speed, wind direction and other meteorological parameters. The accuracy meets the measurement requirements of common meteorological parameters. It has the functions of data storage and retrospective query. At the same time, the power consumption is very low, and it can be battery-powered. Normal 5 V lithium The battery can work continuously for about 2 days, is convenient to carry, can be adapted to the weather forecast of various small area environments, and has strong practicability.

The Links:   CXA-0256 CM1200HA-24J