4-20 mA to voltage converter module (HW-685) with ESP32

Supply 7-36 V Bus ANALOG Measures current
VCCGNDVOUTI+I-

Pins and ESP32 wiring

PinRoleESP32 pinNotes
VCCNot wired to the ESP32—External 7 to 36 V supply (e.g. 12 or 24 V). Never to the ESP32. Pin order varies
GNDGroundGNDConnect to ESP32 GND too (common ground)
VOUTAnalog outputD34Set the span trimmer so 20 mA gives 3.3 V or less before connecting. To an ADC pin (prefer ADC1: GPIO 32 to 39)
I+Not wired to the ESP32—Current loop in, from the transmitter
I-Not wired to the ESP32—Current loop out

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);  // VOUT on GPIO 34
  Serial.println(mv);
  delay(200);
}

Sources

Try it in 3D in BoardPilot

BoardPilot Part data (JSON)

Related parts

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