Most likely a wiring problem or a defective module. When powering the arduino board on Usb there is a on-board 500ma thermofuse that opens up removing power from the board and killing the usb link if anything in your project is trying to draw more then 500ma of current. That is to protect damaging your PC. Without a schematic drawing of your wiring and a Link to your specific sensor type, it's difficult to see what and how you have everything wired up, so it's hard to check your work.