Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor

Publisher:ziyuntingLatest update time:2023-08-02 Source: elecfansKeywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

Ammunition was mainly stored in warehouses from the time it left the factory until it was used by troops in combat or training. During long-term storage, ammunition is in a macroscopically static state. But its quality keeps changing. This is because ammunition is mainly composed of metal and powder. During long-term storage, due to the influence of temperature and humidity. Metal will rust. This reduces the strength of metal parts. The surface mechanical properties deteriorate, seriously affecting the use of ammunition. It may even cause major accidents. Temperature and humidity will also change the physical and chemical properties of the ammunition charge. As a result, it loses its due combat skill requirements. Therefore, temperature and humidity are the main contradictions that cause changes in the quality of ammunition. According to the warehouse conditions of our army, the climate conditions of our country and the current warehouse management level. Usually the maximum temperature is stipulated not to exceed 30℃. The maximum humidity is not exceeded. 70%. That is commonly known as the "37" line.


The monitoring system of traditional ammunition warehouses uses dry and wet bulb hygrometers, hair hygrometers, hygrometers, or monitoring systems composed of ordinary temperature and humidity sensors. The structure is usually relatively complex. The system is huge. Poor accuracy. The author uses the SHTl5 ultra-small, self-calibrating, multi-functional smart sensor launched by the Swiss company Sensirion. Measuring parameters such as relative humidity, temperature and dew point, it is suitable for the design of intelligent monitoring systems for temperature and humidity in ammunition warehouses.


2 Performance and features of SHTl5

The SHT15 sensor is a single-chip, multi-purpose smart sensor, which not only includes a miniature relative humidity sensor based on humidity-sensitive capacitors and a miniature temperature sensor based on bandgap circuits, but also has a 14-bit A/D converter and a 2-wire string line interface. It can output calibrated serial data of relative humidity and temperature, so the multi-channel switch, A/D converter and signal conditioning circuit required by traditional design are no longer used in the system. The system structure is relatively compact and simple. SHTl5 can be used in the same system. Location measures relative humidity and temperature. Its internal structure is shown in Figure 1.

Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor

SHT15 has relatively few pins. Easy to use. Its pin arrangement is shown in Figure 2. The pin functions are shown in Table 1. The relative humidity measurement range of the SHT15 smart sensor is 0~100%. The resolution reaches 0.03%, the highest accuracy is +2%RH, and the temperature measurement range is -40℃ to 123.8℃. The resolution is 0.1℃. The power supply voltage range is +2.5V to +5.5V. The response time is less than 3s.

Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor

Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor

3 System structure and principle

The design system mainly consists of microcontroller, sensors and actuators. The AT89C51 low-voltage and high-performance CMOS 8-bit microcontroller is used. The chip contains 4Kbytes of repeatedly erasable read-only program memory (PEROM) and 128bytes of random access memory (RAM), which is produced using ATmel's high-density, non-volatile storage technology. Compatible with the standard MCS-51 machine instruction system, there is also a general-purpose 8-bit central processor and Flash storage unit on-chip. The powerful AT89C51 microcomputer provides a cost-effective solution. Its main functional features are as follows:

Compatible with MCS-51 command system;

4K can be repeatedly erased and written f》1000 times) FlashROM;

32 bidirectional I/O ports;

Programmable UARL channel;

2 16-bit programmable timers/counters;

Full static operation 0-24MHz;

1 serial interrupt;

128x8bit internal RAM;

2 external interrupt sources;

A total of 6 interrupt sources;

Can directly drive LED;

Level 3 encryption bit;

Low-power idle and power-down modes;

Software sets sleep and wake functions.

Communication between AT89C51 and SHT15 is carried out through the serial bus. The actuator is mainly composed of a motor-controlled cooling machine, heating machine, dehumidifier, humidifier, etc. The temperature/humidity monitoring system of the ammunition warehouse is shown in Figure 3.

Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor

AT89C51 cycles through multiple SHTl5s in real time to detect temperature and relative humidity values. Then read the data value and display the data value at this time. When the relative humidity exceeds 70%, the microcontroller controls the dehumidifier to start working. If the relative humidity is lower than 40%, the humidifier starts to work; when the temperature exceeds 30°C, the cooling machine starts to work; when the temperature is lower than -12°C, the heating machine starts to work. Each cycle is 3 times and the temperature is printed once. , humidity value report.


4 system programming

The system software is written in MCS-51 assembly language. Adopt modular programming method. It mainly includes modules such as initialization module, data collection, data processing, display, alarm, and printing. The program block diagram of the system is shown in Figure 4.

Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor

Since SHTl5 contains memory, the initialization program is mainly to set initial values ​​for some data in the memory of the microcontroller and SHTl5, and at the same time initialize the initial state of the microcontroller. This system is a multi-channel measurement system. SHTl5 enters the sleep state after 10ms after power-on. Only when the microcontroller sends a measurement command, SHTl5 is "awakened" to work, so. The microcontroller cyclically issues temperature and humidity measurement commands to each sensor to achieve multi-channel temperature and humidity measurement. The command set of SHTl5 is listed in Table 2.

Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor

Since the data output by SHT15 has a non-linear relationship with the measured value, in order to obtain accurate data, the reading value must be compensated for non-linearity. To perform non-linear compensation for humidity, 8-bit data is usually compensated using the following formula:

RH=(1.43N-5.127), 256(0≤IV≤107)(1)

RH=(1.11N-28.93)/256(108≤N≤255)(2)

For temperature sensors, the following formula is usually used for nonlinear compensation:

T=d+d2M(3)

N and M in the formula are the output values ​​of the relative humidity sensor and temperature sensor respectively, d1 and d2 are constants, which are determined according to the power supply voltage and the number of temperature data bits.


Each measured data should be compared with the specified value. If it is within the allowed range, the program will proceed to the next step. If it does not meet the requirements. Then an alarm should be issued and the data value at this moment should be displayed after each cycle ends. There will be a delay of 1 hour (which can be selected flexibly). This is mainly because there are many wooden structures in the ammunition warehouse, and there is a process of volatilization and absorption of moisture, and the measurement is carried out after a certain delay. It can avoid long-term work of the sensor and repeated start and stop of the actuator, save resources, and extend the service life of the system. After every 3 cycles of measurement (can be appropriately selected according to needs), the microcontroller controls the printer to print out the temperature/humidity data measured for the 3 times, which is convenient for reporting and archiving.


5Conclusion

The ammunition warehouse temperature and humidity monitoring system designed by the author is based on the SHTl5 intelligent sensor. SHT15 is a brand-new new sensor based on the intelligent sensor design concept. It realizes the digital output of the temperature and humidity sensor, and is free of debugging and calibration. , no peripheral circuits and other characteristics, which greatly facilitates applications in the field of embedded measurement and control. It is the direction of sensor development in the future. The structure of the system is relatively simple. It has a relatively small size and high accuracy, overcoming the shortcomings of traditional ammunition warehouse temperature/humidity measurement systems.


Keywords:AT89C51 Reference address:Design of intelligent humidity monitoring system using AT89C51 microcontroller and SHT15 sensor

Previous article:Design of remote control of household appliances by telephone based on AT89C51 microcontroller and DTMF communication
Next article:Software and hardware design of remote meter reading system based on AT89C51 and serial Internet interface equipment

Latest Microcontroller Articles
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号