Electronics Mini-Lab

From Course Wiki
Revision as of 16:06, 5 August 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 and characterizing a resistive voltage divider circuit

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

Analyze the circuit

Before building the divider circuit:

  1. Choose values for R1 and R2.
  2. Calculate the voltage, Vo, and current, I, when the supply voltage, Vi, 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 maximum power rating of the resistors in the lab is 1/4 Watt. Ensure that the power dissipated by R1 and R2 is less than that.

Prepare to build the circuit

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 to properly connect all the bugs' legs whilst keeping the circuit robust and orderly. Of the various options, solderless breadboards are convenient for circuits that frequently need to be debugged.

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

In the image on the left, the two central grids of ti points on the breadboard are called the field. The column pairs on the left and right are called bus strips. Bus strips are frequently used to distribute power to components on the board or to provide a common ground. Build your circuit in the field by pressing component leads into the tie points. Spring-loaded contacts within each tie point will hold the lead in place and provide an electrical connection. Most types of components are placed so that they straddle the notch. Each tie point accepts one wire or component lead.

The field is organized in rows, called terminal strips, to allow multiple connections to each component lead. Within a 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 tie point in a set shared with one component lead and that shared with another lead. In other words, tie points A-E are connected, and tie points F-J are connected, while tie points A-E are not connected to tie points F-J. Banana terminals facilitate connections to the power supply via patch cords. The banana terminals do not connect to any tie points 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 will be the shortest length of wire that satisfies the previous guideline.
  • Trim the ends of longer component leads on resistors and capacitors to keep component bodies close to the board and to avoid contacting the bottom metal structure of the board. The board 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. Cover them with electrical tape to prevent a calamity.
  • When making wire connections to the banana terminals, be sure that only bare wire touches the terminal. Insulation under the screw terminal may cause an intermittent connection.
  • If you are unsure whether two holes on the breadboard are connected, insert short wires in the holes. Use the resistance or continuity features of the DMM 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 over the next few weeks and discuss with an instructor.

Gather components to build the divider circuit:

  • the solderless electronic breadboard
  • a lab station with a working power supply and digital multimeter (DMM)
  • jump wires, or a few lengths of different colored wire (located near the breadboards)
  • wire strippers (located in your lab station drawer)
  • banana cables (located on the West wall)
  • resistors of the selected values (located on the bench at the North wall)

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.

The manufacturer's tolerance for 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.

Measure the resistors with the DMM

A 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.

The DMM serves as a voltmeter, an ammeter, an ohmmeter among other functions. The black (negative) lead always plugs into COM at the bottom of the meter 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.

  1. If you've read ahead and already connected power to your circuit, turn it off.
  2. 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. You may find it convenient to insert the resistor across the notch in an unused portion of the field. This will make it easier to make firm contact between the resistor leads and the DMM leads.
  3. Switch the DMM to resistance mode, which is labeled with a Ω
  4. Place the DMM leads in parallel with the resistor of interest.
  5. Read and record the value on the DMM.

Do they match your chosen resistances? By what percentage do the actual values differ from the nominal values?

Complete the circuit

Jump wire may be found in small boxes on the bench where you found the breadboards. There is also a larger box of wire pieces that you may wish to use. If you find no wire to your liking, there are also spools of wire on the right end of the bench.

Place the components on your breadboard and use the jump wire to connect the leads of your resistors to the bus strips (and possibly to each other). As a guide, you may use the picture of a voltage divider on a breadboard (above). Feel free to build the circuit as you wish while following the guidelines in the section describing the breadboard. You may also wish to connect the vertical bus strips to the horizontal red and blue bus strips, and connect those to the (+) and (-) 15 V power terminals on the breadboard, respectively.

Connect the 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. Connect the power supply to the breadboard 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.

Measure voltages with the DMM

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. In the Electronics Mini-Lab you will use DC mode, which is labeled with a solid line above a dashed line.

ElectronicsModuleFig-2.png
Pic of connection
Show realistic DMM model. Schematic showing how to measure voltage across R2. Actual connections to measure voltage across R2. The voltage drop across a component is measured from the red, connected to the socket, to the black lead, connected to the COM socket.
  1. Switch the DMM to DC voltage mode and connect the DMM test leads properly: Insert black in COM and red in .
  2. Make firm contact with the two leads across the terminals of R2.
  3. Record the resistance shown on the DMM.
  4. Record the uncertainty of the measurement.
  5. Quantitatively predict the change in the measurement if the DMM input impedance were 10 kΩ?

Measure current with the DMM

ElectronicsModuleFig-3.png
Pic of current measurement connection
Show realistic DMM model.Schematic showing how to measure voltage across R2. Actual connections to measure current through R2 and R2. Positive current is measured into the red lead, connected to the A socket of the DMM, and out of the black lead, connected to the COM socket.
  1. Switch the DMM to DC current mode and connect the leads as shown in the figure.
  2. Place the leads of the DMM in series with the circuit loop.
  3. Record the current through your circuit at each input voltage in units of mA.
  4. For the highest voltage, quantitatively describe the effect of increasing the input impedance to 10 kΩ.
  5. Calculate the resistance of R2 using Ohm's law and each of the currents and voltages that you measured.
  6. Calculate the percent error in the measured resistance values.
  7. Compare to the tolerance value specified by the manufacturer.


HWassignment.jpg Describe format for submitted solution.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).


Part 2:making and characterizing a filter circuit

RC filter circuit schematic. RC filter on a breadboard.

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.

The familiar divider circuit driven by an oscillator, with a voltage measurement across R2.

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.

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.

  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?

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.

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?

Part 3:identifying unknown filter circuits

RC filter circuit schematic. RC filter on a breadboard.
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).

Part 4:characterizing a photodiode

RC filter circuit schematic. RC filter on a breadboard.

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.

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.


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


Circuit Components

Operational Amplifiers

Move this material to DNA Lab Manual

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.