Consider using a 7805 Voltage Regulator.
This requires you to have more than 5V because it needs a couple of volts in excess of the regulated value to wok.
If you need exactly 5V for a sensor (and I am not sure you do because sensors don't usually work like that) then you need an external PSU and you can't use USB power.