In this project, you're going to make a circuit that lights an LED when you press a key and when you release it. Trigger pulses are generated in a simple differentiating circuit using resistors and capacitors. If you wish to learn basics of a differentiating circuit, proceed to the next project differentiating circuit.
When you finish wiring, press S1 and hold it down. LED 2 should light upon push of the key and immediately go out.
Now, release S1. LED 1 should light upon the release and immediately go out.
You can tell that this circuit acts on both the rising (ON-going) edge and falling (OFF-going) edge of S1.
When S1 is pressed ON, a positive differential wave goes to U1 "a" through the capacitor C2, Q2 turns ON, and LED 2 goes on.
When S1 is released, on the other hand, a negative differential wave goes to U1 "b" through the capacitor C1, Q1 turns ON, and LED 1 goes on.
Tips on reading CR differential waveform:
Note that the electric charge in the capacitor does not change at t = 0 (the moment of ON/OFF switching of S1).
For example, when S1 is OFF, the voltages at both ends of C2 are 0 V, and C2 is in charge-free state.
When S1 is pressed ON, the S1 side of C2 develops +6 V. At t = 0, the opposite side of C2 also develops +6 V since C2 contains no electricity. Over time, C2 becomes charged to exhibit a positive differential wave.