Digital sensor to Controllino

I have a digital sensor that I want to read out on my Controllino.
Here is the manual:

I know the sensor is able to use IO-Link but I don't want to do that, I want to read it just through the digital pins of my Controllino. For some reason I can't get it to work and receive only the value 0 with the following code:

#include <Controllino.h>

void setup() {
  pinMode(CONTROLLINO_A5, INPUT);
  Serial.begin(19200);
}

void loop() {
  float sensorValue = digitalRead(CONTROLLINO_A5);

  Serial.print("Sensor value: ");
  Serial.println(sensorValue);

  delay(2000); // Optional delay to slow down the loop
}

I have the sensor and controllino powered by 12V and the U- from the sensor and the Controllino's GND is connected to GND of the power source.
I connected the switching output 1 (SP1) of the sensor to the A5 input of my Controllino.
Does someone have an idea? Is the wiring correctly done?

Hello cukaef

Post a picture and wiring diagram to see how we can help.

does the doc states it supports something else than IO-Link?

  float sensorValue = digitalRead(CONTROLLINO_A5);

Not the cause of your problem, but why put the result of a digitalRead() into a float variable ?

Here is the wiring:

There is the possibility to turn off IO Link and the vendor also told me that the IO Link is not necessary for the usage of the sensor, so it should work without it.

you're right

Post data sheet of sensor used.

Here the datasheet:

According to the data sheet, the sensor provides an I/O link and a configurable switching contact. See page 3.

So that means, reading the pressure value is not possible on the digital pins? only on io link?

Reading for yourself makes you smarter.
I do not know your system requirements.
Perhaps first measure the electrical properties of the sensor signal with a DMM.

I have read that there are also pressure switchers that also measure, and for me it is not clear from the datasheet whether the measured value can be extracted from the switchers or not.
Could you expand on the DMM measurements? What am I looking there for?

What exactly are you hoping to measure with the sensor ?

the pressure

How can you measure the pressure using a digital sensor ? The best that you could do is to know whether the pressure was above or below a certain value. Is that good enough ?

no, that is not good enough, I need to know the exact pressure

I went quickly through your doc and did not see any explanation of an analog output.

Then you cannot use a digital sensor as it can only output one of two values ie on/off, HIGH/LOW etc and not an absolute value

It looks like if you want to read pressure from that sensor you have to use IO-Link.

ok so then I got the wrong info from the vendor, thank you guys