Skip to content

kroussekax/AERIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌍 AERIS Environmental Telemetry Node

Simple ESP32-based environmental sensing prototype.

Collects:

  • Gas concentration proxy (MQ-2)
  • Temperature (DHT sensor)
  • Moving average smoothing (SMA)

Designed for low-bandwidth telemetry preprocessing (e.g., CubeSat / remote node concept).


📦 Hardware Used

🔥 MQ-2 Gas Sensor

Image

Image

Image

Image

  • Analog output → ESP32 GPIO 34
  • Digital output → ESP32 GPIO 4 (unused in this code)
  • Used for gas concentration proxy

🌡️ DHT Temperature Sensor

Image

Image

Image

Image

  • Used for temperature readings
  • dht.readTemperature() is called every loop
  • Humidity not used in this version

🧠 Microcontroller

Image

Image

Image

Image

  • 12-bit ADC resolution (analogReadResolution(12))
  • 0–4095 ADC range
  • 3.3V reference

⚙️ How It Works

1️⃣ Gas Concentration Proxy

float getGasPPM(int analogPin)

Steps:

  1. Read raw ADC value (0–4095)
  2. Convert to voltage
  3. Convert voltage → percentage of 3.3V
  4. Scale percentage to proxy PPM (0–400 range)

Formula used:

voltage = raw * (3.3 / 4095.0)
gasPercent = (voltage / 3.3) * 100
proxyPPM = gasPercent * 4

⚠️ This is NOT real calibrated PPM. It is only a linear proxy value for simulation/testing.


2️⃣ Simple Moving Average (SMA)

#define TOTAL_SAMPLE 3

A rolling 3-sample window is used.

Structure:

struct SMA {
    float window[3];
}

Each loop:

  • New value inserted
  • Old values shifted
  • Average calculated

Formula:

SMA = (w0 + w1 + w2) / 3

Smoothing helps reduce sensor noise before telemetry transmission.


🔁 Main Loop Flow

Every 3 seconds:

  1. Read gas proxy PPM
  2. Read temperature
  3. Add values to SMA buffers
  4. After 3 samples → print SMA results

Output example:

proxy ppm: 173.24
G.getSMA() = 168.12
T.getSMA() = 29.87

🛰️ Intended Architecture

Conceptually designed for:

  • Onboard environmental sensing

  • Local filtering (SMA)

  • Reduced-noise telemetry transmission

  • Future integration with:

    • GPS (e.g., Quectel L80)
    • Humidity sensing
    • Risk scoring logic

📊 Why Use SMA?

Advantages:

  • Very low computational cost
  • Minimal memory usage
  • Good noise reduction
  • Ideal for embedded systems

Tradeoff:

  • Adds slight latency (window size dependent)

🚧 Current Limitations

  • MQ-2 values are not calibrated
  • No real PPM curve conversion (Rs/R0 method not implemented)
  • DHT object not fully defined in snippet
  • No GPS integration yet
  • No packet encoding or radio transmission

🔮 Future Improvements

  • Implement proper MQ-2 logarithmic PPM calculation
  • Store clean-air baseline (R0)
  • Add humidity
  • Add GPS coordinates
  • Encode structured telemetry packet
  • Add anomaly detection / wildfire risk scoring

🛠 Build Notes

  • Requires:

    • Arduino framework
    • DHT library
  • Serial baud rate: 9600

  • ADC resolution: 12-bit

About

kazakh '26 gng

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors