5V DC Regulation for Sensor Protection
You need to know how much noise/ripple the spectrometer can tolerate, and how much the 5V supply you use generates. Then, you'll know if they are compatible.

If your spectrometer requires 5V and all you have is a 5V supply, you won't be able to add a regulator though. At most a LC filter. So depending on the noise/ripple requirements, you might have to start with a higher voltage supply and add a local regulator. Can't tell without more data.

Now, if you want to protect against reverse polarity and overvoltage, starting with a higher voltage makes things much easier: just add a diode and a regulator.

Starting from 5V...


Put a polyswitch in the supply, acting as a resettable fuse.
Put a diode in reverse across the supply, so it will short it out and trip the polyswitch if it's plugged in reverse.
Put something like a TL431 wired as a precision shunt regulator across the supply, or even a simple zener, triggering a thyristor crowbar to short the supply and trip the polyswitch.


There are simpler solutions, like this one-chip USB overvoltage protector which lets the power through only if it is correct.

...And don't forget to check if the IO needs protection too!