12 sensor connected to an ESP32. Since the ESP32 works with 3.3 V and the sensor output voltage is 5 Vdc. I added a level shifter, in particular this level shifter mosfet.
Basically I have:
- 12 Vdc to power the sensor and the ESP32;
- A 12 Vdc to 3.3 V regulator and a 12 Vdc to 5 Vdc regulator;
- Common GND between ESP32 and sensor and power supplies;
- The sensor goes on HV1 and PIN of ESP32 for SDI goes to LV1 of the MOSFET level shifter;
- LV connected to 3.3 V, HV connected to 5V dc
If I test with this setup I have some sort of offset from 0 V on the 3.3 V side, so the ESP does not detect the response.
If I use a simple voltage divider everything works properly.
In this case the voltage generator is the sensor output and the signal indicated with 3.205 is where I connected the input pin of the ESP32, GND in common.
Am I doing something wrong?