Design of portable weather instrument based on MSP430 microcontroller

Publisher:AningmengLatest update time:2013-10-24 Source: 电子设计工程 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
    The measurement of meteorological parameters such as temperature, humidity, air pressure, wind speed, wind direction, etc. 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 relies on local weather forecasts. However, the weather forecast covers a wide geographical range and cannot accurately measure the climate in a small area. The cost of building a meteorological station is high and the cost performance is very low. Therefore, it is very necessary to design a miniaturized, portable comprehensive meteorological measuring instrument. In response to the above problems, this paper designs a low-power portable meteorological instrument. The meteorological detection system can effectively measure the temperature, humidity, air pressure, wind speed, wind direction and other meteorological parameters in a small area. The accuracy can meet the requirements of ordinary meteorological measurement. It also has the functions of real-time display, real-time storage, and backtracking query. It has the characteristics of low power consumption, miniaturization, portability, and low cost. It is suitable for meteorological measurement in various small areas and has certain practical value.

1 System design and working principle
    As shown in Figure 1, this meteorological measurement system uses the low-power single-chip microcomputer MSP430F149 as the core control component, and is composed of temperature measurement module, humidity measurement module, air pressure measurement module, wind speed measurement module, wind direction measurement module, clock module, as well as E2PROM, LCD display and independent buttons.

a.JPG


    利用各个传感器将温度、湿度、气压、风速、风向转化为电信号,通过单片机处理后得到测量数据,各个数据和时钟芯片得到的时间信息一并在液晶上显示,实现气象参数的实时显示。
    通过E2PROM和独立按键实现数据的存储和查询——按下存储键,储存当前的时间和数据;按下查询键,查询以前存储的测量数据。同时,还具有自动测量的功能,自动测量时,关闭液晶,测得数据每小时存入E2PROM一次。

2 硬件设计
2.1 MSP430简介
    MSP430是TI公司推出的一系列超低功耗微处理器。它的显著特性是具有超低功耗,有5个低功耗模式可供选择,唤醒时间很短,只需6μs,同时还拥有强大的处理力,集成度高,嵌入模块丰富(12位A/D、16位定时器、FLASH等),多用于智能仪表、智能家电、电池供电等便携式设备中。本气象仪采用MSP430系列的MSP430F149单片机为主控芯片,不仅满足了设计的要求,可以直接运用内部集成的12位A/D和16位定时器,减少外围模块,从而提高了系统稳定性。同时还可使单片机进入低功耗模式,有效地减少系统功耗,节约电能。
2.2 温度测量模块
    目前常用的温度传感器主要有模拟式和数字式两种。模拟式的温度传感器主要有PT100,它精度高,性能稳定,工作温度在-200~650℃之间,但是由PT100构成的温度测量电路十分复杂,功耗和成本较大,而且普通气象测量对于温度测量的精度要求并不是十分高,所以,本设计选用电路较为简单的数字式温度传感器AD7416。

b.JPG


    AD7416 is a multifunctional temperature sensor, which uses a 10-bit successive approximation analog/digital converter. The typical temperature conversion time is 400μs, the resolution can reach 0.25℃, the measurement range is -40~125℃, the minimum power consumption can reach 1.2μW, and the I2C bus is used for data transmission. It also has over-temperature protection and sampling error mechanism. The selection of 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. The lower 3 bits A0, A1, and A2 of the serial bus address are all grounded, and its serial address is 48H; its data pin SDA and clock pin SCL are connected to the microcontroller I/O port with external pull-up resistors, and the control word is written through the I2C bus to control it to measure temperature.
2.3 Humidity measurement module
    Humidity sensors are mainly divided into two categories: capacitive and resistive. The most widely used one is the HS1101 capacitive humidity sensor, which has good stability, high accuracy, external protective cover, anti-static, dust-proof, and can resist chlorine, ammonia, etc. The measurable humidity range is 1% to 100% RH, and the accuracy can reach ±2% RH, which meets the requirements of ordinary meteorological measurements. When the relative humidity changes, the relative capacitance of HS1101 changes. The change in the relative capacitance will cause the change in the charge and discharge time. When measuring, the relative humidity can be calculated only based on the charge and discharge frequency.

c.JPG


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

2.4 Barometric pressure measurement module
    The barometric pressure sensor uses the integrated pressure sensor MPX4115 with temperature compensation capability produced by Motorola, USA. This chip has high reliability, and meets the requirements of economy and applicability. Its output is proportional to the external pressure. The measurement range is 15-115 kPa, and the output voltage range is 0.2-4.8 V. The relationship between the output voltage of MPX4115 and the atmospheric pressure is as follows:
    Vo≈Vs(P×0.009-0.095) (1)
    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 MSP430 microcontroller. Since the reference voltage of the internal A/D of the microcontroller is 2.5 V, which is less than the maximum output voltage of the pressure sensor, a resistor is used to divide the voltage at the output end of MPX4115. After inputting into the microcontroller, the barometric pressure value is converted according to formula (1). The barometric pressure measurement circuit is shown in Figure 4.

d.JPG


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 using semiconductor integrated circuit technology. It consists of a voltage regulator, a Hall voltage generator, a differential amplifier circuit, a Schmitt trigger, a temperature compensation circuit and an open collector output. Its input is the magnetic field induction intensity and its output is a digital voltage signal.

e.JPG


    In order to measure the wind speed, a three-cup wind speed assembly is selected. A small magnet is added to the rotating body of the wind cup. The small magnet is small in size, small in mass, and strong in magnet. Its magnetic field is suitable for being received by the Hall sensor, and it is convenient to shield other magnetic fields in the environment. It can also reduce the influence of the mechanical system on the final induction, so as to make the measurement more accurate. The wind speed measurement circuit is shown in Figure 5. The CS3144 receives the magnetic field strength and outputs a digital signal, which is then converted into a pulse by the LM393 and finally transmitted to the I/O port of the single-chip microcomputer. Every time the small magnet rotates a circle, it will output a pulse to the single-chip microcomputer for reception. The single-chip microcomputer counts the number of circles per second and converts it into the current wind speed. The voltage comparator LM393 can also be used to adjust the sensitivity of the Hall element. By adjusting the potentiometer, the comparison voltage at the reverse input terminal changes accordingly. When the comparison voltage becomes low, the input digital signal is very small and a pulse will be output, and the corresponding sensitivity becomes higher, otherwise the sensitivity becomes lower.
2.6 Wind direction measurement module
    In order to achieve better measurement results, the boost photoelectric encoder CHA3806 is selected for wind direction measurement. The boost photoelectric encoder generally outputs three pulse signals of A, B, and Z. The Z signal is mainly used for synchronization or zeroing. The A and B signals contain information such as the rotation direction and rotation rate of the object being measured. Its mechanical structure is relatively simple, and the average mechanical life can be more than tens of thousands of hours. It has strong anti-interference ability and high reliability. It has a 600-resolution encoder disk and a measurement range of 0° to 360°, which meets the measurement requirements. A
    large wind vane is added to the rotating shaft of the photoelectric encoder. When the wind vane angle changes, the photoelectric encoder will send out two digital pulse signals A and B with a phase difference of 90°. When the angle is forward, A leads B by 90°, and when it is reversed, B leads A by 90°. The number of output digital pulse signals is proportional to the angular displacement. Therefore, the corresponding angular displacement can be calculated by counting the pulse signals. The wind direction measurement circuit is shown in Figure 6.

e.JPG


    The output A and B pulses of the photoelectric encoder are connected to the I/O port of the microcontroller. A fixed photoelectric encoder position is selected to face north. Every time it rotates to a position, A sends a pulse to be received by the microcontroller. At this time, the microcontroller will determine whether the B pulse is high or low. If B is high, the photoelectric encoder is 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 equal to 600. It returns to zero. The same angle less than 0 is subtracted from 599, and the final count value is multiplied by 0.6, so that the wind direction is calculated. In order to intuitively see the wind direction, according to the wind direction representation method, 0° is due north, and every 22.5° is a category, which respectively represents north wind, north northeast 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, west wind, west northwest wind, northwest wind, north northwest wind, and the wind type and deflection angle are displayed together on the LCD display.
2.7 Human-machine interface module
    Keyboard module: 6 independent buttons are used, corresponding to the 6 functions of observation, query, storage, automatic measurement, up and down. The up and down keys are used to view the measurement values ​​of different periods in the query function. LCD display module: low-power 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. When observing, the current time, temperature, humidity, air pressure, wind speed and wind direction are displayed in real time; when querying, the actual recorded measurement value and measurement time; when measuring automatically, it can be controlled by the single-chip microcomputer to turn off the backlight, reduce power consumption, and achieve low power consumption.
2.8 Other hardware modules
    System power module: 3.3 V and 5 V voltage values ​​are used in the circuit. Since it is a portable product, it can be powered by a 5 V lithium battery. After entering the system, the 5 V voltage is obtained through the LM1117 3.3 V to power the MSP430 microcontroller.
    Clock module: The real-time clock uses a low-power chip DS1302, which can automatically count seconds, minutes, hours, days, weeks, months, years and leap year compensation, and expand the perpetual calendar function display. It has low power consumption. When powered by 2.5 V, the power consumption is less than 300 nA, and the accuracy is high, meeting the system requirements.
    E2PROM module: Due to the large amount of stored data, the AT24C256 memory with large storage space and low cost is selected. This E2PROM has a capacity of 32 KB and is connected to the microcontroller through the I2C bus to realize data storage and reading.

[page]

3 Software Design
3.1 Software Process
    The software design of the meteorological instrument includes 10 modules, including system initialization, temperature data acquisition, humidity data acquisition, air pressure data acquisition, wind speed data acquisition, wind direction data acquisition, clock, LCD display, storage, and buttons. The main process is shown in Figures 7 and 8.

g.JPG

h.JPG


    After the system is initialized, each sensor starts to collect data, the clock chip starts timing, the microcontroller starts processing data, and the LCD starts to display data in real time. When different function buttons are triggered, the system enters the key interrupt and executes functions such as storage and data query.
    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, and the average value is used as the final measurement data for display and storage to reduce the measurement error.
3.2 Low power design
    The biggest advantage of the MSP430 microcontroller is its low power consumption characteristics. The system program is designed in a low power consumption mode. In addition to the necessary device initialization, the rest of the program (keyboard trigger, timer, A/D conversion) is completed in the interrupt. The microcontroller is in the LPM1 low power mode most of the time, and it is only awakened when the interrupt is triggered. This design scheme greatly reduces the system power consumption. In order to further reduce power consumption, when the measurement data is not observed, the system can enter the automatic measurement mode, and the microcontroller controls the LCD to turn off its backlight to reduce power consumption.

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

i.JPG


    From the comparison results, it can be seen that the temperature, humidity and air pressure of the meteorological instrument designed in this paper are basically consistent with those released by the Central Meteorological Observatory, the wind direction is exactly the same, and the wind speed is slightly different. Since the weather forecast range is very wide, and this meteorological instrument measures the climate in a small area, it is normal for the measured values ​​to have slight differences, which can also explain that in a small area, the measured value of this design is more accurate. The slightly larger difference in wind speed in the comparison is caused by the difference between the measurement range of this meteorological instrument and the measurement range of the weather forecast, and the low wind speed, the small number of turns of the small magnetic steel, the friction between the wind cup and the pillar, and other factors cause low speed resolution. If the wind speed is larger, the measurement will be 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 current situation that the weather forecast range is too wide and cannot be accurate to a small area; the cost of the meteorological station is too high; and there is a shortage of portable meteorological instruments, a portable meteorological instrument based on the MSP430 low-power microcontroller is designed. The meteorological instrument integrates a variety of meteorological sensors, which can systematically measure meteorological parameters such as temperature, humidity, air pressure, wind speed, wind direction, etc. The accuracy reaches the measurement requirements of ordinary meteorological parameters, and has the functions of data storage and backtracking query. At the same time, the power consumption is very low, and it can be powered by batteries. Ordinary 5 V lithium batteries can work continuously for about 2 days. It is easy to carry and can be adapted to climate forecasts in various small regional environments, and has strong practicality.

Reference address:Design of portable weather instrument based on MSP430 microcontroller

Previous article:Software-based and networked Linux-based radar terminal system
Next article:Antenna Pattern Automatic Test System Based on MSP430 Single Chip Microcomputer

Recommended ReadingLatest update time:2024-11-16 19:43

Ministry of Industry and Information Technology: 11 major bottleneck technologies that China’s smart sensors most urgently need to break through (key directions)
China attaches great importance to the development of the smart sensor industry. The Ministry of Industry and Information Technology has compiled the "Three-Year Action Guide for the Smart Sensor Industry (2017-2019)" to deeply adjust the strategic opportunity period in order to grasp the new generation of information
[Automotive Electronics]
Ministry of Industry and Information Technology: 11 major bottleneck technologies that China’s smart sensors most urgently need to break through (key directions)
How to protect car transmission using temperature sensor?
As automakers continue to seek to provide consumers with greater convenience, comfort, performance and fuel efficiency, the automotive industry is rapidly introducing new technologies. The most obvious technological innovations are often reflected in the car cabin and in-vehicle infotainment systems, but the car power
[Automotive Electronics]
How to protect car transmission using temperature sensor?
Design of Capacitive Pressure Sensor Measurement Circuit Using CAV424
As differential silicon capacitance sensors are widely used in various industries, the detection of differential capacitance signals is crucial. This paper proposes a capacitance pressure sensor measurement circuit based on the CAV424 capacitance detection chip as a pre-detection unit. The circuit has good stability
[Industrial Control]
Design of Capacitive Pressure Sensor Measurement Circuit Using CAV424
Design of composite wireless sensor nodes for dangerous goods warehouse
   Introduction   With the development of petroleum, chemical and energy industries, the circulation and storage of flammable and explosive dangerous goods used as raw materials, energy and consumer goods are increasing. Its safety is not only related to the safety of people's lives, but also involves social stabilit
[Microcontroller]
Design of composite wireless sensor nodes for dangerous goods warehouse
Temperature sensor driver based on ARM-LINUX (DS18B20)
The DS18B20 digital temperature sensor is easy to wire and can be used in a variety of occasions after packaging, such as pipeline type, threaded type, magnet adsorption type, stainless steel package type, and various models, including LTM8877, LTM8874, etc. Its appearance is mainly changed according to different appl
[Microcontroller]
Temperature sensor driver based on ARM-LINUX (DS18B20)
SENSOR CHINA: Demonstrating the core strength of sensors and connecting the smart future
At the beginning of 2020, the country proposed to accelerate the construction of new infrastructure as a long-term strategic task of the country. Sensors, as the foundation and key link of new infrastructure, will also usher in huge development space. New infrastructure provides a broad application environment for sen
[sensor]
SENSOR CHINA: Demonstrating the core strength of sensors and connecting the smart future
Application of infrared sensor in speed measurement
Infrared technology has been widely used in speed measurement systems. Many products have used infrared technology to achieve vehicle speed measurement, detection and other research. When infrared is used in the field of speed measurement, the most difficult thing to overcome is the interference of various infrared
[Industrial Control]
Application of infrared sensor in speed measurement
Milestone! SmartSens CMOS image sensor chip shipments exceed 100 million units in a single month!
November 14, 2024, Shanghai, China — SmartSens (Shanghai) Electronic Technology Co., Ltd. (stock abbreviation: SmartSens) announced that in the third quarter of 2024, it achieved monthly shipments of CIS chips exceeding 100 million for the first time! This milestone not only marks a breakthrough in the overa
[sensor]
Milestone! SmartSens CMOS image sensor chip shipments exceed 100 million units in a single month!
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号