With the aid of a few components, a standard relay can be made to change state every time a pulse is applied (or a switch is pressed).
When the relay is not actuated, transistor T1 is off because its base and collector are at the same potential via R2. Capacitor C1 is charged via R4. R3 and the relay coil. When a short pulse (logic zero, shorter than 0.5 s) is applied to the input or S1 is pressed, T1 conducts and the relay is energized. The relay contact changes state, whereupon T2 also delivers current to the relay coil. Capacitor C1 is then discharged until its potential is equal to the base-emitter voltage of T2. When the pulse ceases, or the .switch is released T1 is off again, but the relay remains energized by T2.
A slightly longer input pulse is needed to deactivate the relay: it needs to be long enough for C1 to be discharged completely (or very nearly so) via R3. When the switch is released, or the input becomes high again, T1 stops conducting. Simultaneously, C1 is charged again, so that within a short time the base current of T2
drops to nearly zero. T2 then switches off and the relay is de-energized.
Short pulses at the input have no effect when the relay is actuated.
If fairly long pulses are input with the relay inoperative, the circuit functions as a standard relay that is actuated almost immediately by the pulse and is disabled as soon as the pulse ceases.
The hold voltage of the relay should be not more than half the supply voltage. The lower the hold voltage, the shorter the pulse required to actuate the relay can be.