Page 2 of 2

Re: ESP32 DEVKIT and 12V NPN Sensor

Posted: Wed May 20, 2020 4:21 pm
by ienaboard
I ordered a some new stepdown. But if still will not work I think I need to use a 5V accu for the ESP32 and another 12V accu for sensor.

Re: ESP32 DEVKIT and 12V NPN Sensor

Posted: Thu May 21, 2020 5:46 pm
by ienaboard
Solved when I was doing a wrong wiring on the breadboard.

Suddenly it began to work perfectly whitout any apparent reason. Then I found that I putted the 4k7 resistor between sensor and input pin instead of between input and output (3V3) pin.

With this wiring works with the internal pull up too.
wiringok.PNG
wiringok.PNG (16.01 KiB) Viewed 205 times
Someone can explain me why?

Re: ESP32 DEVKIT and 12V NPN Sensor

Posted: Fri May 22, 2020 4:23 pm
by ienaboard
I didn't sleep tonight thinking about what happened to my ESP32.
Today maybe I found an answer.
Image

Looking at this image, +Vdc is my ESP32 pin connected to the output. When the sensor's transistor is "active", the output is connected to -Vdc. Whitout a load, I think that transistor in some way goes to shortcircuit with an imprevedible behaviour. If I put a sufficient load, all works.

This is the only explanation I found.

Tanks