All wiring guides

Free wiring guides

Wire the foot switch to the ESP32-C3

Foot switch, momentary. A button for your foot.

When buying: Momentary (springs back), not latching.

Which pin goes where

On the partOn the ESP32-C3
AGPIO 3
BGND

Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.

In 3D

Example sketch

// Foot switch, momentary
// on the ESP32-C3 Super Mini
// https://stem.manusignal.com/en/parts/foot-switch-esp32-c3

const int PIN_A = 3;

int last = -1;

void setup() {
  Serial.begin(115200);
  pinMode(PIN_A, INPUT_PULLUP);
}

void loop() {
  int now = digitalRead(PIN_A);
  if (now != last) {
    last = now;
    Serial.println(now == LOW ? "ON" : "off");
  }
  delay(20);
}
  • Tools > Board > ESP32C3 Dev Module (USB CDC On Boot: Enabled), then Tools > Port and choose the board's port.

This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.

What you should see

Open the Serial Monitor at 115200. It prints ON while the pedal is down.

If it does not work

A button does nothing.
One leg goes to the GPIO and the other to GND. On a 4-leg button use two legs on opposite corners.

The same part on the ESP32-S3

More parts on the ESP32-C3