# JSN SR04 not giving correct readings when connected to ESP32?

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

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

• 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? – jusaca Jul 30 at 7:53
• @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? – a-c-sreedhar-reddy Jul 30 at 7:57
• 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? – jusaca Jul 30 at 8:02
• @jusaca I am using jumper wires. – a-c-sreedhar-reddy Jul 31 at 6:06
• 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? – jusaca Jul 31 at 6:09

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.