Inductive circuit 24v sensor

Hello, I would like to make a sensor system that will count the number of revolutions of a motor with an induction sensor. The problem is that the sensor works at 24V and I do not know how I should connect it to the arduino to receive the impulses given by the sensor. I suspect that for this I must reduce the voltage of the impulses sent because the arduino cannot receive impulses in 24V. I have already tried to make a system where I use a potentiometer to decrease the voltage to 5v but it does not work. So if someone could give me a schematic of the electrical circuit I should use. This is the sensor I am using :wenglor | the innovative family. It's a pnp for info and i'm using an official arduino mega board. thank you in advance

Just giving a link to a catalog page does not identify your sensor. Please be more specific.'

Paul

Hello, what do you meen with "please be more specific". What kind of informations do you need?

elpis2:
Hello, what do you meen with "please be more specific". What kind of informations do you need?

Oh, something like the actual model number.

Paul

Provide all the information you have please. In electronics and software all details can matter and usually do.

Sorry for sloppy drawing.


https://forum.arduino.cc/index.php?topic=700193.0

Paul and Mark, if you watch at the link that I put in my first message, you can see all the informations over this sensor. En thanks JCA, it does not matter for the writing. Thank you so much. Why do you set the link of my other forum page?

Context for other "would be" posters.

Ok, your circuit works with some modification, but now I made a program which when the sensor to see if it receives impulses or not.

int sensor = 6;

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

}

void loop() {

  Serial.println(digitalRead(sensor));
  delay(500);

}

But now I would like to do a program which when the sensor sends an impulse, it adds +1 to a number to know the number of turns made by a motor.

Ok, your circuit works with some modification

What modification? Does this program make the builtin LED turn ON / OFF when the switch is activated?

int sensor = 6;

void setup() {
 
  Serial.begin(9600);
  pinMode(sensor, INPUT);
  pinMode(LED_BUILTIN,OUTPUT);

}

void loop() {
  digitalWrite(LED_BUILTIN,digitalRead(sensor));
  
}

No, I have made this program to check if my sensor works. But now I will make a program that tell the numbers of rotation that a motor do. I have already make a program to do this, but it doesn't work. So I search someone make this program for me.