Reading the IE5345 inductive proximity sensor with M-Duino PLC

How to wire and read the IE5345 inductive sensor using an M-Duino PLC and Arduino IDE
June 15, 2026 by
Reading the IE5345 inductive proximity sensor with M-Duino PLC
Boot & Work Corp. S.L, Bernat Brunet Pedra

The IE5345 is an IFM inductive proximity sensor that detects metallic objects at a range of 5 mm and outputs a digital signal. Because inductive sensors respond only to metal, they work reliably in wet or dirty environments where optical or capacitive sensors would fail. Typical applications include object detection on conveyor belts, machine guarding, and position detection. This article shows how to connect the IE5345 to an M-Duino PLC and read its output using the Arduino IDE.

What you need

Wiring the IE5345 to the M-Duino PLC

The IE5345 is available in 2-wire and 3-wire versions. For the 3-wire version, connect the wires as follows:

  • Brown wire: Vcc (10 to 30 VDC from the power supply)
  • Blue wire: GND
  • Black wire: digital input pin on the M-Duino PLC (e.g. I0_2)

The sensor operates between 10 and 30 VDC. A standard 24 V industrial power supply works correctly. For 2-wire versions, consult the sensor datasheet for the correct wiring method.

For the full IE5345 specification, see the IFM product page.

Arduino sketch for object detection

The sketch below reads the digital input connected to the sensor and prints the detection state to the serial monitor every second. Change the pin definition to match your wiring.

#define pin I0_2

void setup() {
  Serial.begin(9600);
  pinMode(pin, INPUT);
}

void loop() {
  if (digitalRead(pin)) {
    Serial.println("Detecting object");
  } else {
    Serial.println("No objects near");
  }
  delay(1000);
}

Select your M-Duino model under Tools > Board > Industrial Shields boards > M-Duino family and Tools > Model, then upload the sketch. When a metallic object comes within 5 mm of the sensor, the M-Duino digital input LED will turn on and the serial monitor will print "Detecting object".

​Search in our Blog

Reading the IE5345 inductive proximity sensor with M-Duino PLC
Boot & Work Corp. S.L, Bernat Brunet Pedra June 15, 2026
Share this post
Tags

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.

PLC Comparison