What it Does
This circuit demonstrates the function of a NAND gate, which outputs HIGH (turns on the LED) when either or both inputs are LOW. The LED only turns off when both inputs (push-button switches) are HIGH.

Components Needed
- NPN transistors (BC547) – 2
- Resistor (220Ω) – 1
- Resistors (1kΩ) – 2
- Push-button switches – 2
- Green LED
- Breadboard
- Jumper wires
- Battery (9V) with clip
Step-by-Step Instructions
- Connect the 9V battery to the breadboard using the battery clip.
- Create a positive (Vcc) and negative (GND) rail on the breadboard.
- Insert the first NPN transistor into the breadboard. Label its legs as collector, base, and emitter.
- Insert the second NPN transistor next to the first one.
- Connect the collector of the second transistor to the positive rail.
- Place a 220Ω resistor between the battery positive rail and the LED. Also connect the emitter of the first transistor and the anode (longer leg) of the LED.
- Connect the cathode (shorter leg) of the LED to the GND rail.
- Connect the collector of the second transistor to the emitter of the first transistor.
- Connect the emitter of the second transistor to negative rail.
- Place a 1kΩ resistor between the base of the first transistor and one terminal of the first push-button switch.
- Connect the other terminal of the first push-button switch to the positive rail.
- Place another 1kΩ resistor between the base of the second transistor and one terminal of the second push-button switch.
- Connect the other terminal of the second switch to the positive rail.
- Verify all connections, then test the circuit by pressing each switch individually and both together to observe the LED behavior.

How it Works
This circuit combines the NOT and AND logic. When neither or only one push-button switch is pressed (inputs LOW), at least one transistor is OFF, preventing current from bypassing the LED, so the LED stays ON. When both switches are pressed (inputs HIGH), both transistors turn ON, allowing current to bypass the LED, turning it OFF. The resistors limit the current flow to protect the components.