As shown in the given mains AC high, low voltage protector circuit, we can see two op amps from the IC LM 324 are used for the required detection.
The upper op amp has its non inverting input rigged to a preset and is terminated to the supply DC voltage, pin #2 here is provided with a reference level, so that as soon as the potential at pin #3 goes above the set threshold (by P1), the output of the op amp goes high.
Quite similarly the lower op amp is also configured for some voltage threshold detection, however here the pins are just reversed, making the op amp output go high with low voltage input detection.
Therefore, the upper op amp responds to high voltage threshold and lower op amp to low voltage threshold. For both the detections, the output of the respective op amp becomes high.
Diodes D5 and D7 make sure that their junction produces a common output from the op amp output pin outs. Thus whenever any one of the op amp output goes high, it is produced at the junction of D5, D7 cathodes.
Transistor T1’s base is connected to the above diode junction, and as long as the op amps output remain low, T1 is allowed to conduct by getting the biasing voltage through R3.
However the moment any of the opamp output goes high (which may happen during abnormal voltage conditions) the diode junction also becomes high, restricting T1 from conducting.
Relay R1 instantly switches OFF itself and the connected load. Thus the connected load remains ON as long as the op amp outputs are low, which in turn can only happen when the input mains is within the safe window level, as adjusted by P1 and P2. P1 is set for detecting high voltage levels while P2 for the lower unsafe voltage level.