If you need to build an AND gate from discrete components, the most robust and gate transistor diagram is not a simple series switch, but a three-transistor Resistor-Transistor Logic (RTL) configuration combining a NAND stage with an inverter. Using three standard 2N3904 NPN transistors, five resistors, and a 5V supply, you can create a reliable logic gate that properly isolates inputs and provides a clean, buffered output capable of driving LEDs or relays.
While it is tempting to wire two transistors in series and call it a day, that approach fails in practice due to voltage stacking and base-current starvation. Below, we break down the exact schematic, the biasing math, and how to test the circuit on your bench.
The Flaw of 'Simple' Series Transistors
Many hobbyists attempt to build an AND gate by placing two NPN transistors in series between VCC and the load, tying their bases directly to the inputs. This fails for two reasons:
- Voltage Stacking: When both transistors saturate, the output voltage is the sum of their $V_{CE(sat)}$ drops. Two 2N3904 transistors will leave roughly 0.4V at the output instead of a clean 0V logic LOW.
- Base Current Starvation: The top transistor's emitter is tied to the bottom transistor's collector. When the bottom transistor turns on, the top transistor's base-emitter junction struggles to forward-bias properly because its emitter is no longer at ground potential, leading to unpredictable switching thresholds.
The RTL AND Gate Transistor Diagram & Component List
To solve the series-switch problem, we use a two-stage RTL design: a NAND gate (Q1 and Q2) followed by an inverter (Q3). This is the industry-standard way to map AND logic using discrete bipolar junction transistors (BJTs).
Pinout and Wiring Map
For this circuit, we use the standard TO-92 pinout for the 2N3904 (flat side facing you, leads pointing down): Pin 1 = Emitter (E), Pin 2 = Base (B), Pin 3 = Collector (C).
- Q1 (NAND Top): Collector to VCC via R1 (1kΩ). Base to Input A via R2 (10kΩ). Emitter to Q2 Collector.
- Q2 (NAND Bottom): Collector to Q1 Emitter. Base to Input B via R3 (10kΩ). Emitter to GND.
- Node Y (NAND Output): The junction of Q1 Collector and R1.
- Q3 (Inverter): Collector to VCC via R4 (1kΩ) and your Output Load. Base to Node Y via R5 (10kΩ). Emitter to GND.
Bill of Materials (BOM)
| Component | Value / Part Number | Function |
|---|---|---|
| Q1, Q2, Q3 | 2N3904 (or 2N2222) | NPN Switching Transistors |
| R1, R4 | 1kΩ (1/4W) | Collector Pull-up Resistors |
| R2, R3, R5 | 10kΩ (1/4W) | Base Current Limiting Resistors |
| Power | 5V DC | Standard TTL/RTL Logic Level |
Operation Regions & Logic State Table
Understanding the voltage at Node Y is critical. Node Y acts as the inverted logic (NAND) before Q3 flips it back to AND. Below is the measured bench data for this circuit operating at 5V.
| Input A | Input B | Q1 State | Q2 State | Node Y Voltage | Q3 State | Final Output |
|---|---|---|---|---|---|---|
| 0V (LOW) | 0V (LOW) | Cutoff | Cutoff | ~4.8V (HIGH) | Saturation | ~0.2V (LOW) |
| 5V (HIGH) | 0V (LOW) | Cutoff | Cutoff | ~4.8V (HIGH) | Saturation | ~0.2V (LOW) |
| 0V (LOW) | 5V (HIGH) | Cutoff | Saturation | ~4.8V (HIGH) | Saturation | ~0.2V (LOW) |
| 5V (HIGH) | 5V (HIGH) | Saturation | Saturation | ~0.4V (LOW) | Cutoff | ~5.0V (HIGH) |
Biasing Calculations & Safe Default Part Numbers
To ensure the transistors operate strictly as switches (either fully in cutoff or deep in saturation), we must calculate the base currents. We reference the ON Semiconductor 2N3904 datasheet for baseline parameters.
Sizing the Base Resistors (R2, R3, R5)
Assume a 5V logic HIGH input and a target collector current ($I_C$) of 5mA (enough to drive an indicator LED or the base of a larger power transistor).
- Calculate Required Base Current ($I_B$): The 2N3904 has a minimum DC current gain ($h_{FE}$) of 100 at $I_C = 10mA$. To guarantee saturation, we use a forced beta of 20.
$I_B = I_C / 20 = 5mA / 20 = 0.25mA$. - Calculate Resistor Value: The voltage drop across the base resistor is $V_{IN} - V_{BE(on)}$.
$R = (5V - 0.7V) / 0.25mA = 17.2kΩ$. - Select Standard Value: We use 10kΩ to provide roughly 0.43mA of base current, pushing the transistor well into hard saturation with a safety margin.
Sizing the Collector Pull-ups (R1, R4)
The 1kΩ pull-up resistors limit the maximum collector current to roughly 5mA ($5V / 1kΩ$). This keeps power dissipation low ($P = I^2R = 25mW$) while providing enough current to drive Q3's base or a small LED.
Safe Default Part Numbers:
- 2N3904: The universal default. 40V $V_{CEO}$, 200mA $I_C$, TO-92 package. Cost: ~$0.05 each.
- 2N2222 (or PN2222): Use if you need to drive slightly higher currents (up to 600mA). Pinout is identical to the 2N3904 in most modern TO-92 variants, but always verify the datasheet.
- BC547: Common in EU/UK markets. Identical electrical specs to the 2N3904, but the TO-92 pinout is reversed (C-B-E). Do not mix them on the same breadboard without adjusting wiring.
Multimeter Testing: How It Fails and How to Verify
Discrete logic gates fail differently than integrated circuits. Instead of a total chip failure, you get localized junction shorts or resistor drift. Here is how to troubleshoot the RTL AND gate with a standard digital multimeter (DMM).
Symptom: Output is Stuck HIGH
Most Likely Cause: Q3 is blown open, or R4 (Q3 collector pull-up) is disconnected.
The Fix: Set your DMM to DC Voltage. Power the circuit and measure the voltage at Q3's collector. If it reads 5V but Q3's base reads >0.6V, Q3 has an internal open circuit. Desolder and replace Q3.
Symptom: Output is Stuck LOW
Most Likely Cause: Q1 or Q2 is shorted, or Node Y is shorted to ground.
The Fix: Power down. Set DMM to Diode Test mode. Measure across Q1's Collector-Emitter. A reading of 0.00V or a continuous beep indicates a shorted junction. Replace the faulty transistor.
The 'Power-Off' Junction Test
Before soldering your 2N3904s into a permanent circuit, verify the base-emitter and base-collector junctions using the DMM's diode mode:
- Place the red probe on the Base (Pin 2) and the black probe on the Emitter (Pin 1). You should read between 0.55V and 0.75V.
- Move the black probe to the Collector (Pin 3). You should read a similar 0.55V to 0.75V.
- Reverse the probes (black on Base, red on Emitter/Collector). The meter should read OL (Over Limit). If it reads a low voltage, the junction is shorted and the transistor is trash.
Decision Path: Discrete Transistors vs. Logic ICs
Building an AND gate from discrete transistors is an excellent educational exercise and a valid emergency repair technique, but it is rarely the optimal choice for modern production designs. Use the decision matrix below to select the right approach for your project.
| Project Requirement | Recommended Approach | Specific Part / Value |
|---|---|---|
| Teaching logic fundamentals or one-off breadboard demo | Discrete RTL (This Guide) | 3x 2N3904, 5x 10k/1k Resistors |
| Need to drive a high-current load (relays, motors) directly from the gate | Discrete RTL + Power Stage | RTL AND gate driving a TIP120 Darlington base |
| Need multiple gates, high speed (>1MHz), or low quiescent current | Standard CMOS Logic IC | Texas Instruments 74HC08 (Quad 2-Input AND) |
| Interfacing 5V logic to 3.3V microcontrollers | Level-Shifting Logic IC | 74LVC08 or TXB0104 level translator |






