It is often required for an electronic system to respond to changing environmental factors automatically. For example

In fact the controlling factor may be almost anything – angle of tilt, magnetic field, sound level, speed, force, pressure, electrical resistance, current or voltage. The principle remains the same however. A sensor detects when a factor reaches a threshold level and changes an output from a set of logic gates. The output is sent to an output circuit where the heater or alarm or bulb is activated or deactivated as required.

This sort of system is very reliable and can be activated repeatedly. After each activation, a reset button can be pressed to put the sytem back into it's original state where it is acting for a change of input from the logic gates.