Lab 1: Building Logic Gates

In this lab you will use breadboards to build circuits. You will learn how to use a breadboard, decode resistors, use some of the tools built into our protoboards, and build two logic gates.

Groups

  • Jerry, Ryan, and Linda
  • Giang and Adam W.
  • Kamal and Adam H.
  • Charlie and Blake
  • Tanner and Eli
  • Sophie and Fengyuan
  • Jacob and Hamza
  • Theo and Bea
  • Ana and Hattie
  • Matt and Devin
  • Sara and Maddie

About the Protoboards

For most of the labs in this class, we will use the PB-503, sometimes called a protoboard. This board contains a large breadboard, a flexible power supply, and a variety of useful tools around the edges. The protoboard is pictured below:

An image of the PB-503

Components

We won’t use all of the parts of the protoboard in this class, but here is a quick overview of the elements of the board working clockwise from the upper left corner:

Power (upper left corner): This is the power switch for the entire board. The power supply and tools won’t work unless you turn this on. The switch should light up; if it doesn’t, you may not have plugged in your board or a fuse could have blown.

Power connections (top): This area includes a small breadboard for power connections, dials to control voltage, and a few connections for external tools. The small, wide white board is the piece you will use most often in this area. Each row of this board is connected to a different power source. Starting from the top row, the connections are +5v, +v (variable positive voltage, controlled by the left knob), -v (variable negative voltage, controlled by the rigth knob), and ground. We will only use the top and bottom rows in this class. Be careful not to use the other power sources or you may overload components.

Logic indicators (upper right side): This area has eight inputs connected to LEDs that show whether the input is at high or low voltage (1 or 0). You can connect the output of a circit here to check it, or connect a long wire to an input and poke various components with the other end to examine the state of a circuit at various points. The switches in this area should be set to +5v and TTL for use with the components we use in the class.

Speaker (lower right side): This is a speaker. You’ll have a chance to use it later in the semester.

BNC J2 (bottom right corner): This is an adapters that lets you connect to a BNC port, which is sometimes used for antennas and a variety of other components. We won’t use the BNC J2 area for this class.

SPDT Switches (right bottom row): These switches aren’t connected to anything by default, but you can use them in your circuits. When the switch is up, the connections to the middle of the switch are connected to the top of the switch. If the switch is down, the middle is connected to the bottom of the switch. Follow the white lines to see which wire connections go to which parts of the switch.

Potentiometers (bottom middle): A potentiometer is a variable resistor. Turning the knob changes the amount of resistance between the sides and middle connections of the wire connection area. We won’t use the potentiometer area for this class.

Logic Switches (left bottom row): Logic switches are like SPDT switches, except they only have a single connection. When the switch is up, the connection is at high voltage, and when the switch is down the connection is at low voltage. Make sure the logic switches are set to +5v and not +v or you may overload components.

BNC J1 (bottom left corner): This is another copy of the BNC connection in the lower right. We won’t use the BNC areas for this class.

Debounced Pushbuttons (lower left side): Pushbuttons close (connect) a switch only while the button is being held down. Some buttons have a tendency to “bounce,” where the connection flickers on and off and on again. These buttons are “debounced,” so they tend to turn on and off smoothly instead. We won’t use the debounced pushbutton area for this class.

Function Generator (upper left side): This area generates a signal output that fluctuates between low and high voltage. The sliders control the frequency and amplitude of the change. Other switches control the pattern of voltage changes and scale for frequency and amplitude. We won’t use the function generator area for this class.

Breadboard (middle): The last and most important area of the protoboard is the breadboard in the middle. Breadboards help you build circuits quickly without soldering; this means you can try things quickly, there are no wasted materials, and luckily no burns or toxic fumes! To use a breadboard, you just push a wire into a hole. The board contains some hidden “wires” that help you make connections. We have a larger breadboard with six separate areas. Effectively, this larger breadboard has two rows of three smaller breadboards joined together. These smaller breadboards are wired like this:

Photo of front and back of a breadboard

The left and right sides of each board have columns you should use for power and ground, although these columns are not connected to anything by default. The remaining pins in the middle are connected in rows. Rows on opposite sides of the “channel” are not connected. This will be useful for using ICs in next week’s lab. To make a connection between two wires, just plug both wires into holes that are in the same row on the same side of the channel. To connect to power or ground just plug the wire into the appropriate column.

It is conventional to use red wire to attach to power (+5V) and black or blue wire to attach to ground. We don’t have many black wires available, but it would still be good to use some dark color for connecting to ground.

Resistors. The color bands around the resistors indicate their resistance. A quick Google search on resistors should turn up a nice explanation, and there is a resistance color guide in your toolbox. We have two sizes of resistors in the lab:

  • 150Ω: brown-green-brown-silver
  • 15KΩ: brown-green-orange-gold

Note that the background color of a resistor is not meaningful.

LEDs. Since these are diodes, they must be inserted in your circuit with the correct orientation. Connect the longer lead toward +5V and the shorter lead toward ground.

Transistors. The leads on a transistor are arranged like this:

Top-down view of a transistor with collector, base, and emitter from top to bottom on the right edge

Wires. A couple of tips about choosing wires for your ciruit. Using short wires is good: if your wires are longer than necessary, you will find that the excess gets in the way. Keeping the wires sorted by size will help you and others using your station find the ones you need next time.

Exercise 1

Build the circuit below on your protoboard. It may be easier to use a logic switch, which combines the switch an +5v connection into one component, rather than an SPDT switch with a long wire to +5v. Remember that only the connections in the circuit matter, not the layout. You probably will not be able to replicate the layout from this diagram.

Circuit diagram for exercise 1

Do you expect to find high or low voltage at points A and B? Use the logic indicators and a long wire to test your guesses.

If neither high nor low lights up on the logic indicator, you have identified a voltage somewhere between high and low. You can verify this by switching the logic indicators to +V and turning the +V dial at the top of the board down. Eventually the high light should turn on, meaning there is some voltage here but not the full 5 volts. Why would the voltage be lower here?

Show your circuit to me or a class mentor before moving on to the next exercise.

Exercise 2

What do you expect the voltage to be at points A, B, and C when the switch is on? What about when the switch is off? What kind of logic gate do you think this is? Make a note of your predictions before building the circuit.

Circuit diagram for exercise 2

Use the logic indicators to check the voltage at each labeled point and compare these to your predictions. Could you tell which kind of circuit this was? How did you know, or how will you remember in the future?

Before you move on to the next exercise, please show your circuit to me or a class mentor.

Exercise 3

Build an AND gate using two NPN transistors. You are welcome to use logic switches, but don’t forget the resistors before the transistors! If you connect a transistor directly to +5v is may burn out and stop working.

Show your circuit to me or the class mentors before moving on.

Exercise 4

Build an OR gate using two NPN transistors. Again, don’t forget the resistor circuit in front of each transistor’s base wire.

Show your circuit to me or the class mentors when you are finished. Nice work!