ESP32 DEVKIT and 12V NPN Sensor

ienaboard
Posts: 9
Joined: Thu May 14, 2020 9:10 am

Re: ESP32 DEVKIT and 12V NPN Sensor

Postby ienaboard » Wed May 20, 2020 4:21 pm

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.

ienaboard
Posts: 9
Joined: Thu May 14, 2020 9:10 am

Re: ESP32 DEVKIT and 12V NPN Sensor

Postby ienaboard » Thu May 21, 2020 5:46 pm

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 2482 times
Someone can explain me why?

ienaboard
Posts: 9
Joined: Thu May 14, 2020 9:10 am

Re: ESP32 DEVKIT and 12V NPN Sensor

Postby ienaboard » Fri May 22, 2020 4:23 pm

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

Who is online

Users browsing this forum: Bing [Bot] and 92 guests