Electronics Mini-Lab

From Course Wiki
Revision as of 22:42, 29 July 2013 by Steven Nagle (Talk | contribs)

Jump to: navigation, search
20.309: Biological Instrumentation and Measurement

ImageBar 774.jpg


Photo by Brendan Dolan-Gavitt

Objectives and Learning Goals

During the next lab exercise on measuring DNA melting curves, you will build and debug several electronic circuits. This mini-lab introduces you to the electronic test equipment and components you will use. A short answer-book style writeup is required. Items to include in your report are shown below in bold.

If you have a lot of prior experience with electronics, ask one of the instructors about substituting a mini-project for the mini-lab assignment.

Part 1:making a circuit; measuring voltage and current

In the first part of this lab, you will build the voltage divider circuit shown below. You will measure the output Voltage, Vout, and the current, i as a function of the supply voltage, Vin.

ElectronicsModuleFig-1.png
Vdivider Breadboard zoom.JPG
Resistive voltage divider circuit. Voltage divider on a breadboard.

Before you start building, use Ohm's law to analyze the circuit.

  1. Choose values for R1 and R2.
  2. Calculate the voltage, VO, and current, i, when the supply voltage, Vin, is 0, 2.5, 5, 10, and 15 Volts.
  3. Plot an I-V curve based on the calculated values

You can choose any resistor values you like, but there are a few practical constraints. The resistors in the lab range in value from 1 Ω to 10 MΩ. Within that range, manufacturers only produce certain standard values. Check the supply bins or this table to see which values are available.

Power dissipation in a resistor increases as the square of current, P=I2R. The rated power of the resistors in the lab is 1/4 Watt although you may discover that they can support a maximum of 1/2 Watt before failing. Between 1/4 and 1/2 Watt, the resistors may feel very warm to the touch and the resistance may no longer be within the manufacturer's specified tolerance. It is best practice to ensure that the power dissipated by R1 and R2 will not exceed the rated power.

The value of a resistor is encoded on its package by a series of color-coded bands. Through negligence or malice of prior classes, components occasionally end up in the wrong bin. Verify the value of each resistor you take from stock by reading the coded bands. Instructions for reading resistor markings are available at this website.

After you are done choosing component values and plotting the I-V curve, gather the components you will need to build and characterize the divider circuit:

  • a solderless electronic breadboard
  • resistors of the selected values
  • jump wires, or a few lengths of different colored wire and wire strippers
  • banana cables
  • a lab station with a working power supply and digital multimeter (DMM)

The specified tolerance of the resistors in the lab is 5% of the nominal value. Therefore, the resistances in the circuit you build will be somewhat different than the nominal values you analyzed. Use the DMM to measure the actual values of the resistors you pulled from stock. Record the actual values. By what percentage do the actual values differ from the nominal values?

The next few sections explain how construct the circuit on an electronic breadboard; power it with a lab power supply; and measure voltage and current with a DMM.

Solderless electronic breadboards

Most electronic components look like bugs. They have a central body with a bunch of gangly 'legs' sticking out called leads. The leads carry current from the outside of a component to its innards. One of the first challenges facing an aspiring circuit maker is how to get all the correct bugs-legs connected together whilst keeping the circuit robust and orderly.

There are many ways to build a circuit including printed circuit boards, wire wrap, stripboards, point-to-point soldered connections and solderless electronic breadboards. Solderless breadboards are a good choice and they are especially convenient for circuits that will need a lot of debugging. To mount and reconfigure components and connections, the builder will simply press a lead into a hole (or pull it out). No soldering, de-soldering is require. There is no need to wrap wire around a post or use any similar slow method. Two images of solderless breadboards are shown below.

ElectronicsModuleFig-BB.png
DNA circuit breadboard 20130722.JPG
Top view of a solderless electronic breadboard. Breadboard with three panels arranged side-by-side and additional bus strips at the top.

In the image on the left, the two central grids of holes on the breadboard are called the field while the column pairs on the left and right are called bus strips. You will build your circuit in the field, where components are mounted by pressing their leads into the holes. Spring-loaded contacts underneath each hole hold the leads in place and also provide an electrical connection. Most types of components are placed so they straddle the notch. Each hole accepts one wire or component lead.

The field is organized in rows called terminal strips to allow multiple connections to each component lead. In each terminal strip each set of five holes on either side of the notch are electrically connected. Connections between components placed on the breadboard are made by running jump wires between any hole in a set shared with one component lead and that shared with another lead. Furthermore, while holes A-E are connected, and holes F-J are connected, holes A-E are not connected to holes F-J. The notch provides a visual indication of this insulation, as well as space for the body of the component.

Recall that on the left and right side of the board there are two long columns of holes called bus strips. All of the holes in each bus strip are connected together. Bus strips are frequently used to distribute power to components on the board or to provide a common ground.

For prototyping larger circuits, several breadboards can be mounted together, as shown in the picture on the right. The ones in the lab have two or three smaller breadboards mounted side by side on a metal plate with additional bus strips running along the top. Banana terminals at the top of the board facilitate connections to the power supply via patch cords. The banana terminals do not connect to any point on the breadboard. Use wires to connect the terminals to the breadboard.

Here are a few guidelines for using electronic breadboards:

  • Route wires horizontally or vertically for the most part, making right-angle bends to change directions. This will keep the circuit neat and therefore easy to debug.
  • Use the right length of wire. The right length of wire connects points A and B while keeping the wire generally in contact with the surface of the breadboard.
  • Trim the ends of component leads to keep component bodies close to the board and to avoid contacting the bottom metal structure of the board, which can lose it's insulation and lead to a short circuit.
  • Use the bus strips to distribute power supplies and ground. As a favor to your instructors, please use the blue "-" bus strips for ground consistently, and the red "+" bus strips for both positive and negative 15 V power distribution. Our convention is to place components so that the #1 lead is at the top left. This places the -15 V bus strip on the left, and the +15 V bus strip on the right.
  • The exposed metal screws on the bottom of the banana connectors can short to the metal optical table. Use electrical tape on the bottom of the connectors to prevent a calamity.
  • When making wire connections to the banana terminals, make sure that only bare wire touches the terminal. Insulation under the screw terminal may cause an intermittent connection.
  • If you can't figure out whether two holes on the breadboard are connected, stick short wires in the holes. Use the resistance or continuity features of an electrical meter to check if they are connected.

There are a few downsides to breadboards. They have high interconnect capacitance and resistance. If you don't know why that's bad, pay attention in lecture the next few weeks and discuss with an instructor.

Power supply

Triple-output DC power supply with dual variable output (CH1 & CH2) and fixed 5V output (CH3).

The lab power supplies provide three voltage outputs. The (+) and (−) outputs have adjustable current limits and voltages up to ±20V can be set either independently, or together (using the mode buttons located between the paris of voltage and current knobs). While the POWER button at lower left applies power to the supply itself, the white OUTPUT button on the upper left enables power to flow to the outputs: always remember to turn this off or disconnect it when rewiring your circuits. There is also one fixed 5V output at the lower left. Use this output with care, as it's current has a very hight limit, noted below the terminals as 3 A.

For powering op-amp circuits, you will use the power supply in SERIES mode. In SERIES mode, the (+) output of CH2 is connected to the (−) output of CH1, so that CH1+ is the V+ power for the op-amps and CH2− is V− power and CH1− is ground (0V) for your circuit.

Note that the green GND connector is connected to the power supply chassis ground (or AC power ground); it is not ground for your circuit.



  1. Construct the circuit and connect it to the power supply with the banana cables.
  2. Measure VO and i with the supply to 2.5, 5, 10, and 15 Volts.
  3. Plot the measured values on the same set of axes.

Using the Digital Multimeter (DMM)

The multimeter serves as a voltmeter, ammeter, ohmmeter, as well as other functions. The black (negative) lead always plugs into COM while the red (positive) lead plugs into V/Ω for voltage and resistance measurements or into A for current measurements. The voltage and current measurement modes of the DMM are very different, so don't forget to reconnect the leads. The DMM has modes for measuring DC and AC signals. In DC mode, the meter reads the average value of the test signal; in AC mode, the meter reads the root-mean-square value of a time varying signal.


Measuring Voltage with the DMM

DMM serves as a voltmeter, ammeter, ohmmeter. Connect black lead into COM. Connect red lead into V/Ω for voltage and resistance measurements or into A for current measurements.
Measuring voltage across R2.
  1. Switch the DMM to voltage mode and make sure that the DMM test leads are plugged into the right connections (COM and V/Ω).
  2. Place the two leads across the terminals of R2.
  3. In voltage mode, the DMM has a very large equivalent resistance (ideally infinite) so that when placed in parallel with the circuit you are measuring, it will have minimum effect on the circuit under test.

To prove this: (a) Assume first that the effective resistance of the DMM is small, such as 100­. What is the combined resistance of the parallel combination of R2 and the DMM? (b) Now assume the DMM's resistance is something very large, like 10M­Ω. Now what is the resistance of the parallel combination of R2 and the DMM?

Why would a DMM in voltage mode with low input resistance be poor for voltage measurements? Hint: think about how it affects the voltage divider circuit in this case.

Measuring current with the DMM

Measuring current through R2.
  1. Switch the DMM to current mode and be sure the leads are plugged into the DMM COM and A connectors.
  2. Place the leads of the DMM in series with a device in the path that you want to measure. For this type of measurement you actually need to break the circuit and insert the DMM.
  3. What would you expect to happen if you reverse the leads of the DMM? Reverse the leads and see if you were correct.
  4. The input resistance of the DMM in current mode is very small, ideally zero. Why is it important for the effective resistance of the DMM to be small in current mode? Again think about the effect on the circuit under test.

Calculate the resistance of R2 using Ohm's law and the current and voltage you measured. Also determine the percent error in the nominal resistance value:

$ \epsilon = \frac{R_{exp}-R_{meas}}{R_{exp}} \times 100\% $

Is this within the tolerance value indicated by the color bands on the resistor?

Measuring resistance with the DMM

  1. Turn off power to the circuit, and disconnect the resistor you want to measure. This is important both in order to protect the DMM and because other parts of the circuit will affect the resistance you measure for one particular branch.
  2. Switch the DMM to resistance mode.
  3. Place the leads in parallel with the resistor of interest (in this case R2), as you did for the voltage measurement. Does this match your calculated resistance?

Assignments

Resistor i-v characteristics


HWassignment.jpg Assignment: The current-voltage (i-v) curve of a circuit element is simply a plot of the current through it as a function of applied voltage. In your lab notebook, sketch the i-v curve of the resistor you measured. What is the slope of this curve? (Ohm's law should make this very easy).


Photodiode v-i characteristics


HWassignment.jpg Assignment: Measure and plot the current-voltage relationship for a diode in the transition region from non-conducting to conducting.


Circuit for diode v-i measurements.

The circuit shown will be setup in the lab. It consists of a signal generator driving a diode in series with a 1k­Ω resistor. The scope should be set to "X-Y" mode with the diode voltage on the x-axis and the resistor voltage (proportional to the diode current) on the y-axis. The scope will then display the v-i curve.

  • Start by covering the window of a photodiode — with no light coming in, it is just a regular diode. Illuminate it to see its photodiode action.
  • Sketch the curve displayed or use the scope "acquire" function to save the data to a thumb drive.
  • For photodiode behavior, uncover the window of the device, and aim a Fiber-Lite illuminator at it. You should repeat the measurements you made at three levels of light intensity. You can now combine your data to produce four v-i curves for this diode at different light levels including the no-light condition. Plot these on the same graph to see how incident light affects diode v-i characteristics. You'll need this data for the Intro Electronics Lab Report.
The familiar divider circuit driven by an oscillator, with a voltage measurement across R2.

Time-varying signals and AC measurements

Generally, we refer to signals that vary with time as AC signals (alternating current, as opposed to DC - direct current). When we leave DC behind, the DMM we've used so far is no longer enough to observe what is happening. At this point, you'll need to get acquainted with the function generator and the oscilloscope, to generate and record AC signals, respectively. We'll also start making extensive use of BNC cables and connectors. First, let's look at how the resistive voltage divider with which you're already familiar behaves with AC signals. Build the divider circuit as you did previously, but use the function generator in place of Vin, and the oscilloscope in place of the DMM.

  1. Set the frequency to 5kHz, and the waveform to sinusoid with no offset.
  2. Set the voltage to 3V peak-to-peak (often written as 3Vpp). Verify that the voltage is set as you intend with the scope, since there are no markings on the knob.
  3. Connect the waveform to your circuit.
  4. Use the other channel of the scope to measure Vpp across R2. You can display both the input and output waveforms at the same time by using the scope's dual mode. Does this resistive voltage divider behave any differently at AC than it did at DC? What's the relationship between the output and input waveforms?

Now replace R2 with a capacitor in the 0.05-0.1 μF range. Again use dual mode on the scope to see both the input and output waveforms. Qualitatively observe what happens to the output as you change the frequency of the input. What kind of circuit is this?

Circuit for measuring "blue-box" transfer function.

"Black-box" transfer functions


HWassignment.jpg Assignment: Measure and plot the transfer relations (magnitude and phase) for several "black-box" circuits.


You'll find prepared for you several metal boxes with "mystery" circuits wired up inside, labelled "A" through "D". Your goal is to determine their transfer functions. Connect the waveform generator and oscilloscope to each "blue box" as shown with the waveform generator connected to both the input of the blue box and CH1 input of the oscilloscope and with the blue box output connected to CH2. Use the measure functions of the oscilloscope to measure Vpp of the input and output as well as the phase difference between the signals. Plot the ratio of the output to input versus frequency (as a log-log plot) and the phase vs frequency (as a lin-log plot).

Circuit Components

Symbols for resistors, variable resistors, and potentiometers in schematics.

Capacitors

An intuitive way to think about capacitor behavior is that they are reservoirs for electric charge, which take time to fill up or empty out. The size of the reservoir (the capacitance C) along with size of the pipe (intervening resistance between the voltage supply and capacitor) supplying the current determines how quickly or slowly. Circuits with capacitors in them have time- and frequency-dependent behavior. Capacitors act like open circuits at DC or very low frequencies, and like short circuits at very high frequencies.

Capacitors can be polarized or non-polarized. Polarized capacitors must always have the voltage applied to one terminal (the anode) positive relative to the other. One terminal or the other of a polarized capacitor is marked either + or − to indicate polarity. Polarized capacitors are typically used as bypass capacitors on power supply lines.

Diodes

Various types of diodes and their symbols in a schematic.

Diodes are non-linear devices. Diodes can function as an electronic "valve", as a light-emitter (LED), or a light-detector (photodiode). Diode as electrical "valve": In the simplest model, a diode acts as a one-way electrical valve — it behaves almost as a short circuit when a positive voltage is applied across it and as an open circuit with a negative voltage (reverse bias). For these reasons, diodes are frequently used in power supplies as rectifiers to convert alternating current (AC) to direct current (DC). As you might guess, this is not the whole story, and is only true for relatively large voltages. You will explore diode behavior in more detail, especially around the critical transition region near 0 volts. Photodiodes are optimized to work as a light detector by capturing photons and converting them to electrical signals. This happens when photons absorbed in the semiconductor generate electron-hole pairs. Run in reverse bias, the current out of the photodiode is linearly proportional to the light power striking the device. Light-emitting diodes (LEDs) are designed to output light when current passes through them. In this case, we have recombination of electron-hole pairs producing photons in the semiconductor. Light is emitted in forward bias, and power output depends on the current through the device.

All diodes exhibit breakdown when a large reverse voltage (typically > 50V) is applied, typically destroying the diode. Zener diodes however are designed to have a relatively low but precise breakdown voltage. These diodes are operated in reverse bias and are typically used as voltage references or limiters.

Operational Amplifiers

Basic non-inverting op-amp circuit.

In the upcoming lab module we will start using integrated circuits (ICs) known as operational amplifiers, or op-amps. They are an enormously versatile circuit component, and come in hundreds of special varieties, built to have particular characteristics and trade-offs. We will use some very common general-purpose op-amp, of which a typical example is the LM741.

Every op-amp manufacturer provides a datasheet for every IC they make, and you should always familiarize yourself with it. It provides information on everything from pin and signal connections, to special features, limitations, or applications of a particular IC. We have copies of the datasheets available on-line for the op-amps we used in the lab.

The pin assignments of the LM741 in a DIP-8 package.

Besides the (−) and (+) (inverting and non-inverting) inputs, an op-amp needs DC power connections, which is what enables it to be an active circuit element. These power connections are usually omitted on a schematic, but always shown on the datasheet. Typically ±15 volts is used, but you should check the datasheet to be sure.

Every IC has a marking on the package to indicate pin 1, and the datasheet shows the relative positions of the other pins. On the LM741 there is a dot near pin 1 (or a semi-circle on one end of the chip). NC on the datasheet stands for No Connection. Important: ICs are sensitive to static electricity discharges. Your body can easily store enough charge to damage an IC, especially on a dry winter day. To prevent this, always make sure to touch the grounded metal case of an instrument to dissipate the charge. Use caution when handling the chips.

Instruments

An SFG-2120 digital function generator.

Function Generator

A function generator generates signal waveforms for standard functions: sinusoids, triangles, square waves. The digital function generators in the lab generate waveforms at precise frequencies in the range from 0.01Hz to 10MHz, and amplitude range from about ±0.1V to ±10.0V. It can output waveforms with and without offset. Frequencies may be entered directly on the number keypad in units of Hz, kHz, and MHz or using the knob on the upper right hand side of the unit to change one digit at a time.

The Rigol digital oscilloscope.

Oscilloscope

An oscilloscope ("scope" for short) is designed for observing signal waveforms that change faster than can be usefully seen on a DMM. Most often, the signals observed are periodic, and the scope is effectively a "time magnifier" letting you stretch and compress the timebase (as well as the waveform magnitude) for convenient viewing. The oscilloscopes used in the lab are digital. Digital scopes are essentially special purpose computers which digitize the analog inputs and display the data on an LCD. Digital scopes perform many basic measurement tasks such as peak-to-peak, frequency, and phase measurements. Most functions are controlled via menus. Below is a brief description of the most important controls:

  • CH1, CH2 coax connectors: Signals connect to these via BNC cables.
  • CH1, CH2 buttons: Activates channel menu. Allows selection of DC or AC coupling.
  • Vertical Position knob: Changes zero position on display, shifting waveform up or down.
  • Vertical Scale knob: Changes scale for selected channel (volts per division).
  • Horizontal Scale knob: Changes time scaling (seconds per division).
  • Measure button: Activates measure menu. Allows selection of up to 3 quantities to display on screen such as Vpp, frequency, and phase.

You will get a feel for these as you use the instrument in lab. You'll notice that the scope only measures voltages — there are no modes for directly measuring current or resistance. It's also important to remember that scope measurements are always referenced to ground. The shield (black lead when using grabber wires) of the BNC connector is hard-wired to ground. This means you can't use just one channel of a scope to measure the voltage between two non-ground nodes in a circuit.