
The goal of this is to activate an alarm as soon as the power is cut. This alarm should not go out due to the loss of power. It also shouldn't go out on its own, but only if I actively stop it.
I also wanted an easy way to stop the alarm and deactivate the detector. I added a light to indicate if it's currently active or not.
It works like this:
The whole detector is activated with the constant combinator providing the signal R = 1. If I switch off that combinator, any ongoing alarm will go out and no new alarm will start. If it is switch off the lamp will be yellow.
The substation in the middle is only connected to the switch. As I only use nuclear power, the accumulators should always be fully loaded. In case the power connection is somehow cut, or the powerproduction is insufficient, the accumulators will lose power. This is detected by one of combinators. If R is set, it will store the value in a memory cell. If that stored value is greater than 0,the alarm is activated and the lamp turns red. It also will disable the switch so that the my detector stays powered and is not drained completely drained.
If the detector is active and no powerloss has been detected, the lamp is green.
In my current setup it would not work for a base with solar power there accumulators are expected to go down. Still you might use it, but you have to set the alarm threshold to a critical low value like 10% instead of 100 if you want to see that you did not keep up with your base's power needs.
This is the blueprint for my design: