I have a B+ connected to a H-bridge which is connected to 4 AA batteries and 4 motors, and they work fine, but now I want to add a distance sensor, which requires 5v, so do I need any extra batteries?
You can use the 5v output on the gpios of the Raspberry Pi. However be careful, you mustn't connect the echo pin directly to the gpio. Instead you can make a voltage divider on the wire connecting the echo pin because the b+ can't handle anything over 3.3v. Not using a voltage divider will damage your Raspberry Pi.