The Discrete NOT Gate: Why Build What You Can Buy?
If you need to invert a single logic signal, reaching for a 14-pin 74HC04 hex inverter IC is often overkill. Discrete NOT gate transistors solve this by using a single bipolar junction transistor (BJT) or MOSFET configured as a common-emitter or common-source switch. This approach is the safe default when you need to interface mismatched logic levels (like driving a 12V relay from a 3.3V ESP32 GPIO) or when you simply want to save board space and component costs on a high-volume design.
For BJT designs, the 2N2222A (NPN, 40V VCE, 600mA IC) or the smaller BC547 (NPN, 45V VCE, 100mA IC) are the industry standards. For MOSFET designs, the 2N7000 (N-channel, 60V VDS, 200mA ID) is the go-to logic-level switch. Never use a part number without verifying its maximum voltage and current ratings against your specific load.
BJT vs. MOSFET NOT Gate Circuits and Component Values
While both devices can invert a signal, the biasing requirements and input impedance differ drastically. Below is a complete, bench-tested application circuit for a 5V logic inverter using the ubiquitous 2N2222A NPN transistor.
Pinout and Symbol Description
When holding the 2N2222A in a TO-92 package with the flat side facing you and the pins pointing down, the pins from left to right are:
- Emitter (E): Connects to Ground (GND). In the schematic symbol, this is the pin with the outward-pointing arrow.
- Base (B): The control input. Connects to the input signal via a current-limiting base resistor.
- Collector (C): The output. Connects to the load and the pull-up resistor. In the symbol, this is the top pin without an arrow.
Complete 5V BJT Inverter Application Circuit
To build a reliable NOT gate that interfaces a 3.3V microcontroller output to a 5V load (like an indicator LED or a logic input), use the following component values:
- Q1: 2N2222A NPN Transistor
- RC (Collector Pull-up): 1kΩ (1/4W). Limits collector current to ~5mA when saturated.
- RB (Base Resistor): 4.7kΩ (1/4W). Limits base current to safely drive the transistor into hard saturation from a 3.3V GPIO.
- VCC: 5V DC
How to bias and select the base resistor: We want the transistor in deep saturation, acting as a closed switch. Assuming a conservative forced Beta (β) of 10 for saturation, and a target collector current (IC) of 5mA, we need a base current (IB) of 0.5mA. With a 3.3V input and a 0.7V base-emitter drop, Ohm's law dictates: RB = (3.3V - 0.7V) / 0.0005A = 5,200Ω. The next standard E12 value down is 4.7kΩ, which provides slightly more base drive to guarantee saturation.
Transistor Operation Regions in Logic Switching
Unlike amplifier circuits where the transistor operates in the active (linear) region, NOT gate transistors must snap between two extremes. Lingering in the active region causes excess heat and undefined logic outputs. Refer to the transistor switching principles for deeper theory.
| Operation Region | Input Voltage (VIN) | Base-Emitter State | Collector Current (IC) | Output Voltage (VOUT) | Logic State |
|---|---|---|---|---|---|
| Cutoff | < 0.5V | Reverse biased / Off | 0 mA | 5.0V (VCC) | Logic HIGH (1) |
| Active (Avoid) | 0.6V - 1.5V | Forward biased (Partial) | 1 - 4 mA | 1.0V - 4.0V | Undefined / Invalid |
| Saturation | > 2.0V | Forward biased (Hard On) | ~5 mA (Max) | ~0.2V (VCE(sat)) | Logic LOW (0) |
Failure Modes and Multimeter Testing
Discrete transistors rarely fail randomly; they usually die from thermal runaway, exceeding maximum VCE (causing avalanche breakdown), or excessive base current melting the internal bond wires. When a 2N2222A fails, it typically shorts Collector-to-Emitter, leaving your NOT gate output permanently stuck at Logic LOW.
How to Test a Suspect Transistor with a Multimeter
You can verify the health of a BJT without removing it from the circuit (if power is off and capacitors are discharged) using the Diode Test mode on your digital multimeter.
- De-energize the circuit: Remove all power and verify 0V across VCC and GND with your meter.
- Test Base-to-Emitter (B-E): Place the red probe on the Base and black on the Emitter. You should read a forward voltage drop between 0.600V and 0.750V. Swap probes (black on B, red on E); the meter should read OL (Over Limit / Open).
- Test Base-to-Collector (B-C): Red on Base, black on Collector. Expect the same 0.600V - 0.750V drop. Swap probes; expect OL.
- Test Collector-to-Emitter (C-E): Place probes across C and E in both directions. Both readings must be OL. If you read a short (near 0.00V) or a low resistance in either direction, the transistor is destroyed and must be replaced.
Frequently Asked Questions About NOT Gate Transistors
Can I use a PNP transistor for a NOT gate inverter?
Yes, but the circuit topology and logic behavior change. A PNP transistor (like the 2N2907A) requires a pull-down resistor on the collector instead of a pull-up, and the emitter connects to VCC instead of GND. More importantly, a PNP inverter is not logically inverted in the same way: a HIGH input turns the PNP off (output pulled LOW), and a LOW input turns it on (output pulled HIGH to VCC). While it still functions as an inverter, the base resistor must be tied to the input signal, and the input LOW voltage must be sufficiently below VCC (by at least 0.7V) to turn the device on. For standard ground-referenced logic, NPN (or N-channel MOSFET) configurations are vastly preferred.
Why does my discrete NOT gate transistor output float when the input is low?
If your output is floating or reading erratic voltages when the transistor is in cutoff, you have omitted or chosen too high a value for the collector pull-up resistor (RC). When the transistor is off, it acts as an open switch. Without a pull-up resistor tying the collector to VCC, the output node is left with high impedance, making it susceptible to electromagnetic interference and parasitic capacitance. Ensure RC is installed and sized correctly (typically 1kΩ to 10kΩ for logic applications) to provide a definitive Logic HIGH path.
How fast can a discrete 2N2222 NOT gate switch compared to a 74HC04 IC?
A dedicated logic IC like the Texas Instruments SN74HC04 is optimized for speed, featuring typical propagation delays of just 8 to 14 nanoseconds at 5V. A discrete 2N2222A NOT gate is significantly slower due to minority carrier storage time in the base region when transitioning from saturation to cutoff. You can expect turn-on times around 25ns, but turn-off times (storage time + fall time) can stretch to 200ns - 300ns unless you add a Baker clamp or a speed-up capacitor in parallel with the base resistor. For audio or low-speed motor control, the discrete part is fine; for SPI buses, high-speed UART, or PWM frequencies above 500kHz, use a dedicated logic IC or a high-speed MOSFET.






