How to connect ultrasonic sensor to arduino uno Esp8266

I am little bit confusion how to connect echo and trig pins of ultrasonic distance sensor to arduino uno and esp8266. I made connectin between Arduino uno and Esp8266 and it is connecting to wifi netwok. Now i want to read sensor data.

Anyone help me regarding this issue

Thanks in advance

Which of the two you want to connect the sensor to? Actually it doesn't matter really - just take two pins, echo and trig, tell your sketch which ones you have, and you're good to go. Uses the exact same code for both processors.

wvmarle: Which of the two you want to connect the sensor to? Actually it doesn't matter really - just take two pins, echo and trig, tell your sketch which ones you have, and you're good to go. Uses the exact same code for both processors.

Where do i program the code?? directly in esp8266 or in arduino uno board?

please help me this is a massive help in my thesis :(

You normally program using an IDE such as the Arduino IDE, and then upload the compiled code onto the processor you want it to be on.

check this - HC_SR04_ESP8266_Serial_Demo.ino