GMzBrhZAO

Intelligent Environmental Monitoring System

 
Overview
Project Overview:
1. The project uses a BME280 sensor to monitor outdoor air temperature, humidity, and atmospheric pressure; a DC01 infrared PM2.5 sensor to monitor air quality; and an optical rain gauge and illuminance sensor and a three-cup anemometer and wind speed sensor to monitor rainfall, illuminance, wind direction, and wind speed.
2. The system connects to OneNet via an ESP8266 to upload sensor data to a cloud platform. A simple app allows users to view the data on their phones and computers.
3. Data is transferred to a host computer interface via a LAN port.
4. A 0.96-inch OLED display directly shows the collected data for easy viewing and debugging.
5. The system charges via a TYPE-C port and monitors the main power supply. In case of power failure, the backup power supply automatically connects, and an audible and visual alarm and a network alarm are triggered.
6. Two versions of the schematic exist; this document uses V1. The V2 software will be provided later. The differences are as follows:
Hardware Introduction :
This project consists of a power management module, an ESP8266 WiFi module, an OLED display module, a SkyStar development board, sensor interface circuits, and an ENC28J60 Ethernet circuit. For outdoor use, the control circuit is housed in a waterproof box, thus a photoresistor is added for cover opening detection.
The main controller periodically reads various sensor parameters and sends data to the OneNet platform once per minute. When the cover is opened, it is assumed that personnel are performing maintenance, the transmission frequency is changed to once per second, and the display screen is turned on. When the cover is closed, the display screen is turned off, and the transmission frequency is reduced to once per minute to reduce power consumption. When a network cable is detected, weather data is sent to the computer through the network port. When the network cable is unplugged, data transmission to the network port stops.
1. Power Supply Circuit
This project is mainly powered by a DC 5V interface. The TYPE-C interface on the development board can also be used as a power supply interface, and a 12V lithium battery is provided as a backup power source. When external power is lost, the battery automatically discharges, the warning light flashes, the buzzer sounds, and the power failure information is sent to the cloud platform.
In the diagram, VIN is the 5V power input from the TYPE-C interface on the core board, which powers the system and charges the 3S lithium battery. The indicator light LED1 will light up during charging and turn off when fully charged. U7 is the battery connector, and the battery voltage is 12V. Note that the TYPE-C interface and DC interface should not be powered simultaneously.
2. External power supply monitoring circuit:
When there is an external power supply, VIN is high, and the PWGD pin reads a low level.
When the external power supply is disconnected, VIN is low, and the PWGD pin reads a high level. This enables power-down detection.
Due to the influence of the body diode of the LDO's internal power MOS, if there is power after the LDO when VIN is disconnected, it will flow back to the input terminal through the body diode, causing VIN to fail to go low, and PWGD will remain low, making power-down detection impossible.
In this example, the 3.3V on the core board will flow back to VIN through 1117. When there is no external power input, there is still about 2.5V on VIN. Therefore, I removed 1117 from the core board to allow all 5V inputs to go to the baseboard before stepping down.
3. Step-down circuit:
The 12V battery is reduced to 5V to power the PM2.5 module, and then the 5V is converted to 3.3V to power the system.
4. Level Conversion:
The PM2.5 module uses a 5V serial port and requires level conversion.
5. ENC28J60 Ethernet Interface:
Due to the small data volume in this project, SPI control of the ENC28J60 is used to achieve 10M Ethernet data transmission. The Ethernet is a maintenance interface and uses a fixed IP address. The connected computer needs to have its host IP address set to 192.168.1.x to ensure it's on the same network segment as the slave device.
Important Note:

The LDO on the core board needs to be removed; otherwise, power-down detection cannot be achieved.
Because the Ethernet chip's reset pin is connected to PA0, which is the user button on the core board, I removed R25 on the core board to disconnect the user button. This can be replaced with another GPIO later to retain the user button.
Due to the large number of sensors with voltages of 3.3V/5V/12V, wiring must be done carefully.
When using an external 5V power supply, always ensure there is a battery present; otherwise, the charging chip may be damaged.
The ENC28J60 is power-intensive and gets very hot, causing the XC6220 to also get hot. A DC-DC step-down converter can be used to provide more current.
When installing the wind direction sensor, ensure the arrow on its base points due north; otherwise, the wind direction will be inaccurate. OneNet has updated

its software
. Access now only requires the product ID (PRODUCT_ID), authentication information (AUTH_INFO), and device name (DEVICE_NAME).
The product ID and device name can be viewed on the cloud platform, while the authentication information is calculated using OneNet's token generation tool.
In the image, `res` is a fixed format; you only need to modify your product ID and device name. `et` is the device expiration time; change it to a timestamp greater than the current time. `key` is the device key from the device details; leave the rest as default. Click "Generate" to generate the authentication information. Then, replace the corresponding values ​​in the code.
The WiFi password and account in the image below are from my mobile hotspot; you can replace them with your own account or modify them to match the account shown in the image.
See the attachment for the specific code.
PC network configuration
and computer communication via Ethernet port require setting an IP address. The method is as follows:
1. Connect the device to the computer. An Ethernet device will appear in the computer's Control Panel > Network Connections.
2. Right-click and view properties, find IPv4, and click Properties
. 3. Change "Obtain an IP address automatically" to "Use a static IP address," and enter the IP address as shown in the image
. 4. Open the control panel and type "ipconfig" to see that the device has been successfully configured.
Assembly
Flowchart 1: Drill two holes in the waterproof box, one for power and one for the sensor, and install the control board into the box.
Figure 2: Install the wind speed, wind direction, rainfall, and louvered box onto a frame. I made a wooden frame for demonstration; you can also buy an iron frame. Drill a hole in the top of the louvered box and attach the light sensor to the top, ensuring a tight seal and waterproofing. Drill a hole in the bottom and run the 485 sensor wires into the louvered box, then connect it to the waterproof box via a bus. Figure 3: Function verification diagram
of sensor signal wiring table inside the waterproof box. Figure 1: The screen will print the initialization process upon power-on . Figure 2: View on local OLED screen. Figure 3: View on OneNet cloud platform. Figure 4: View on mobile APP. Figure 5: View on PC webpage. Figure 6: View on PC network port host computer. Video link: JLCPCB - Spark Program - Intelligent Environmental Monitoring System








参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-25 14:51:18

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号