When distance is measured using JSN ESP32 powered by laptop usb everything works fine. But when I connect 12V source to LM2596 and give the output 5V to ESP32 and JSN, it gives error readings. Can anyone help me with this issue?
This power supply and how you have connected it seems to be a secret.
Why else would you not show us.
Read the "How to post" sticky that you can find on top of every main page.
If it works on the laptop, then leave it connected to the laptop for now.
Leo..
added image