if you have a gas powered appliance in your home you have suh a device. it's the "thermopile" that is in the pilot lihjy flame. it makes a small amount of power to hold the gas valve open vial a small electromagnet, and if pilot light goes out the gas supply is shut off.
you can get one from a hardware store or a discarded water heater to tinker with.
i dont remember the voltage they make but i doubt it's more than two volts.