4-20 mA to voltage converter module (HW-685) with ESP32
Supply 7-36 V
Bus ANALOG
Measures current
Pins and ESP32 wiring
| Pin | Role | ESP32 pin | Notes |
|---|---|---|---|
| VCC | Not wired to the ESP32 | — | External 7 to 36 V supply (e.g. 12 or 24 V). Never to the ESP32. Pin order varies |
| GND | Ground | GND | Connect to ESP32 GND too (common ground) |
| VOUT | Analog output | D34 | Set 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
- HW-685 seller datasheet, Supply 7 to 36 V; 0/4-20 mA in; 0-3.3 / 5 / 10 V out set by zero and span trimmers
Try it in 3D in BoardPilot
Related parts
49E linear hall sensor (SS49E)ACS712 current sensor moduleACS723 current sensor moduleACS758 high-current sensor module (50-200 A)AD8232 ECG heart monitorCapacitive soil moisture sensor v1.2
Part data: CC BY 4.0, free to reuse with credit to BoardPilot.