ultrasonic sensor responding when connected to esp12 via usb to ttl converter but not working when connected to power supply
I moved your topic to an appropriate forum category @electrical-engineer-uet.
In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.
This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.
Thanks in advance for your cooperation.
Post an annotated schematic showing how you have connected these items. It sounds like a hardware voltage problem.