
Development board panel
portapack-mayhem/mayhem-mdk
PortaPack - Module Develoment Kit

This work is licensed under a [Creative Commons Attribution-NonCommercial 4.0 International License][cc-by-nc].
Esp ppo v2 is an open-source printed circuit board by iho77, from the iho77/ppo_v2 repository on GitHub. It is a 2-layer board of 60 × 40 mm with 19 parts on 27 nets, routed with 136 tracks and 4 vias.
It is built around the ESP32-C3-DEVKITM-1 and TPS63031DSK. Its parts include 6 capacitors, 5 resistors, 3 ICs, 3 connectors and 1 inductor. It belongs with the ESP32 and RISC-V boards of this library.
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
A high-precision Partial Pressure of Oxygen (PPO2) monitoring system for technical diving, built on ESP32-C3 with dual O2 sensor support and advanced signal processing algorithms.
⚠️ WARNING:
OXYGEN PPO MONITORING SOFTWARE
This software is not a dive computer, life-support system, medical device, or safety-critical instrument. It is provided for informational and educational purposes only. Readings may be inaccurate, delayed, or fail due to sensor drift/aging, moisture, calibration error, power or hardware faults, electromagnetic interference, or software bugs.
Do not rely on this software to determine breathing-gas safety. Always follow certified dive training and procedures, use approved equipment, carry independent/redundant instruments, and maintain conservative dive plans. Diving—especially with rebreathers—carries inherent risks of serious injury or death.
The software is provided “AS IS,” without warranties of any kind. To the maximum extent permitted by law, the developer disclaims all liability for any loss, damage, injury, or death arising from use or misuse of this software. By downloading, installing, or using the software, you acknowledge and accept all risks and agree to release, indemnify, and hold the developer harmless from any claims.
If you do not agree, do not use this software.
⚠️ IMPORTANT: This sostware developed using Anthropic Claude heavly with lack of human verification and testing.
⚠️ IMPORTANT: This system is designed for TESTING PURPUSES ONLY. Users must:
This system is a diving aid and should not be the sole method of gas monitoring during technical dives.
GPIO 0 -> ADC1_CH0 (O2 Sensor 1)
GPIO 1 -> ADC1_CH1 (O2 Sensor 2)
GPIO 3 -> ADC1_CH3 (Battery voltage divider 1/3)
GPIO 6 -> I2C SDA (Display)
GPIO 7 -> I2C SCL (Display)
GPIO 5 -> MODE Button
GPIO 10 -> SELECT Button
GPIO 8 -> RGB LED (Warning system)
The system implements a sophisticated 3-stage filtering pipeline for each O2 sensor:
Use 3 stages: spike removal → low-pass → rate limit + debounced alarms.
Spike/outlier killer (median-of-5) At each 20 Hz step, keep the last 5 raw samples and take the median.
Purpose: remove single-sample glitches without adding much lag (~0.1–0.15 s).
Exponential moving average (EMA) with ~5 s time constant Let y[n] = y[n−1] + α (x_med[n] − y[n−1]), where x_med is from step 1.
Sampling period dt = 1/20 = 0.05 s.
Choose time constant τ ≈ 5 s → α = dt/τ = 0.05/5 = 0.01.
Why: 5 s LPF kills high-freq jitter while keeping latency modest (~τ behind fast ramps).
Slew-rate limiter (enforce physics) If the environment cannot change by more than Δ_meaningful per 10 s, set
S_max = Δ_meaningful / 10 (units per second).
Per-sample limit: Δ_per_sample = S_max * dt. Then clamp the EMA output change: y_lim[n] = clamp(y[n−1] − Δ_per_sample, y[n], y[n−1] + Δ_per_sample).
Purpose: guarantees your displayed value can’t “move” faster than reality.
Debounced, hysteretic warnings (no flicker)
Trigger threshold: T_hi. Clear threshold: T_lo (with T_lo closer to normal than T_hi → hysteresis gap).
Require persistence: only raise a warning if y_lim[n] > T_hi continuously for T_confirm (e.g., 2–3 s).
Only clear if y_lim[n] < T_lo continuously for T_clear (e.g., 2–3 s).
Implement with two counters that increment while condition holds and reset otherwise.
That stack is O(1) memory and CPU, super stable, and easy to tune.
Replaces traditional linear calibration with a robust 1 or 2-point system:
PPO2 = 0.21 barPPO2 = 1.00 barSystem can works with 1 point calibration or 2 points calibration. In case of 1 point calibration second point is 0 mv\ 0% oxygen.
A clear, hands-on guide you can mirror in logs, a spreadsheet, or firmware notes.
k (mV/ata): millivolts per 1.0 ata ppO₂.b (mV): reading at ppO₂ = 0 (should be near 0).S = k / k₀ vs new-sensor baseline k₀.R² and max residual (mV).S hits your fail threshold, e.g., 0.70).At each calibration, expose the sensor to two known ppO₂ points and record:
(p₁, m₁): e.g., air at surface → p₁ ≈ 0.209 ata, measured m₁ (mV)(p₂, m₂): e.g., 100% O₂ at surface → p₂ = 1.00 ata, measured m₂ (mV)Fit a line m = k·p + b:
k = (m₂ − m₁) / (p₂ − p₁)
b = m₁ − k · p₁Then compute normalized sensitivity:
S = k / k₀Where k₀ is your new-sensor baseline (mV/ata).
Assume k₀ = 52.0 mV/ata (≈ 11 mV in air, ≈ 52 mV at 1.0 ata O₂).
| Date | Air mV m₁ | O₂ mV m₂ | Estimated k (mV/ata) | b (mV) | S = k/k₀ |
|---|---|---|---|---|---|
| 2025-01-01 | 10.99 | 52.25 | 52.16 | 0.09 | 1.003 |
| 2025-05-01 | 10.45 | 49.51 | 49.37 | 0.14 | 0.950 |
| 2025-10-01 | 9.48 | 45.86 | 46.00 | −0.14 | 0.885 |
| 2026-03-01 | 8.18 | 39.82 | 39.99 | −0.18 | 0.769 |
S drifts from ~1.00 → 0.77 over ~14 months (≈ 1.6 %/month).S < 0.80 (here: 2026-03-01).S hits 0.70: extrapolation from the last trend ≈ Aug 2026 (~19 months from first calibration).Log each time: the two mV readings and the computed k, b, S, plus a trendline of S vs time (and ETA to S = 0.70).
|b| > 2–3 mV or it drifts steadily, investigate (zero-current leakage, moisture, wiring).typedef enum {
WARNING_STATE_NORMAL = 0, // Green LED - PPO2 in range
WARNING_STATE_WARNING, // Yellow blinking - PPO2 at limits
WARNING_STATE_ALARM // Red blinking - PPO2 dangerous
} warning_state_t;├── main/ # Main application and mode management
│ ├── main.c # System initialization and 20Hz main loop
│ └── modes/ # Mode-specific implementations
├── components/
│ ├── app_common/ # Shared types and configuration
│ ├── sensor_manager/ # O2 sensor processing and calibration
│ ├── display_manager/ # LVGL display driver and UI
│ ├── warning_manager/ # LED warning system
│ ├── button_manager/ # GPIO button handling
│ └── sh1107_driver/ # Low-level display driverSensors (20Hz) → Filtering → Calibration → Warning Analysis → Display Update
↓
Health Monitoring → Recovery ActionsContributions welcome! Please read CONTRIBUTING.md for guidelines on:
| Qty | Value | Footprint | References |
|---|---|---|---|
| 2 | 10K | Resistor_SMD:R_0805_2012Metric | R1, R2 |
| 2 | 10uF | Capacitor_SMD:C_0805_2012Metric | C4, C5 |
| 2 | 1uF | Capacitor_SMD:C_0805_2012Metric | C1, C2 |
| 2 | Conn_01x02_Socket | Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical | J1, J2 |
| 1 | 1.5uH | Inductor_SMD:L_0402_1005Metric | L1 |
| 1 | 100K | Resistor_SMD:R_0805_2012Metric | R4 |
| 1 | 10k | Resistor_SMD:R_0805_2012Metric | R5 |
| 1 | 10uF | Capacitor_SMD:C_0603_1608Metric | C6 |
| 1 | 200k | Resistor_SMD:R_0805_2012Metric | R3 |
| 1 | 4.7uF | Capacitor_SMD:C_0805_2012Metric | C3 |
| 1 | Battery | Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical | BT1 |
| 1 | Conn_01x04_Socket | Connector_JST:JST_XH_B4B-XH-AM_1x04_P2.50mm_Vertical | J3 |
| 1 | ESP32-C3-DevKitM-1 | PCM_Espressif:ESP32-C3-DevKitM-1 | U1 |
| 1 | TPS63031DSK | Package_SON:WSON-10-1EP_2.5x2.5mm_P0.5mm_EP1.2x2mm | U3 |
| 1 | ~ | 1_Ivans_Library:128x128_OLED | U2 |
It measures 60 × 40 mm and has 2 copper layers, 1.6 mm thick.
19 parts, built around the ESP32-C3-DEVKITM-1 and TPS63031DSK. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the iho77/ppo_v2 repository on GitHub, at the commit this page was made from: the board is pcb/esp_ppo_v2.kicad_pcb and its schematic pcb/esp_ppo_v2.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask iho77 before reusing the design.

portapack-mayhem/mayhem-mdk
PortaPack - Module Develoment Kit



MasaoC/GPS-TFT-Map_PONS
鳥人間コンテストに特化したGNSS誘導システム。人力飛行機のパイロットが使いやすいことを目標にした航法装置です。ハードとソフトをオープンソースで開発しています。


Ahmed-YSY/FleetGuard
IoT vehicle telematics for fleet & logistics — ESP32 + SIM7600G 4G/GPS tracker with fuel-theft detection, tamper/cargo security alarms, offline-resilient MQTT reporting, and OBD2 data over ESP-NOW.

cernohorsky/TPS63031
High Efficiency Single Inductor Buck-Boost Converter With 1-A Switches
