0
\$\begingroup\$

When I connect a JSNSR04 to ESP32 and power it with USB of my computer, I am able to get correct readings.

enter image description here


But when I power it with buckconverter for short distances ( <150) JSN gives correct readings but for long distances JSN gives error readings.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ What exactly is the problem you see? The pulse length you get is just wrong? Have you checked to quality of the supply voltage? Do you have a scope to check the ripple? \$\endgroup\$ – jusaca Jul 30 at 7:53
  • \$\begingroup\$ @jusaca I don't have scope. So I can't check quality of supply voltage. But assuming that supply voltage might be the problem how it be corrected? \$\endgroup\$ – a-c-sreedhar-reddy Jul 30 at 7:57
  • \$\begingroup\$ Try putting a capacitor (~10uF) between 5V and GND right at the supply pins of the ESP and the JSN. Could you maybe add a photo of your wiring? \$\endgroup\$ – jusaca Jul 30 at 8:02
  • \$\begingroup\$ @jusaca I am using jumper wires. \$\endgroup\$ – a-c-sreedhar-reddy Jul 31 at 6:06
  • \$\begingroup\$ That might be the problem, the long wires in addition to a maybe not that clean supply voltage can cause these problems. Can you try using nice short wires instead? \$\endgroup\$ – jusaca Jul 31 at 6:09
0
\$\begingroup\$

If your JSN SR04 has 2.0 written on the board, you should put a pull-up resistor on the echo pin. It could be a 10k resistor.

\$\endgroup\$
  • \$\begingroup\$ @dalmango Tried this but it did not help. \$\endgroup\$ – a-c-sreedhar-reddy Jul 31 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.