Do I have to use an external power supply when connecting an ultrasonic sensor to Arduino?
From the question I assume you power your Arduino via USB in which case you don't need an external supply. The HC-SR04 draws 15 mA with is far below the specifications for USB. I did this myself some time ago: