adWirzmF

ESP32-based environmental detector

 
Overview
1. Background
     With the rapid development of industrialization and urbanization, environmental pollution problems have gradually become prominent, including air pollution, water pollution, and soil pollution. These pollution problems not only affect people's production and lives but also cause serious damage to ecosystems and biodiversity. At the same time, environmental pollution can also lead to various health problems, such as respiratory diseases and cancer, posing a threat to people's health. Meanwhile, as environmental pollution problems become increasingly serious, public attention to environmental protection is constantly increasing. People are beginning to recognize the importance of environmental protection and actively participate in environmental protection actions. Governments and enterprises are also beginning to attach importance to environmental protection, taking various measures to reduce pollution emissions and promote sustainable development. Against this background, it is meaningful to use ESP32 to create an environmental monitoring instrument.
2. Design Requirements and Specifications
2.1 Technical Requirements
Temperature and humidity sensor: used to detect temperature and humidity data; Air quality sensor: used to detect gas quality; Screen: used to display the collected data in real time;
2.2 Technical Specifications
Measurement of temperature, humidity, and gas quality; Display of temperature, humidity, and gas quality via a TFT screen; Powered by a mobile power supply;
3. Hardware Design Description
3.1 Hazardous Gas Sensor Design

A hazardous gas sensor is a device used to detect and monitor the concentration of hazardous gases present in the environment. These sensors are widely used in industrial safety, indoor air quality monitoring, and environmental pollution monitoring. Hazardous gas sensors can detect and measure a variety of common harmful gases, including but not limited to carbon monoxide (CO), carbon dioxide (CO2), formaldehyde (HCHO), ammonia (NH3), hydrogen (H2), hydrogen sulfide (H2S), benzene (C6H6), nitrogen oxides (NOx), and ozone (O3). The
working principle of the sensor varies depending on the sensor type and the harmful gas being detected. Common sensor technologies include chemical sensors, electrochemical sensors, infrared sensors, and semiconductor sensors.


 Chemical sensors: Chemical sensors use specific chemical reactions to detect harmful gases. The sensor typically contains a sensitive layer that reacts specifically with the target gas. When the target gas is present, the resistance, capacitance, color, or optical properties of the sensitive layer change. The gas concentration is determined by measuring this change.
Electrochemical sensors: Electrochemical sensors measure gas concentration based on the electrochemical reaction between the gas and electrodes. The sensor typically contains electrodes that interact with the target gas. When the target gas enters the sensor, an electrochemical reaction occurs, generating a specific current or potential change, thereby achieving measurement.
Infrared Sensors: Infrared sensors utilize the specific infrared absorption characteristics of gases to detect gas concentration. The sensor emits infrared radiation into the gas sample, and obtains the concentration information of the target gas by measuring the transmitted or absorbed infrared light.
Semiconductor Sensors: Semiconductor sensors utilize the principle that the electrical properties of semiconductor materials change in the presence of a target gas to detect gas concentration. When the target gas enters the sensor, the resistance or conductivity of the semiconductor material surface changes, thereby measuring the gas concentration.

The accuracy, response time, sensitivity, and stability of hazardous gas sensors are important factors to consider when selecting sensors. Depending on specific application requirements, sensors can be used alone or combined with monitoring systems for timely alarms, data logging, and remote monitoring.
This case uses the AGS10 TVOC sensor, a MEMS TVOC sensor with digital signal output. It is equipped with dedicated digital module acquisition technology and gas sensing technology, ensuring extremely high reliability and excellent long-term stability, while also featuring low power consumption, high sensitivity, fast response, low cost, and simple drive circuitry.
The AGS10 is primarily used for detecting various volatile organic compounds (VOCs), such as ethanol, ammonia, sulfides, benzene vapors, and other harmful gases. It can be applied in air purifiers, home appliances, and fresh air systems. The sensor
 
                                                                                                                          uses the standard IIC communication protocol, making it compatible with various devices. The IIC physical interface includes two interfaces: a serial data signal (SDA) and a serial clock signal (SCL). During design, both interfaces need to be pulled up to VDD through resistors ranging from 1kΩ to 10kΩ. The sensor operates at 3V, while our voltage range is only 5V and 3.3V. A Schottky diode can be connected in series at the sensor's VCC pin. The voltage drop of a typical diode is between 0.6V and 1.7V, while that of a Schottky diode is typically between 0.15V and 0.45V. 3.2 Harmful Gas Sensor Design: The DHT11 digital temperature and humidity sensor is a composite temperature and humidity sensor with a calibrated digital signal output. It utilizes dedicated digital module acquisition technology and temperature and humidity sensing technology to ensure high reliability and excellent long-term stability. The sensor includes a capacitive humidity sensing element and an NTC temperature sensing element. Applications include HVAC, dehumidifiers, agriculture, cold chain storage, testing and inspection equipment, consumer goods, automobiles, automatic control, data loggers, weather stations, home appliances, humidity regulators, medical devices, and other related humidity detection and control. Advantages include low cost, long-term stability, relative humidity and temperature measurement, excellent quality, ultra-fast response, strong anti-interference capability, ultra-long signal transmission distance, digital signal output, and precise calibration. Pin descriptions: VDD: 3.3~5.5V DC power supply ; DATA: Serial data, single bus ; NC: Unused pin; GND: Ground, negative power supply. Product parameters: 1. Relative humidity ; 2. Temperature; 3. Electrical characteristics . Typical circuit: Serial communication description (single-wire bidirectional)  . Single bus description: The DHT11 device uses simplified single-bus communication. A single bus means there is only one data line; data exchange and control in the system are all completed by the single bus. Devices (master or slave) are connected to the data line via an open-drain or tri-state port, allowing the device to release the bus when not transmitting data, thus enabling other devices to use the bus. A single bus typically requires an external pull-up resistor of approximately 4.7kΩ, so that the bus is in a high-level state when idle. Because they are master-slave junctions, the slave can only respond when the master calls it. Therefore, master access to devices must strictly adhere to the single-bus sequence; if the sequence is disordered, the device will not respond to the master. Application circuit diagram 3.3 Noise sensor introduction: Using a microphone to detect sound and thus noise. Advantages: An electret microphone is a sound-to-electrical conversion device that converts sound signals into electrical signals. Its characteristics include small size, light weight, simple structure, wide frequency response, high sensitivity, vibration resistance, and low price, making it widely used in electronic devices such as recorders, wireless microphones, and voice-activated switches. Product parameters and application circuit design: The output voltage of a microphone typically ranges from a few millivolts to several hundred millivolts, depending on factors such as the sound pressure level of the sound source, the pickup distance, and the microphone's sensitivity. Generally, the microphone's output voltage is 5–10 mV. While a single-chip microcomputer may not be able to detect it initially, with the addition of a suitable amplification circuit, it can be detected by the microcontroller. This enables the implementation of a simple noise sensor.
 


                                                                             



 
                                                                   
 

 

 
 
 























 
   

 
   

 
   



 
  







  
 













 
(Performance is relatively poor, but cost-effective)
3.4 TFT Display Introduction,

Physical Object and Parameters,

 

Schematic Diagram,

 


 


Physical Display ,
 
Notes:
This TFT screen is driven by ST7785, so to display correctly, you need to modify the User_Setup.h file in the Arduino IDE library functions.
For specific procedures, please refer to the video by Teacher Eva on Bilibili: https://b23.tv/ueGo1L7 (Other videos are also very helpful!!!).
Attachment:
This link contains relevant Arduino IDE programs, demonstration videos, and image extraction software for your reference (please point out any errors so we can improve together).
 Link: https://pan.baidu.com/s/1HvqgOyhtbPCXE9bxXe7tQg?pwd=1111 Extraction code: 1111
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-26 16:59:35

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号