LJC18A3-H-Z/BX capacitive proximity switch (NPN) with ESP32

Supply 6-36 V Bus GPIO Measures proximity, presence
BROWNBLUEBLACK

Pins and ESP32 wiring

PinRoleESP32 pinNotes
BROWNNot wired to the ESP32—Supply + from an external 6 to 36 V supply (e.g. 12 V). Never to the ESP32
BLUEGroundGNDSupply 0 V. Connect to ESP32 GND too (common ground)
BLACKOutput (the part drives it)D25NPN output, LOW when an object is near. Some units pull it up to the supply: measure first, use an optocoupler or divider

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);
  pinMode(25, INPUT);  // BLACK
}

void loop() {
  Serial.println(digitalRead(25));
  delay(100);
}

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.