CD74HC4067 16-channel analog multiplexer with ESP32

Supply 3.3-5 V Bus ANALOG
SIGS3S2S1S0ENVCCGNDC0C1C2C3C4C5C6C7C8C9C10C11C12C13C14C15

Pins and ESP32 wiring

PinRoleESP32 pinNotes
SIGAnalog outputD34Common signal: to an ADC1 pin (GPIO 32 to 39)
S3Input (the ESP32 drives it)D25Channel select bit 3
S2Input (the ESP32 drives it)D26Channel select bit 2
S1Input (the ESP32 drives it)D27Channel select bit 1
S0Input (the ESP32 drives it)D32Channel select bit 0
ENNot wired to the ESP32—Enable, active LOW. Tie to GND
VCCPower3V3Use 3.3 V so no channel goes above 3.3 V
GNDGroundGND
C0Not wired to the ESP32—Channel 0: to a sensor or button, not to the ESP32
C1Not wired to the ESP32—
C2Not wired to the ESP32—
C3Not wired to the ESP32—
C4Not wired to the ESP32—
C5Not wired to the ESP32—
C6Not wired to the ESP32—
C7Not wired to the ESP32—
C8Not wired to the ESP32—
C9Not wired to the ESP32—
C10Not wired to the ESP32—
C11Not wired to the ESP32—
C12Not wired to the ESP32—
C13Not wired to the ESP32—
C14Not wired to the ESP32—
C15Not wired to the ESP32—

Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.

Starter code (Arduino)

void setup() { Serial.begin(115200); }

void loop() {
  int mv = analogReadMilliVolts(34);  // SIG on GPIO 34
  Serial.println(mv);
  delay(200);
}

Sources

Try it in 3D in BoardPilot

BoardPilot Part data (JSON)

Part data: CC BY 4.0, free to reuse with credit to BoardPilot.