CD74HC4067 16-channel analog multiplexer con ESP32

Alimentazione 3.3-5 V Bus ANALOG
SIGS3S2S1S0ENVCCGNDC0C1C2C3C4C5C6C7C8C9C10C11C12C13C14C15

Pin e collegamento all’ESP32

PinRuoloPin ESP32Note
SIGUscita analogicaD34Common signal: to an ADC1 pin (GPIO 32 to 39)
S3Ingresso (lo pilota l’ESP32)D25Channel select bit 3
S2Ingresso (lo pilota l’ESP32)D26Channel select bit 2
S1Ingresso (lo pilota l’ESP32)D27Channel select bit 1
S0Ingresso (lo pilota l’ESP32)D32Channel select bit 0
ENNon collegato all’ESP32—Enable, active LOW. Tie to GND
VCCAlimentazione3V3Use 3.3 V so no channel goes above 3.3 V
GNDMassaGND
C0Non collegato all’ESP32—Channel 0: to a sensor or button, not to the ESP32
C1Non collegato all’ESP32—
C2Non collegato all’ESP32—
C3Non collegato all’ESP32—
C4Non collegato all’ESP32—
C5Non collegato all’ESP32—
C6Non collegato all’ESP32—
C7Non collegato all’ESP32—
C8Non collegato all’ESP32—
C9Non collegato all’ESP32—
C10Non collegato all’ESP32—
C11Non collegato all’ESP32—
C12Non collegato all’ESP32—
C13Non collegato all’ESP32—
C14Non collegato all’ESP32—
C15Non collegato all’ESP32—

Collegamento consigliato per l’ESP32 DevKit a 30 pin, evitando i pin della flash, di sola lettura e di strapping. BoardPilot lo controlla mentre colleghi.

Codice di partenza (Arduino)

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

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

Fonti

Provalo in 3D in BoardPilot

BoardPilot Dati del componente (JSON)

Dati dei componenti: CC BY 4.0, riutilizzabili citando BoardPilot.