Connecting proximity sensor to ESP32

Hello there,

We have a WaveShare ESP32-S3 and we would like to connect this to a proximity sensor. We are interested in this sensor: TELEMECANIQUE SENSORS Induktiver Näherungssensor, M18, 8 mm, PNP Schließer | Näherungssensoren günstig kaufen | reichelt elektronik

At first, can somebody tell me

  • how to power this sensor? Can somebody suggest me any adapter, which fulfills the conditions for this sensor? Or should be a standard 24V adapter ok for this?

  • If I connect the signal cable to the ESP32-S3 : Do I need any further potential divider? Or can I connect it directly? I believe a ESP32-Pin needs 3,3V

Thanks

Alex

If you want to be extra safe use an optocoupler

give more details of the project
e.g. what type/size of object are you attempting to detect?

Hi,
@abuech2s sensor datasheet.

Inductive sensor.pdf (187.0 KB)
Tom.... :smiley: :+1: :coffee: :australia:

We try to measure the number of rotations (finally the frequency) of a coupling of a vessel.

could you attach a magnet and use a hall effect sensor to measure the rotation

a photo of the setup would be useful

A Hallsensor was our first approach. This could be an alternative. But we are not sure, if we are allowed to attach a magnet. We will see it in the next days.

UPdate: Hallsensor was not possible to use. Therefore we try to use this proximity sensor for counting.

A PNP sensor is more dangerous than an NPN sensor, because with a PNP sensor the full sensor supply voltage appears on it's output.
Leo..

I am a complete newbie in this field. So is it correct, that black is the signal, brown +V and blue GND?

By that diagram, yes..
BUT note, the output (black) will go from 0V to what ever voltage you have on the +V (brown) wire.
Make sure this is not higher than 3V3, the logic level of the ESP32.

Tom.... :smiley: :+1: :coffee: :australia:

Yes, but you can't connect a PNP-type output sensor directly to an ESP pin.
The black signal wire has the same output voltage as the sensor supply, frying the ESP pin.
You need a voltage divider or an opto coupler, to bring that sensor signal voltage down to a safe 3.3volt.
Leo..

Thanks. It is the approach jim-p wrote at the first comment, right?

@abuech2s
Do you still need help?

Hi, @abuech2s

When you get the sensor can you check with a DMM between signal and gnd that it works and the output voltage, before you connect it to the ESP32 circuit.

Tom.... :smiley: :+1: :coffee: :australia: