In this guide I will show you how to build a AND gate with two NPN transistors.

Using the image above as a reference, we see that our transistor has three (3) pins. A collector (C), base (B), and emitter (E). Functionally, the transistor acts as an electronic switch, with the base input controlling whether or not there will be a flow of electricity from collector to emitter. There are different types of transistors with different purposes; from high speed switching to amplification, but in this guide we are just using the NPN transistor as a switch.

Step 1: Parts List

To build a logic AND gate you are going to need the following parts:

  • 1x Breadboard
  • 1x LED (Any color, red was used in this project)
  • 1x 1K Ohm resistor
  • 2x 10K Ohm resistors
  • 2x NPN Transistors (I used the 2N2222)
  • 2x N.O. Push buttons (Normally Open)
  • 5x Wires/Jumper Wires

The only prerequisite to this project is the ability to read and construct a circuit from a schematic.

Step 2: Schematic / Truth Table

Construct the gate of out the schematic above. ^

Every gate has its own truth table stating what the output will be based on the state of its inputs. For the AND gate, the table is as follows:

0  0  0
0  1  0
1  0  0
1  1  1

You see, the only time the output is ON (1), is when both A AND B are ON (1). Any other state results in the output being OFF (0).

That is it for the AND gate. A seemingly simple device, but when arranged in certain combinations with other gates (NAND, OR, NOR, XOR, XNOR, NOT) we get devices from computers to cell phones and rocket guidance systems.

What is the role of the resistor here ?
<p>Came here to find the answer to that question too... I know that the 1K resistor is there to serve as a pull-down for the output. Also, if it weren't there and A and B where high the current through the transistors would become too high, so it act as a current limiter as well. What the function of the 10k resistors are I don't know? Normally base resistors are there to limit base-emitter current, but to the best of my knowledge that's already done by 1k resistor. Can anyone enlighten?</p>
<p>I know various types of gates, including AND gates are very important for logic circuits. One of my daughters gave me an experimenter's electronics kit from Radio Shack with the idea I would show things to my grandchildren (her nephew and niece), but most of the circuit are various types of logic gates. I might get a warm feeling from building a logic gate, but what can I do with a logic gate without connecting it to lots of other circuitry? Other than a demonstration piece what can I do with a logic gate?</p>
<p>Think of a logic gate like a single Lego brick, there isn't much you can do with just one. </p>
Thank you for the response. I am wondering what I can do in behalf of my young grandchildren by demonstrating various logic gates one at a time. I did already buy a binary clock kit. I did most of the assembly and left a few things to be done so my granddaughter's attention span would not flag too early. It worked out well and she though it was pretty interesting for a few minutes. I was thinking more in terms of projects like a radio or some type of alarm set off when a light beam is cut, etc. So, I am looking around at various experimenter projects, even if I need to buy extra components.
<p>It really depends on how much they are interested in electronics. For example, my 12 year old brother has virtually no interest in building circuits or anything related. And explaining some of the things I build with him he doesn't understand. </p><p>As for a project involving logic gates I really think a binary calculator that can add/subtract would be a great example. But again its pretty complex to build and then explain it to someone (In my opinion)</p>
just think of any two that you want signals of, before the third signal is turned on:<br>for example:<br>turn the DVD-player on, turn the TV on, and automatically the stereo is turned on.<br>or<br>a pressure sensor in the doormat and a signals in a infrared sensor results in a alarm<br>or the other way around:<br>when you turn off or the lights outside or the lights in the shed, the lights in the garage turn of too<br>or, as the negative can also be true<br>when your carlights are on and the door opens, a signal sounds<br><br>and so on...<br>anything that requeres &quot;decissions&quot; with two, or more inputs.
<p>Very nice explanation.</p>
<p>Thank you :-)</p>
<p>There's something that makes me happy about making complex logic gates. So many great memories from school. </p>

About This Instructable



Bio: “Let the future tell the truth, and evaluate each one according to his work and accomplishments. The present is theirs; the future, for which I ... More »
More by Mudbud:Build a NAND gate from transistors Build a OR gate from transistors Build a AND gate from transistors 
Add instructable to: