Introduction: Building Logic Gates Using NPN Transistors

About: Moving fast and breaking things!

In this instructable, we are going to build the NOT, AND, OR logic gates using NPN transistors.
The following link covers the fundamentals of the gates mentioned above: Digital Logic Gates (Part 1)

Parts needed:

Breadboard

9V battery

Battery connector

5V regulator

2 10K resistors

1 5.1K resistor

2 NPN transistors

1 LED (any color)

Wires as needed

Step 1: Theory Behind Transistors

What are transistors? And how do they operate?

Transistors are semiconductor devices (made of silicon or germanium) that are used as either controlled switches, or as amplifier controls. A good analogy would be that a transistor acts as a faucet that controls the flow of water by a control knob; in a transistor, the control knob would be a small current applied to a control terminal, and as a result controlling the larger current flow out of the other two terminals. Transistors are used in almost every electric application out there. There are two types of transistors; bipolar transistors and field-effect transistors. For this instructable, we will focus on bipolar transistors. Bipolar transistors comprise of three terminals; collector, base, and emitter. Also, there are two configurations for bipolar transistors; NPN and PNP configurations. In this instructable, we are going to use NPN transistors. Note: the pin configuration of an NPN bipolar junction transistor is shown in the attached figure. NPN bipolar transistors use small current and positive voltage at its base to control the flow of a larger current from the collector to the emitter.

Step 2: NOT Gate (Inverter)

The desired gate is the NOT gate (inverter), and its symbol and truth table are shown in Figures 1 & 2 respectively. The Resistor-Transitor Logic (RTL) configuration for the inverter is shown in Figure 3, and it was constructed on a breadboard for testing purposes. Also, we are going to test the two possible inputs and observe their corresponding outputs, in order to ensure that RTL constructed is indeed correct. The output was observed using an LED circuit detector. If the LED is on, then the output is High (1). If the LED is off, then the output is Low (0). Finally, looking at the output of the constructed circuit and the NOT gate truth table, we can conclude that the RTL circuit configuration is indeed correct.

Step 3: AND Gate

The desired gate is the AND gate, and its symbol and truth table are shown in Figures 1 & 2 respectively. The Resistor-Transitor Logic (RTL) for the inverter is shown in Figure 3, and it was constructed on a breadboard to observe the outputs. Also, we are going to test the four possible inputs and observe their corresponding outputs, in order to ensure that RTL constructed is indeed correct. For the breadboard part, Input 1 (A) is represented by the white wire, Input 2 (B) is represented by the blue wire, and the output is represented by the state of the LED (either on or off). If the LED is on, then the output is High (1). If the LED is off, then the output is Low (0). Finally, looking at the output of the constructed circuit and the AND gate truth table, we can conclude that the RTL circuit configuration is indeed correct.

Step 4: OR Gate

The desired gate is the OR gate, and its symbol and truth table are shown in Figures 1 & 2 respectively. The Resistor-Transitor Logic (RTL) for the inverter is shown in Figure 3, and it was constructed on a breadboard to observe the outputs. Also, we are going to test the four possible inputs and observe their corresponding outputs, in order to ensure that RTL constructed is indeed correct. For the breadboard part, Input 1 (A) is represented by the white wire, Input 2 (B) is represented by the blue wire, and the output is represented by the state of the LED (either on or off). Finally, looking at the output of the constructed circuit and the OR gate truth table, we can conclude that the RTL circuit configuration is indeed correct.