STEP 01 OF 04

Build the hardware

Print the case, make three connections to the ESP32, and flash the controller. When you're done, one button powers the Pi on, starts recordings and shuts everything down.

Raspberry PiESP32-C3 Super MiniPush button BatteryPowerBoostINMP4412N22221 kΩ
1.1 · PRINT

Print the enclosure

Both parts are in hardware/, exported from Fusion as .3mf. Start with the small plug test. It tells you if the plug fits before you commit to the full case.

plug_test.3mf
First · checks plug fit
enclosure.3mf
Then · the main case
enclosure.3mf plug_test
1.2 · WIRE

Wire the controller

The ESP32-C3 stays on all the time. It reads the button, signals the Pi, and switches the PowerBoost's 5V output through a 2N2222.

COMMON GROUND 5V ESP32-C3 GPIO 4GPIO 5GPIO 3GND Button pull-up · press = LOW 1 kΩ 2N2222 PowerBoost FM5324HJ1 · battery K pin Raspberry Pi pin 10 · BCM GPIO15 open-drain signal pulls K low = "press"
Why open-drain?

GPIO 3 never drives voltage into a powered-off Pi. The Pi's pull-up holds the line high, and the ESP32 only pulls it low.

Power switching

The transistor "presses" the PowerBoost K pin. One tap turns 5V on, a double tap turns it off.

Pi-side wiring

INMP441 mic to the Pi's I2S pins, recording LED to BCM GPIO27. [ADD MIC PIN MAP]

esp32_controller.ino SERIAL · 115200 BAUD
1.3 · FLASH

Flash the ESP32

  1. Open controller/esp32_controller/esp32_controller.ino in the Arduino IDE. The folder name must match the sketch.
  2. Board: ESP32C3 Dev Module (esp32 core by Espressif).
  3. Turn on USB CDC On Boot for serial output.
  4. Upload, then open the Serial Monitor at 115200 baud.

Tune the feel: debounce, click window, long-press threshold and pulse lengths are constants at the top of the sketch.

Check: try every gesture

With the Serial Monitor open, each gesture should print a log line. The lower trace shows the signal the controller sends.

150 ms LOW → Pi

Single click

Toggles recording on the Pi.

tap K pin → 5V on

Triple click

Powers the Pi on.

hold 2.5 s 1200 ms → wait 15 s → 5V off

Long press

Fires on release. Shuts the Pi down cleanly, then cuts power.