From my old "Bouwen en Leren" (Building and Learning) electronic projects book.
The primary power supply on the left is the powered by the regular house 220V mains. This power supply provides the relay with 12V and stays switched on - so the other reserve battery or, in this case a power supply - on the right, is cut off.
Only when the mains is failing, the relay switches, switching the backup on, but the emergency lightbulb on the right will only burn, if the LDR tells the circuit it's quiet dark.
18 сен 2024