Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Hey everyone, I have a 3-pin sensor that operates at 5V to 12V (12V for optimal performance) and outputs a square wave signal. Previously, I used an Arduino since its digital pins can handle 5V input, allowing me to count pulses by detecting the falling edge. Now, I want to use an ESP32 instead. How should I proceed with inputting the data properly?
voltage divider can do the job but tha’s not a good option
ok got it
if you want long term effectiveness then go with logic level shifter
is going with a voltage divide a good choice ?
in that case you can go with the voltage divider approach
ohhh okay i was confused with different approaches thanks for solving the confusion
well you can use a logic level shifter
frequency of my signal is below 100hz . if this makes a difference while choosing with which option to go with
for example since the frequency is really low you can go with the voltage divider and LL shifter
options varies on your requirements
but LL shifter will be an overkill approach but more reliable
but its difficult to find a ll shifter for 12v to 3.3 , i have searched multiple sites in india , but its not available for that requirement , i will go for voltage divider for now
if you have to shift that much voltage then use Optocoupler instead
hey i tired the voltage divider method but the problem is that my sensor is outputting 0v to 11v and averaging around 6-7v . so if i design a voltage divider for 6,7v it can damage the esp cause of sudden spikes of 10-11v . but if i design a voltage divider for 12v , the input that esp receiving is 0.50v max during most of the time which is being not detected by the esp32 . the signal is a square wave . How should i tackle this issue?
since your sensor doesn’t give constant output using voltage divider is not gonna be the best option as it varies but resistance is constant
I would rather suggest you to use Optocoupler or MOSFET
but if the average value voltage is 6-7v (which will input around 1.62 to 1.97v) will esp able to detect the pulses of that voltage it seems less , but i might be wrong
The challenge I see here is the resistor value you are using, use a voltage divider such that at 12v input the ESP should be seeing 3.2v
Hmmm…your source voltage is 12v, so I expect your square wave to go from between 0v and 12v, just for clarity sake, were is the average voltage coming from?
CONTRIBUTE TO THIS THREAD