Skip to content

About

A D1 Mini based display with SCD30 CO2 sensor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

D1 mini + SCD30 CO₂ Monitor (ESP8266) — OLED + Web + UDP

A tiny CO₂ monitor for Wemos/LOLIN D1 mini (ESP8266) + Sensirion SCD30 with a 128×64 SSD1309 OLED.
It provides a dark-mode web UI (with WiFiManager captive portal), a live brightness slider, and UDP telemetry/controls.


Used hardware

  • Wemos/LOLIN D1 mini (ESP8266)
  • Sensirion SCD30 CO₂ / Temperature / Humidity sensor (I²C)
  • 128×64 OLED, monochrome, SSD1309 controller (I²C)
  • Optional: LM2596 buck/step-down converter (if powering from >3.3 V)

Input voltage: 3.3 V (logic).


Wiring

docs/wiring.png

Wiring diagram


Required libraries (Arduino Library Manager)

  • WiFiManager (tzapu)
  • SparkFun SCD30 Arduino Library
  • U8g2 (olikraus)
  • ArduinoJson v6+ (Benoit Blanchon)
  • LittleFS (bundled with ESP8266 core) for config storage

ESP8266 board support (Boards Manager URL)

In Arduino IDE → Preferences → Additional Boards Manager URLs, add:

https://arduino.esp8266.com/stable/package_esp8266com_index.json

Then open Tools → Board → Boards Manager…, search for ESP8266 by ESP8266 Community, and install.


Functionality breakdown

  • Wi-Fi setup: WiFiManager captive portal (AP D1Mini-Setup) for first-time configuration; then auto-reconnect.
  • Web UI (dark mode):
    • Status card (IP, configured UDP target and ports).
    • Brightness slider (0–100) — RAM-only; 0 turns the OLED off (power-save). Resets to 0 on reboot.
    • Settings to set:
      • UDP target IP & port (telemetry)
      • UDP listen port (brightness control)
  • UDP telemetry (sender): three small packets:
    • T + temperature (°C)
    • //disabled, enable by uncommenting it
    • H + humidity (%RH)
    • //disabled, enable by uncommenting it
    • C + CO₂ (ppm)
  • UDP brightness (receiver): listens on the configured port; accepts either:
    • ASCII integers 0..100 (e.g., "42")
    • single-byte binary values 0..100
  • OLED display: large numeric CO₂ readout (ppm) for readability at distance.
  • Config persistence: UDP target + ports saved in LittleFS (/config.json).
    Brightness is RAM-only to avoid flash wear; not persisted across resets.

Build & flash

  1. Install ESP8266 board support (see Boards Manager URL above).
  2. Install the Required libraries via Library Manager.
  3. Select Board: LOLIN(WEMOS) D1 R2 & mini.
  4. Open the sketch, verify the U8g2 constructor matches your OLED.
    (SSD1309 is enabled by default; if you use SSD1306, switch the constructor.)
  5. Upload.

First run

  1. On boot, the device starts an AP EagleDisplay (password config123) if it can’t join Wi-Fi.
  2. Visit http://192.168.4.1/ to configure Wi-Fi (captive portal).
  3. After connecting to your network, open the device’s IP to access the web UI.

UDP details

  • Telemetry target: configurable via web UI (IP + port).
  • Packets: three separate UDP packets labeled T, H, and C (ASCII payload).
  • Brightness control: send UDP to the listen port with value 0..100:
    • ASCII: "0", "25", "100"
    • Binary: single byte 0..100
    • 0 turns the display OFF (power-save); >0 maps to OLED contrast.


Credits

  • ESP8266 Arduino Core (ESP8266 Community)
  • WiFiManager (tzapu)
  • U8g2 (olikraus)
  • ArduinoJson (B. Blanchon)
  • SparkFun SCD30 library

About

A D1 Mini based display with SCD30 CO2 sensor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages