A discrete NOT logic gate circuit (commonly called an inverter) flips a HIGH input signal to a LOW output, and a LOW input to a HIGH output. While you can buy a 74HC04 IC for pennies, building a discrete NOT logic gate circuit using a Bipolar Junction Transistor (BJT) is a foundational exercise in circuit configuration. It teaches you how to bias a semiconductor into hard saturation and cutoff, bridging the gap between abstract Boolean logic and physical electron flow.
The most robust, beginner-friendly topology for a 5V logic inverter uses an NPN BJT in a common-emitter configuration. By the end of this guide, you will have the exact component values, node map, and failure-mode analysis needed to build and verify this circuit on your bench.
The Core Topology: NPN BJT Inverter Node Map
To understand the behavior, we must first map the physical nodes of the common-emitter inverter topology. This configuration relies on the transistor acting as a voltage-controlled switch to pull the output node to ground.
- Node A (VCC): 5V DC power supply positive rail.
- Node B (Input): The control signal (0V or 5V) from a microcontroller, switch, or preceding logic stage.
- Node C (Base): The control terminal of the NPN transistor, connected to Node B via the base resistor.
- Node D (Collector): The current-sinking terminal of the transistor, connected to Node A via the pull-up resistor.
- Node E (Emitter): The current-source terminal, tied directly to ground.
- Node F (Output): The junction between the pull-up resistor and the collector. This is where the inverted logic state is read.
- Node G (GND): 0V reference rail, shared by the power supply, input source, and emitter.
When Node B is HIGH (5V), current flows through the base resistor into Node C, turning the BJT ON. This creates a low-resistance path from Node D to Node E, pulling Node F (Output) down to near 0V. When Node B is LOW (0V), the BJT turns OFF, and the pull-up resistor pulls Node F up to 5V.
Component Selection and Design Walkthrough
Designing a reliable NOT logic gate circuit requires calculating exact resistor values to ensure the transistor reaches hard saturation. If the base current is too low, the transistor operates in the active (linear) region, and your logic LOW output might sit at 1.5V instead of the required <0.8V for standard TTL/CMOS logic.
1. Sizing the Collector Pull-Up Resistor (Rc)
We need Rc to limit current when the transistor is ON, but remain low enough to pull the output HIGH quickly when the transistor turns OFF (overcoming stray capacitance). A 1kΩ resistor is the bench standard for 5V logic.
- Current when ON (Ic): 5V / 1,000Ω = 5mA.
- Power dissipation: P = I²R = (0.005)² × 1000 = 25mW. A standard 1/4W (250mW) resistor is more than adequate.
2. Sizing the Base Resistor (Rb)
This is where most hobbyists make mistakes. We must overdrive the base to guarantee saturation. According to the transistor switching tutorials on Electronics Tutorials, an overdrive factor of 5 to 10 is standard practice.
- Target Collector Current (Ic) = 5mA.
- Minimum DC Current Gain (hFE) for a 2N3904 at 5mA ≈ 100.
- Minimum Base Current (Ib_min) = Ic / hFE = 5mA / 100 = 50µA.
- Target Base Current (Ib_target) = Ib_min × 10 (overdrive factor) = 500µA (0.5mA).
- Voltage across Rb = V_input - V_be(sat) = 5V - 0.7V = 4.3V.
- Rb = 4.3V / 0.5mA = 8.6kΩ.
Behavior Matrix and Failure Mode Extremes
Understanding how the circuit behaves under normal conditions is only half the battle. A competent designer must know what happens when components fail. Below is the behavior matrix for normal operation, followed by the extreme failure modes.
| Input State (Node B) | BJT State | Output Voltage (Node F) | Total Current Draw |
|---|---|---|---|
| LOW (0V) | Cutoff (OFF) | HIGH (~5.0V) | ~0 mA |
| HIGH (5V) | Saturation (ON) | LOW (~0.15V) | ~5.4 mA |
What Breaks at the Extremes?
- Rb Opens (or is omitted): The base floats. Stray electromagnetic noise might cause erratic switching, but generally, the BJT remains in cutoff. The output is stuck HIGH. If you connect the base directly to 5V without Rb, the base-emitter junction acts as a diode, drawing massive current and instantly destroying the transistor.
- Rc Shorts: Node A (5V) is connected directly to Node D (Collector). When the input goes HIGH, the BJT attempts to sink infinite current from the power supply through its collector-emitter junction. The 2N3904 will exceed its 200mA maximum rating, overheat, and fail short or open (often with visible smoke).
- BJT Collector-Emitter Short: The output (Node F) is permanently pulled to ground. The circuit reads a constant logic LOW, regardless of the input state.
Why Discrete BJT Over MOSFET or Standard IC Alternatives?
When designing a NOT logic gate circuit, you have three primary paths: a discrete BJT, a discrete MOSFET (like the 2N7000), or a dedicated logic IC (like the 74HC04). Here is why the BJT topology wins for general-purpose discrete buffering and educational builds.
| Criteria | Discrete NPN BJT (2N3904) | Discrete N-Channel MOSFET (2N7000) | Standard Logic IC (74HC04) |
|---|---|---|---|
| Logic Threshold Predictability | Excellent. V_be is a predictable ~0.7V. | Poor. V_gs(th) varies wildly (0.8V to 3.0V) between batches. | Excellent. Designed specifically for logic families. |
| ESD Sensitivity on Bench | Low. Base-emitter junction is robust. | High. Gate oxide is easily destroyed by static discharge. | Moderate. Input protection diodes handle minor spikes. |
| Current Sinking Capability | High. Can sink up to 200mA continuous. | High. Can handle ~200mA, but R_ds(on) increases with heat. | Very Low. 74HC series is limited to ~4mA per pin safely. |
As noted in SparkFun's guide to logic levels, standard 5V CMOS logic requires a HIGH signal to be at least 3.15V and a LOW to be below 1.35V. The BJT's hard saturation easily achieves a 0.15V LOW, providing excellent noise margin. Furthermore, if your NOT gate needs to drive a 20mA relay coil or an LED strip directly, the 74HC04 will fry, whereas the 2N3904 handles it effortlessly.
Step-by-Step Breadboard Testing and Verification
Follow these exact steps to build and verify the circuit. Never apply power until the wiring is verified.
- Prepare the Rails: Connect your bench power supply or 5V USB breakout to the breadboard. Red rail to 5V (Node A), blue/black rail to GND (Node G).
- Seat the Transistor: Insert the 2N3904 into the center trench. With the flat side facing you, the pins from left to right are Emitter (E), Base (B), and Collector (C).
- Place the Resistors: Insert one leg of the 1kΩ resistor (Rc) into the same row as the Collector. Insert one leg of the 10kΩ resistor (Rb) into the same row as the Base.
- Wire the Nodes:
- Connect the other leg of Rc to the 5V red rail.
- Connect the Emitter directly to the GND rail.
- Use a jumper wire to connect the Collector row to an empty row—this is your Output (Node F).
- Initial Verification (De-energized): Use your multimeter in continuity mode. Check that the Emitter has continuity to GND. Check that there is NO continuity between 5V and GND (verifying Rc and Rb are properly isolating the rails).
- Power and Measure: Turn on the 5V supply. Set your multimeter to DC Voltage. Place the black probe on GND and the red probe on Node F (Output).
- Test LOW Input: Connect a jumper from the Base (via Rb) to GND. The multimeter should read ~5.0V (Logic HIGH).
- Test HIGH Input: Move the jumper from the Base to the 5V rail. The multimeter should drop to <0.2V (Logic LOW). If it reads higher (e.g., 1.2V), your Rb value is too high, or the transistor is damaged.
Final Decision Path: Which Transistor to Pick?
While the 2N3904 is the default for low-power logic inversion, your specific load requirements might dictate a different part. Use this decision tree to select the exact transistor part number for your NOT logic gate circuit.
| Application Constraint | Required Specification | Concrete Part Pick |
|---|---|---|
| Standard 5V logic inversion, driving CMOS inputs or small LEDs (<100mA). | V_ceo ≥ 40V, Ic ≥ 200mA, TO-92 package. | 2N3904 (Default Recommendation) |
| Inverting a signal to drive a small relay, solenoid, or high-power LED (100mA - 500mA). | V_ceo ≥ 40V, Ic ≥ 600mA, TO-92 or TO-220 package. | 2N2222 (or PN2222A) |
| Inverting logic in a 12V, 24V, or 48V automotive/industrial system. | V_ceo ≥ 300V, Ic ≥ 500mA, TO-92 package. | MPSA42 (High Voltage NPN) |
The Verdict: For 95% of bench projects, Arduino interfacing, and 5V logic buffering, buy a bulk pack of 2N3904 transistors. They cost roughly $0.02 each in quantity, are virtually indestructible on a breadboard, and provide the exact switching characteristics needed for a flawless discrete NOT gate.






