You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -10,69 +11,99 @@ Monitor Solar de Poluare Atmosferica cu GPS
10
11
11
12
## Description
12
13
13
-
Sistem portabil de monitorizare a calitatii aerului, alimentat solar. Achizitioneaza periodic date de la senzori de particule in suspensie (PM2.5/PM10), gaze (NOx, CO, VOC), temperatura si umiditate, corelate cu coordonate GPS si timestamp. Datele sunt stocate local pe card microSD in format JSON si expuse printr-un server web embedded via WiFi, prin endpoint-uri REST. O aplicatie mobila consuma API-ul si afiseaza grafice de poluare, pozitia pe harta si nivelul bateriei. Sistemul functioneaza autonom prin alimentare solara cu modul de incarcare si baterie Li-Ion.
14
+
Portable air quality station running off a solar panel and an 18650 cell. An STM32 reads particulate matter (PM2.5 / PM10), gases (CO, NO₂, NH₃, VOCs), temperature, humidity, and pressure, and tags every sample with GPS coordinates plus a timestamp. Readings are logged as JSON on a microSD card and served over Wi-Fi by a XIAO ESP32-C6 co-processor that runs a small REST server. A companion mobile app pulls the API and renders charts, the location on a map, and the battery state.
14
15
15
16
## Motivation
16
17
17
-
Statiile de monitorizare a calitatii aerului sunt rare si costisitoare, iar datele publice au granularitate scazuta. AeroGuard propune o solutie portabila, autonoma energetic, care permite monitorizarea locala a poluarii si vizualizarea datelor in timp real printr-o aplicatie mobila.
18
+
Professional air quality stations are lab-accurate but cost tens of thousands of euros each, so they end up sparse — only a handful per city — and the data they publish online is averaged over an entire district. AeroGuard takes the opposite trade-off: a solar-powered monitor built from off-the-shelf modules, for a small fraction of the price of a real station, that pulls in particulate matter (PM1.0 / PM2.5 / PM10), common pollutant gases (CO, NO₂, NH₃), a VOC index, temperature, humidity, atmospheric pressure, and GPS coordinates with an accurate UTC timestamp — and logs all of it every few seconds. The numbers are not lab-grade, but the device runs unattended for days on the balcony, can be moved wherever I want to measure, and gives me a far richer picture of what is actually in the air around it than any public source.
18
19
19
20
## Architecture
20
21
21
-
<!-- TODO: Add architecture diagram -->
22
+

23
+
24
+
Battery monitoring uses a 2 × 100 kΩ divider into an STM32 ADC pin and is exposed through `/api/battery`. Reverse-polarity protection on the SOLAR+ and BATT+ rails is done with 1N5819 Schottky diodes. Overcurrent / overcharge / overdischarge protection is taken care of by the Seiko S-8261 PCB built into the protected NCR18650B cell — no external polyfuse needed (a 1 A polyfuse would have nuisance-tripped on the Wi-Fi TX bursts anyway). A 470 µF bulk cap sits on the MP1584 output to keep the buck converter stable under PMS5003 fan inrush.
22
25
23
26
## Log
24
27
25
-
### Week 5 - 11 May
28
+
### Week 14 — 20 April
26
29
27
-
### Week 12 - 18 May
30
+
Picked the MCU stack: STM32 Nucleo U545RE-Q + XIAO ESP32-C6 as a Wi-Fi co-processor, both in Rust with embassy, talking to each other over UART with JSON. Checked drivers on crates.io — most sensors are covered, the MiCS-4514 is not, so I'll port the DFRobot Arduino library by hand. Sketched the power chain (panel → buck → charger → 18650 → boost) and made a buy list.
28
31
29
-
### Week 19 - 25 May
32
+
### Week 21 — 27 April
33
+
34
+
Ordered everything on April 22 from eMag, Optimus Digital, depozitulcubaterii, sigmanortec, DigiKey and Robofun. All parts arrived by the end of the week. Wrote most of this documentation page and put together the architecture diagram.
30
35
31
36
## Hardware
32
37
33
-
Microcontrolerul **STM32** citeste date de la senzorii de calitate a aerului prin **I2C** (BME280, SGP40), **UART** (PMS5003, NEO-6M) si **ADC** (MICS-4514). Datele sunt stocate pe **card microSD** via **SPI**. Comunicatia WiFi se realizeaza printr-un modul **ESP** conectat prin UART.
38
+
The STM32 talks to all sensors over standard buses: **I2C** for BME280, SGP40 and MiCS-4514, **UART** for PMS5003 and NEO-6M GPS, **SPI** for the microSD card. The XIAO ESP32-C6 sits on another UART and handles Wi-Fi and the REST API.
39
+
40
+
Power flows like this: a 9V / 2W polycrystalline panel feeds an MP1584 buck converter trimmed to 5.5 V (the upper limit on the CN3065 input). The CN3065 is a solar-optimised single-cell Li-Ion charger — unlike a TP4056, it does not collapse the panel under low light, which matters when the sun is behind a cloud. It charges a Panasonic NCR18650B Protected cell (3.7 V, 3400 mAh, with the Seiko S-8261 PCB built into the cell). A MT3608 boost converter lifts the battery voltage to a clean 5 V rail that feeds three loads: the PMS5003 fan, the STM32 Nucleo via its E5V pin, and the XIAO ESP32-C6 via its 5V pin. The Nucleo's onboard LDO (U15, LD39050PU33R, max 500 mA) generates the 3.3 V rail that powers every I2C / UART sensor and the SD module — no external AMS1117 needed.
34
41
35
-
Alimentarea se face printr-un **panou solar 5V/1W** conectat la un modul de incarcare **TP4056**, care incarca o **baterie Li-Ion 18650**. Nivelul bateriei este monitorizat prin ADC.
42
+
The two trimmer-based switching modules (MP1584 and MT3608) ship from the factory at unpredictable output voltages (the MT3608 in particular can be set to 28 V out of the box). Both get calibrated against a multimeter **before** anything else is connected to them.
36
43
37
44
### Schematics
38
45
39
-
<!-- TODO: Place KiCAD schematics here in SVG format-->
Unit prices in RON (VAT included), at the quantity actually needed for one AeroGuard. I bought a few extras (one or two spares on the modules that are most likely to fail at first power-up), but those are not counted here.
|[heapless](https://docs.rs/heapless)|`no_std` collections | Fixed-capacity buffers and string types |
93
+
|[defmt](https://docs.rs/defmt)| Embedded logger | Debug logs streamed via [probe-rs](https://probe.rs/)|
94
+
95
+
For the MiCS-4514 there is no Rust crate, so I'm porting [DFRobot's Arduino library](https://github.com/DFRobot/DFRobot_MICS). The chip exposes its readings over I2C through a simple register interface, so the port is mostly translating a handful of read/write helpers and the calibration math.
0 commit comments