
Environmental detector based on ESP32
PROEnvironmental detector based on ESP32
License
:GPL 3.0
Description
1. Background
With the rapid development of industrialization and urbanization, environmental pollution problems have gradually become prominent, including air pollution, water pollution, soil pollution, etc. These pollution problems not only affect people's production and life, 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, cancer, etc., which pose a threat to people's health. At the same time, with the increasingly serious problem of environmental pollution, the public's attention to environmental protection is increasing. People are beginning to realize the importance of environmental protection and actively participate in environmental protection actions. Governments and enterprises have also begun to pay attention to environmental protection, taking various measures to reduce pollution emissions and promote sustainable development. In this context, it is meaningful to use ESP32 to make an environmental detector.
2. Design requirements and indicators
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 device in real time.
2.2 Technical Indicators
Measure temperature, humidity and gas quality;
Display temperature, humidity and gas quality through TFT screen;
Use a power bank for power supply.
3. Hardware design description
3.1 Hazardous Gas Sensor Design
- A harmful gas sensor is a device used to detect and monitor the concentration of harmful gases present in the environment. They are widely used in industrial safety, indoor air quality monitoring, environmental pollution monitoring and other fields. Harmful 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), ozone (O3), etc.
- The operating principle of the sensor varies depending on the type of sensor and the harmful gases being detected. Common sensor technologies include chemical, electrochemical, infrared, and semiconductor sensors.
- Chemical sensors: Chemical sensors use specific chemical reactions to detect harmful gases. Sensors usually contain a sensitive layer that reacts specifically with the target gas, and when the target gas is present, the resistance, capacitance, color, or optical properties of the sensitive layer change, and 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 the electrode. Sensors often contain electrodes that interact with the target gas, and when the target gas enters the sensor, an electrochemical reaction is created that produces a specific current or potential change to enable the measurement.
- Infrared sensors: Infrared sensors use gas-specific infrared absorption properties to detect gas concentrations. The sensor emits infrared radiation into the gas sample, and the concentration of the target gas is obtained by measuring the transmitted or absorbed infrared light.
- Semiconductor sensors: Semiconductor sensors use the principle that the electrical properties of semiconductor materials change in the presence of a target gas to detect gas concentrations. When the target gas enters the sensor, the resistance or conductivity of the semiconductor material surface changes, resulting in a measurement of the gas concentration.
The accuracy, response time, sensitivity, and stability of a hazardous gas sensor are important factors to consider when selecting a sensor. Depending on the application, the sensor can be used alone or in combination with a monitoring system for timely alerts, data logging, and remote monitoring.
In this case, a AGS10TVOC sensor is used, and the AGS10 is a MEMS TVOC sensor with a digital signal output. It is equipped with special digital module acquisition technology and gas induction sensing technology to ensure that the product has extremely high reliability and excellent long-term stability, and has the characteristics of low power consumption, high sensitivity, fast response, low cost and simple drive circuit.
AGS10 is mainly suitable for detecting various organic volatile gases, such as ethanol, ammonia, sulfide, benzene vapor and other harmful gases, and can be used in air purifiers, household appliances, fresh fans and other equipment.
Physical display
Sensor characteristics
The sensor adopts the standard IIC communication protocol and can be adapted to a variety of devices. The physical interface of the IIC consists of two interfaces: Serial Data Signal (SDA) and Serial Clock Signal (SCL). When designing, the two interfaces need to be pulled up to VDD through a 1kΩ~10kΩ resistor.
Applied circuit design
The sensor operates at 3V, while ours only has 5V and 3.3V, and we can connect a Schottky diode in series at the VCC pin of the sensor.
The voltage drop of a normal diode is between 0.6V and 1.7V, while the voltage drop 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 temperature and humidity composite sensor with a calibrated digital signal output. It uses dedicated digital module acquisition technology and temperature and humidity sensing technology to ensure high reliability and excellent long-term stability. The sensor consists of a capacitive humidity sensing element and an NTC temperature measuring element.
Physical display
- Scope of application
HVAC, Dehumidifiers, Agriculture, Cold Chain Warehousing, Testing & Inspection Equipment, Consumer Goods, Automotive, Automatic Controls, Data Loggers, Weather Stations, Home Appliances, Humidity Regulators, Medical, Other Related Humidity Detection and Control.
- Merit
Low cost, long-term stability, relative humidity and temperature measurement, excellent quality, ultra-fast response, strong anti-interference ability, long signal transmission distance, digital signal output, accurate calibration.
- Pin Description
- VDD power supply 3.3~5.5V DC
- DATA Serial data, single bus
- NC Empty Foot
- GND is grounded, and the power supply is negative
- Product parameters
1. Relative humidity
2. Temperature
3. Electrical characteristics
- Typical circuits
- Serial Communication Instructions (Single Wire Bidirectional)
Single Bus Description The DHT11 device uses simplified single-bus communication. A single bus means that there is only one data line, and the data exchange and control in the system are completed by a single bus. The device (master or slave) is connected to the data line through an open-drain or tri-state port to allow the device to release the bus when not sending data and let other devices use the bus; A single bus typically requires an external pull-up resistor of about 4.7kΩ so that when the bus is idle, it is high. Since they are master-slave junctions, the slave can only answer when the master calls the slave, so the master access device must strictly follow a single bus sequence, and the device will not respond to the master if there is sequence confusion.
- Apply a circuit diagram
3.3 Introduction to noise sensors
The sound is detected by the microphone, and the noise is detected accordingly.
- Merit
An electret microphone is an acoustic and electrical conversion device that converts sound signals into electrical signals. It is characterized by small size, light weight, simple structure, wide frequency response, high sensitivity, vibration resistance, and low price, so it is widely used in electronic devices such as tape recorders, wireless microphones and voice-activated switches.
- Product parameters
- Application Circuit Design:
The output voltage of a microphone (microphone) is typically between a few millivolts and several hundred millivolts, depending on factors such as the sound pressure of the sound source, the pickup distance, and the sensitivity of the microphone. In general, the voltage output of the microphone is 5~10mV. The microcontroller cannot detect it, and it can be detected by the microcontroller as long as it is matched with the appropriate amplification circuit. Realize a simple noise sensor.
(The performance is relatively poor, but the cost performance is high)
3.4TFT display introduction
- Physical objects and parameters
- Schematic
Physical display
Precautions
This TFT monitor is driven by ST7785, so in order to display it correctly, you need to change the User_Setup.h file in the library function of the Arduino IDE.
For the specific process, you can refer to the video https://b23.tv/ueGo1L7 of Teacher Eva in Bilibili Video (other videos are also very helpful!! )
Attachment upload
This includes the relevant Arduino IDE program, demo video and picture impression software for your reference (if there are mistakes, please correct them and make progress together)
Link: https://pan.baidu.com/s/1HvqgOyhtbPCXE9bxXe7tQg?pwd=1111 Extraction code: 1111
Designed by yutuone (from OSHWHub)
a:https://oshwhub.com/yutuone/ji-yu-esp32-de-huan-jing-jian-ce-qi
Design Drawing


Comment