When both inputs of the DOOR gate are logic 1, ie 5 V, the voltage at the output terminals is 0 V. When logic 0 is applied to both inputs, the output is 5 V.
The principle of operation of the circuit: the output of N1 is 0 V. Assume that door. In this case LED1 lights up. In order for the output of gate N1 to be 0 V, the logic 1 signal must be present on resistor R2. This is only possible when the capacitor C1 is charged.
When capacitor C1 is fully charged, no current flows through R2, so 0 V is seen. When the voltage of R2 is 0 V, the output of N1 gate makes logic 1 V and LED1 goes out.
The output 1 of N1 causes C2 capacitor to start charging. This creates a voltage on R3. The voltage on R3 makes the output of N2 logic 0 V. Led2 runs when the output of N2 is 0 V. The circuit continues to operate this way. If a low-current 5 V mini relay is used instead of a led, a periodic system can be created (in this case, the 270 W resistor connected to the LEDs must be canceled ) .