Powering a door/windows sensor with constant power supply?

Has anyone tried powering a 3V door sensor to avoid using batteries?

I’m thinking a transformer will not work as the current output is not precise and will burn the sensor. Possibly a linear power supply might work like this one https://www.sparkfun.com/products/114 ?

Any ideas?