
SoftPowerLatch
mrWheel/softPowerLatch
A simple and efficient soft power latch circuit that allows a device to be switched on and off using a single push button, with ultra-low standby current.

This project describes a battery-powered, low-power air quality monitor
HandheldAerosolSensor is an open-source printed circuit board by mrWheel, from the mrWheel/handheldAerosolSensor repository on GitHub. It is a 2-layer board of 99.8 × 65 mm with 35 parts on 45 nets, routed with 279 tracks and 31 vias.
It is built around the PMS5003, SPS30 and BSS138, with the AO3401A and BH-18650-PC among its other parts. Its parts include 11 resistors, 6 connectors, 3 ICs, 3 transistors and 2 capacitors. It belongs with the ESP32 boards of this library.
This software is developed incrementally. That means I have no clear idea how it works (though it mostly does).
If you have questions about this software, it will probably take you just as long to figure things out as it would take me. So I’d prefer that you investigate it yourself.
Having said that Don’t Even Think About Using It
Seriously. Don’t.
Building this design may injure or kill you during construction, burn your house down while in use, and then—just to be thorough—explode afterward.
This is not a joke. This project involves lethal voltages. If you are not a qualified electronics engineer, close this repository, step away from the soldering iron, and make yourself a cup of tea.
If you decide to ignore all of the above and build it anyway, you do so entirely at your own risk. You are fully responsible for taking proper safety precautions. I take zero responsibility for anything that happens—electrically, mechanically, chemically, spiritually, or otherwise.
Also, full disclosure: I am not a qualified electrical engineer. I provide no guarantees, no warranties, and absolutely no assurance that this design is correct, safe, or suitable for any purpose whatsoever.
This project is a battery-powered, low-power air quality monitor based on:
The system powers itself on with a button, performs a measurement cycle, updates the e‑paper display, and then fully powers itself off to achieve near-zero standby current.
maxMetingen measurement attempts
| ESP32 pin | DEVKIT V1 | Standaard functie | AerosolSensor | Opmerking |
|---|---|---|---|---|
| 25 | D25 | GPIO / DAC1 | GPIO_PIN_LATCH | Latch control (OUTPUT) |
| 33 | D33 | GPIO / ADC1_CH5 / Touch | GPIO_PIN_SWITCH | Switch input (INPUT_PULLUP), non-strapping |
| 34 | D34 | ADC1_CH6 (input-only) | GPIO_PIN_BAT_ADC | Battery ADC (input-only), ADC1 recommended |
| 21 | D21 | I2C SDA (typical) | GPIO_PIN_SPS30_SDA | SPS30 SDA |
| 22 | D22 | I2C SCL (typical) | GPIO_PIN_SPS30_SCL | SPS30 SCL |
| 16 | RX2 | Future Ext. | GPIO_PIN_SPS_UART_RX | Serial SPS module |
| 17 | TX2 | Future Ext. | GPIO_PIN_SPS_UART_TX | Serial SPS module |
| 23 | D23 | VSPI MOSI (typical) | GPIO_PIN_EPD_MOSI | E-paper DIN (MOSI) |
| -1 | n.c. | n.v.t. | GPIO_PIN_EPD_MISO | Not connected on display |
| 18 | D18 | VSPI SCK (typical) | GPIO_PIN_EPD_SCK | E-paper CLK (SCK) |
| 27 | D27 | GPIO | GPIO_PIN_EPD_CS | E-paper CS |
| 19 | D19 | e-Paper DC | GPIO_PIN_EPD_DC | E-paper DC |
| 13 | D13 | e-Paper RST | GPIO_PIN_EPD_RST | E-paper RST |
| 32 | D32 | GPIO / ADC1_CH4 / Touch | GPIO_PIN_EPD_BUSY | E-paper BUSY (INPUT_PULLUP), non-strapping |
| 14 | D14 | GPIO PWM Touch | GPIO_PIN_BUZZER_PWM | Buzzer |
; platformio.ini
;
;— ESP32 + Arduino framework
;— Pin choices avoid ESP32 strapping pins (GPIO0,2,4,5,12,15) and flash pins (GPIO6–11).
;— Battery ADC uses ADC1 (GPIO34) so it keeps working even if WiFi were enabled.
;— SPI uses VSPI defaults for ESP32: MOSI=23, MISO=19, SCK=18.
[platformio]
workspace_dir = .pio.nosync
default_envs = esp32dev
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921600
;-- do NOT use 0, 2, 4, 5, 12, 15 (Strapping pins) or 6–11 (Flash pins)
build_flags =
;==================== Power & user input ====================
;— Power latch control (OUTPUT)
-D GPIO_PIN_LATCH=25setup() to hold powerYou can easily adjust:
warmupSeconds (e.g. 15 → 30)maxMetingen (e.g. 5 → 10)This project is intended for personal and educational use. You are free to modify and adapt it for your own hardware.
This design prioritizes:
It is well suited for portable or infrequently-used air quality measurements where long battery life matters.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 100k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R1, R3, R4, R5, R8, R9 |
| 5 | MountingHole | MountingHole:MountingHole_2.7mm | H1, H2, H3, H4, H5 |
| 2 | 10R-220R | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R2, R6 |
| 2 | 10k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R10, R11 |
| 2 | 1N4148 | Diode_SMD:D_1206_3216Metric_Pad1.42x1.75mm_HandSolder | D1, D2 |
| 2 | BSS138 | MyNewLibrary:BSS138 | Q102, Q103 |
| 1 | 0.1uF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C2 |
| 1 | 10uF | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C1 |
| 1 | 1k | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R7 |
| 1 | AO3401A | MyNewLibrary:AO3401 | Q101 |
| 1 | BH-18650-PC | MyNewLibrary:BAT_BH-18650-PC | BT1 |
| 1 | BME/P280 | Connector_PinSocket_2.54mm:PinSocket_1x06_P2.54mm_Vertical | J4 |
| 1 | ESP32-DEVKIT-V1 30pin | MyNewLibrary:MODULE_ESP32_DEVKIT_V1_30pin | U3 |
| 1 | Ext.Sw | Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_Vertical | J5 |
| 1 | I2C 3v3 | Connector_JST:JST_XH_B4B-XH-A_1x04_P2.50mm_Vertical | J1 |
| 1 | Mini DC-DC Convertor | MyNewLibrary:Mini DC-DC Boost Convertor | U2 |
| 1 | PIEZO | MyNewLibrary:XDCR_CPI-148-24-90T-67 | LS1 |
| 1 | PMS5003 | Connector_JST:JST_XH_B8B-XH-A_1x08_P2.50mm_Vertical | J6 |
| 1 | PWR | Button_Switch_THT:SW_PUSH_6mm_H4.3mm | SW1 |
| 1 | SPS30 | Connector_JST:JST_XH_B5B-XH-A_1x05_P2.50mm_Vertical | J3 |
| 1 | ePaper | Connector_JST:JST_XH_B8B-XH-A_1x08_P2.50mm_Vertical | J2 |
| 1 | ~ | MyNewLibrary:TP4056_USB-Charger_Board | U1 |
It measures 99.8 × 65 mm and has 2 copper layers, 1.6 mm thick.
35 parts, built around the PMS5003, SPS30, BSS138 and AO3401A. 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 mrWheel/handheldAerosolSensor repository on GitHub, at the commit this page was made from: the board is KiCAD/handheldAerosolSensor/handheldAerosolSensor.kicad_pcb and its schematic KiCAD/handheldAerosolSensor/handheldAerosolSensor.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 mrWheel before reusing the design.

mrWheel/softPowerLatch
A simple and efficient soft power latch circuit that allows a device to be switched on and off using a single push button, with ultra-low standby current.


willem-pennings/Air-Quality-Sensor
Design files for a Home Assistant-compatible air quality sensor/monitor

panStamp/respira_fiware
Open FIWARE air monitoring device for urban applications

Blizzard26/OAM-KNX2HovalGateway
OpenKNX Application to connect KNX Bus to Hoval TopTronic Bus


TTNApeldoorn/aid-hittestress-2023
Hittestres sensor for project Homerusstraat
