20309spring 2001

download 20309spring 2001

of 206

Transcript of 20309spring 2001

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    Homework Set 1 Due by 12:00 noon on Friday, Sep. 22, 2006 in 16-352.

    1. Figure 1 shows a resistor network known as a Wheatstone Bridge, which will be part of apparatus that youll build shortly for the DNA melting curves module. You can read a bit more about it in the handout for that module. For now, we will look at it analytically. Rx is a resistance you are trying to measure, and R3 is a variable resistor.

    Figure 1: A Wheatstone bridge circuit.

    (a) Assuming R3 is set such that the bridge is balanced (i.e. Vab = 0), derive an analytical expression for Rx in terms of R1, R2 and R3.

    (b) Now let R3 also be a xed value, and suppose that Rx varies in a way that makes Vab nonzero. Derive an expression for the dependence of Vab on Rx

    2. Referring again to the Wheatstone Bridge in Figure 1, suppose that Rx varies with some physical parameter (strain, temperature, etc.) in the range of 1-10k. You want to use the circuit to measure the physical variable by observing Vab and correlating it to the resistance changes. In what range should the values of R1, R2 and R3 be to make a sensitive measurement? Explain your reasoning. (Hint: using matlab to plot the output as a function of the varying resistances is a very useful way to think about this problem).

    3. Photodiode i-v characteristics: Using the data that you collected in the lab for the photodiode, generate 3-4 i-v curves for a photodiode at dierent light levels (including in darkness). Plot these on the same graph to see how incident light aects diode i-v characteristics.

    Give a brief (qualitative) explanation for why photodiodes are best used in reverse bias?

    4. Transfer functions: For the black boxes that you measured in the lab, determine what kind of circuit/lter each one is (two of them will look similar, but have an important dierence - what is it?). Determine a transfer function that can model the circuit, and t the model to the data to see whether the model makes sense.

    Of the four boxes, D is required, and you should choose one of either A or C. You can t B for bonus credit.

    (over)

    1

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    5. Referring to the circuit shown in Figure 2, what value of RL (in terms of R1 and R2) will result in the maximum power being dissipated in the load?

    (Hint: this is much easier to do if you rst remove the load, and calculate the equivalent

    Thevenin output resistance RT of the divider looking into the node labeled Vout. Then

    express RL for maximal power transfer in terms of RT .)

    Figure 2: A voltage divider formed by R1 and R2 driving a resistive load RL.

    6. Consider the op-amp circuit shown in Fig. 3.

    Figure 3:

    (a) Determine an expression for the output voltage of the circuit with respect to a DC current input. Express your answer in Vout/Iin.

    (b) Since this is such a high-gain circuit, it can be quite noisy, if the input current Iin experiences high-frequency uctuations. You can insert a capacitor across one of the resistors to reduce the noise (i.e. make a low-pass lter to eliminate high-frequency content). Where would you insert it, and how would you choose its size?

    (c) Now write down the expression for this new circuits output with respect to the current input for AC signals (Hint: in the expression from part (a), substitute the parallel combination Rx C for the resistor Rx that you chose).

    2

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    Homework Set 2 Due by 12:00 noon on Wednesday, Oct. 11, 2006

    Here we will look at power spectra in matlab, and some issues associated with discrete-time Fourier analysis. You should save your matlab code in an m-le, which will make it easy to modify and reuse it, and submit your m-le along with your plots.

    Remember, when in doubt about any of the matlab commands given below, use the help command to get info about how to use each one the Windows installation of matlab will have this same info and more accessible via the Help menu.

    1. Use matlab to generate a time vector y(t), approximately one second long, with a sampling frequency fsamp of a few kHz (the syntax vector=start value:increment:end value; will be useful here increment is the time between your samples or 1/fsamp). Then create a sinusoid based on that time vector choose a frequency fSIN of a few hundred Hz:

    y = sin(SIN t) = sin(2fSIN t)

    Calculate the PSD of your sinusoid using the pwelch 1 command, and plot it on a linear scale and a logarithmic scale; use the plot and loglog commands, respectively. What is the signicance of the highest and lowest frequencies that appear on the plot?

    2. An important feature of pwelch is that it always correctly normalizes the total power of the PSD, butdepending on the parameters you useyou can get quite dierent PSD shapes for the same signal. For example, the default parameters give a lot of spectral leakage. To see a low-leakage spectrum, try running pwelch with the nfft and window parameters satisfying the following conditions:

    - the sinusoid frequency fSIN is an integer multiple of the quantity fsamp/Nfft

    - window is the same length as nfft.

    Can you suggest what causes spectral leakage? Plot the low-leakage PSD on the same axes as your previous linear and log plots (use hold after plotting one waveform to freeze a gure, before plotting a second). Considering the relative magnitudes, how much does the leakage matter?

    3. Recall that one of the consequences of Parsevals theorem is the following relationship between a time-domain signal f(x) and its PSD F ():

    f(x)2

    =

    F ()d. 0

    Verify that this is the case for the sine wave youve been using by computing its mean-square value in the time domain, and the integral of its PSD in the frequency domain (matlabs var and sum functions will be useful here). Remember that youre eectively calculating an area, and make sure that units match up: pwelch gives you the PSD in units2/Hz, while the integral of your PSD needs to be equal to a mean-square value (units2).

    The syntax is [PSDvect, freqvect]=pwelch(signal,window,n overlap,nfft,f samp) and only requires you to supply a signal vector and a number for f samp to properly scale and calculate the frequencies for the PSD i.e. pwelch(signal,[ ],[ ],[ ],fsamp) will get you a result. The result is stored in the two vectors before the = sign. Use matlabs help to nd out what the other parameters do. For parameters that you leave out by entering [ ], matlab uses its defaults (also found in help).

    1

    1

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    4. Now use the randn command to generate a noise signal with the same length as your time vector. Calculate its PSD with the pwelch parameters of your choice, and plot it on a new log plot. To observe the benets of averaging, generate a noise signal that is 10 longer in duration, calculate its PSD, using the same pwelch parameters, and plot its spectral density on the same plot.

    5. Take the sinusoid from part (a), but with its amplitude reduced tenfold, and the rst (short duration) noise signal from part (d), and add them together. Look at a section of the summed waveform in the time domain - can you nd the sine wave at all? Now plot the PSD of the combined signal - can you nd the sine wave peak in the noise? What can you do to get it to resolve more clearly? (Part (d) should provide a clue.) Plot your result on the same axes.

    6. (BONUS) Finally, take the original sinusoid from (a), compute its Discrete Fourier Transform using the fft command, and plot its magnitude (an FFT is complex-valued) on a semi-log plot (see the semilogy command). Compare this to the PSD of the sine wave given by pwelch, and comment on the FFTs features: Why two peaks? What is the meaning of its x-axis values? Why are the values along the y-axis so large?

    2

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    Homework Set 3 Due by 12:00 noon on Friday, Nov. 3, 2006

    This is a hybrid lab/homework set. It will count as a homework, and be graded accordingly, but most of the work should be done in the lab. Feel free to work outside the lab, if you have access to matlab with the image processing toolbox. However, you will nd it useful to get help and advice from instructors. Denitely dont put o working on this until the night before you will not be able to nish.

    1 Objectives

    1. Learn to use matlab to manipulate image les in a variety of formats, sizes, and resolutions.

    2. Explore several dierent image processing techniques, and learn to improve images with them.

    3. Extract quantitative data from images.

    4. Prepare some analysis/processing algorithms for future experimental modules.

    2 Image Files

    All the image les you will use in this lab can be found on the lab PCs in the C:\BioInst\imgproc directory. They are of dierent sizes, le formats, and aspect ratios. Here we will only work with grayscale les (one channel of intensity data), but the techniques generalize for working with color (three or four channels).

    3 Guidelines and Hints for Image Processing in MATLAB

    As usual in matlab, your best resource is its Help function. Specically for this lab, youll want to start by opening Matlab Help (Help Matlab Help), and browsing through the Image Processing Toolbox help les.

    3.1 Image Input/Output and Manipulation

    Below are a some commands for opening, displaying, and writing image les, for which Help will provide the details. Pay attention to the numerical data type of these images when matlab imports them (the workspace window will be key here) you may need to inter-convert between types.

    imread is used to load image data from a le. The basic syntax is A = imread(filename), with the image data from the le ending up stored in matrix A.

    imshow displays the data of an image le in a matlab gure window. You can do it either without loading it into the matlab workspace, or when its present in the workspace and assigned to a variable.

    imwrite writes image data to a le, in a format that you specify. The basic syntax is imwrite(A,filename).

    aviinfo returns the header information about a movie le in .avi format

    aviread(filename, 1) reads one frame of the avile into a Matlab movie structure. If f is the movie structure, you can assign the image data of that frame to a matrix A using the command A = f.cdata.

    1

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    3.2 Other Useful Commands

    The details of how these work will be important for you to explore on your own, with the help of matlaband the instructors. Be aware that the list below is by no means exhaustive or exclusive you may not use every command on the list, and you should explore other commands you nd to be relevant that may not be listed here.

    fft, fftshift, imhist, histeq, imadjust, conv, conv2

    4 Image Processing Problems

    1. Optimize the contrast for visualization of the microscope image on the left below, (dark actin.jpg) taken at too low a light level.

    2. Create a 33 and a 55 low pass lter. Apply these lters to remove noise from the cell image on the right above (noisy actin.tif). Can you make a 77 lter also?

    3. Generating a long integration image using a CCD camera sometimes produces large intensity spikes due to cosmic rays. Try to remove the noise from the image spiky actin1.tif. Can you develop a dierent method to remove the spikes if you have two pictures taken one after the other (spiky actin1.tif, spiky actin2.tif)?

    4. Perform a segmentation to isolate the region corresponding to the actin stress bers in the image actin f.tif. Also perform a segmentation to isolate the region corresponding to clustered actin in a cell with a chemically disrupted cytoskeleton actin treated.tif. The output of both tasks should be binary images corresponding to the desired regions.

    (BONUS : can you devise a quantitative metric to quantify the degree of ber-ness of the cytoskeleton?)

    2

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    5. You have two images of a test pattern consisting of light and dark line pairs with a spacing of 18 line-pairs per millimeter (HiMag.bmp and LowMag.bmp). This test pattern was imaged with a home-built microscope at two dierent magnications. Calculate the magnication dierence between these two images.

    6. Periodic noise often occurs in biological imaging high noise.tif (below, left) & low noise.tif (below, center). Can you remove the noise if you know the (normalized) noise characteristics (noise.tif - below, right)?

    Consider a case in which you do not know the noise characteristics. Can you clean up the image below (ecoli noisy.jpg)? (For bonus credit, feel free to work on any AFM images of your own that youd like to similarly clean up.)

    7. You are given a movie le (beadtest.avi) of a uorescent bead in the cytoskeleton of the cell. Choose any bead in the image. Can you nd the centroid of the bead as a function of frame number?

    Note: If you are having trouble opening the bead movies on your home computer and need a codec, it can be downloaded from the LEAD Multimedia Website (http://www.leadcodecs.com/ Download/eval.htm). Select the "LEAD MCMP/MJPEG Video Codec" on the left column and install with the evaluation version.

    3

  • 1

    20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    Homework Set 3.5 Sensitive optoelectronic detectors: seeing single photons

    Due by 12:00 noon (in class) on Tuesday, Nov. 7, 2006. This is another hybrid lab/homework; please see Section 3.4 for what you need to turn in.

    Contents

    1 Objectives 1

    2 Background 2

    2.1 Photomultiplier Tube (PMT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    2.2 Noise Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2.2.1 Photon Shot Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2.2.2 Electron Shot Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2.2.3 Johnson Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    3 Experimental Procedures 4

    3.1 Hardware set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    3.2 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    3.3 Experiment Roadmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    3.4 Data Analysis and Deliverables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    Objectives

    1. Understand the principles of operation of photomultiplier tubes (PMTs).

    2. Build signal conditioning electronics to capture and detect the optical signal generated by a photomultiplier tube.

    3. Observe single-photon events with the detector.

    4. Understand some of the noise characteristics of the PMT-circuit system as aected by light level and gain.

    1

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    2 Background

    2.1 Photomultiplier Tube (PMT)

    For low light-level detection and measurement, you cant beat the photomultiplier. This clever device allows a photon to eject an electron from a light-sensitive alkali metal photocathode. The photomultiplier then amplies this feeble photocurrent by using a high voltage to accelerate the electron onto successive surfaces (dynodes), from which a cascade of additional electrons is easily generated (Figure 1).

    This use of electron multiplication yields extremely low-noise amplication of the initial photocurrent signal. The nal current is collected by the anode, usually run near ground potential.

    Figure 1: Principle of PMT operation: a high negative voltage applied to the photocathode acceler-A PMT is a linear device in the sense

    that the current output is proportional to the ates electrons down the dynode chain. light power incident on the photocathode. The PMT we use in this lab is a Hamamatsu R7400P, which has a photocathode sensitivity of 60 mA/W (recall that a photons energy depends on its wavelength our LEDs light is approx. 565nm). The gain of the dynode chain depends on the applied accelerating voltage. The overall anode sensitivity is the product of the photocathode sensitivity and dynode chain gain (Table 1 provides a summary, and the PMT data sheet has more detail).

    PMT voltage (V) dynode chain gain total sensitivity (A/W) 500 3 104 1.8 104 800 106 6 104

    Table 1: PMT gains at two operating voltages.

    Due to its high sensitivity, a PMT can be used to observe individual photoelectron events. At low light levels, this is typically done by following the PMT with charge-integrating pulse ampliers, discriminators and counters. In this lab, we will simply observe them visually on an oscilloscope.

    At higher light levels, the individual photoelectron current becomes too high, so you measure the anode current as an analog quantity instead.

    Note: A powered PMT should never be exposed to ordinary light levels. A PMT that has seen the light of day, even without power applied, may require 24 hours or more to cool down to normal dark-current levels. More on this later.

    When compared to photodiodes, PMTs have the advantage of high quantum eciency while operating at high speed. This makes the PMT particularly well-suited to biological imaging applications where small numbers of uorescent molecules are observed on very short time scales. The main disadvantages of the PMT are its large size and need for a stable high-voltage source.

    2

    Dynodes

    etc.

    Anode

    Dynodes

    Photons

    Photocathode

    Figure by M IT O C W.

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    2.2 Noise Sources

    2.2.1 Photon Shot Noise

    An electric current is the movement of discrete electric charges, not a smooth uid-like ow. Likewise, incoming light energy is quantized into the packets we know as photons. The nite-ness of the quantized photons and electronic charges results in statistical uctuations of the resulting current. This is referred to as photon shot noise. If the charges act independently of each other, they follow Poisson statistics, and the current uctuations are given by

    IES = 2qIdcB , (1)

    where q is the electron charge, and Idc is the steady-state RMS current, and B is the measurement bandwidth in Hz. The assumption of independence of individual electron movement is true for electrons crossing a barrier such as electrons excited by single photons at the cathode of a PMT (An important exception is in metallic conductors, where there are long-range correlations between charge carriers).

    2.2.2 Electron Shot Noise

    In the absence of light, due to thermal excitation, electrons are occasionally generated at the cathode or one of the dynodes. These electrons will be accelerated through the circuitry and generate a current pulse similar to the eect of an incoming photon. However, because many of these dont propagate down the entire dynode chain, the current pulse from the dark electrons tends to be lower in amplitude. This current is typically in the neighborhood of 30 counts per second per square centimeter of cathode area.

    The current generated in the photomultiplier tube in the absence of light is called the dark current. As a noise source, it is the uctuation amplitude of the dark current and not its DC value that presents a problem. Similar to photon shot noise, the electrons generated spontaneously in the photomultiplier tube also follow Poisson statistics and the RMS noise is given by Equation 1 where Idc is the steady-state RMS dark current.

    2.2.3 Johnson Noise

    Any resistor just sitting on the table generates a noise voltage across its terminals, which arises from the random thermal motion of electrons within it. This is known as Johnson noise, and has a at power spectrum having equal power density at all frequencies (youve also heard it described as white noise). The actual open-circuit noise voltage generated by a resistance R at absolute temperature T is given by

    VJ = 4kBTRB , (2)

    where kB is Boltzmanns constant. Note that VJ is the RMS magnitude of the noise signal we measure; the actual signal uctuates in time with a Gaussian probability distribution.

    The signicance of Johnson noise is that it sets a lower limit on the noise voltage in simple resistive circuits. The resistive part of a source impedance generates Johnson noise, as do the bias and load resistors of an amplier.

    3

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    3 Experimental Procedures

    3.1 Hardware set-up

    The apparatus for this lab consists of an enclosed tube containing an ordinary diuse green LED pointed at a PMT as shown schematically in Figure 2.

    Figure 2: Experimental setup.

    The PMT end of the tube has two connectors, labeled HVin and Iout which are the high-voltage input from the power supply and the output anode photocurrent, respectively. This photocurrent will be amplied using a by-now-familiar transimpedance amplier, which you can build as shown in Figure 3. Use an LF411 op-amp, and 15 V supplies, as usual. Choose Rf and Cf values to give a DC gain of Vout/iin = 2 106 V/A and a time constant of 200 s.

    Figure 3: Transimpedance amplier circuit.

    4

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    3.2 Software

    The LED light source is driven from the computer DAQ system. (Why does this work for this experiment, but would not work for e.g. the blue LEDs in the DNA melting experiment and we needed a separate power supply?)

    The output of the transimpedance amp is read by LabVIEW and observed on the screen shown in Figure 4. You should also connect this same signal to an oscilloscope for easier direct observation.

    The LabVIEW panel is very simple. You can set the data sampling rate and number of data points to acquire, the data input and output channels (easiest to leave at the default value of 0), and the input limits. A word about these limits: they determine the digital that LabVIEW can see, and therefore the minimum signal level that youll be able to read. Experiment with changing these to achieve better resolution at low signal levels.

    Finally, the slider bar at the bottom, and the corresponding entry box to its left set the voltage being applied to the LED.

    What youll want to record are the Signal Mean and Standard Deviation values that Lab-View calculates from the signal waveform. These represent the photocurrent from the PMT and its noise, and this is what well study a bit more quantitatively.

    5

    Screenshot from LabVIEW software removed due to copyright restrictions.

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    3.3 Experiment Roadmap

    1. With the PMT HVPS at 800 V, and no LED drive voltage applied, observe the output of your amp circuit on the oscilloscope. Predict the character and magnitude of the amplier output signal for the following:

    (a) A single photon hitting the PMT

    (b) The PMT dark current

    (c) Pure Johnson noise

    Which of these can you see on your scope? Discuss with

    2. Now observe the mean amplier output signal and standard deviation as you increase the drive voltage on the LED. Remember that LEDs have a characteristic turn-on voltage, at which slight changes in voltage produce large increases in current, and light output. Youll see this eect beginning at about 1.5 V.

    3. Record the mean and standard deviation values for various input voltages (in particular around the turn-on transition of the LED).

    4. Change the HVPS to -500V and repeat the observations in items 1. and 2. above.

    5. Reduce the amplier gain to 1.5 106 V/A while maintaining the same time constant and keeping the PMT supply voltage at -500V. Similarly to item 3. above, collect mean and standard deviation data.

    3.4 Data Analysis and Deliverables

    The key step here is to convert the signals you recorded (in volts), into units of photons per time constant. You can do this by tracing out the various signal-conversion steps that take place (photocathode, dynode chain, transimpedance amp) and noting the gain or amplication factor for each. Keeping track of the physical units via dimensional analysis is very useful here.

    Once you have performed the conversion, the following two plots and associated explanation are all youll need to turn in:

    1. Plot the noise level (in units of photons per time constant) versus the signal level (same units) on a log-log scale for both the -500 V and -800 V supply voltages.

    Compare the situations at -800 V and -500 V and briey discuss in a few sentences:

    (a) Explain the shape and slope of each curve, and what it tells you about the origin of the noise observed? Can you see the noise oor for the measurements? If so, what is the source of the noise? (Johnson noise? shot noise?)

    (b) How does the noise characteristic change between -800 V and -500 V? What types of noise are observed in each case?

    2. Finally, if youve been paying attention, youll notice that something is not quite right about the two noise plots relative to each other at -500 and -800 V (what is it?). This is because the PMTs have actually seen too much bright light, and are no longer able to reach their design-specied gain at -800 V. Using these plots (assuming the -500 V gain is correct), try to determine what the actual dynode gain is at -800 V.

    6

  • 20.309: Biological Instrumentation and Measurement Laboratory Fall 2006

    20.309 Lab Guidelines

    Welcome to 20.309 Lab! Were excited to have you join us, and all the teaching sta are very much looking forward to a new semester. Much about 20.309 is new this year, so its likely that we havent thought of everything. When something does not make sense, ask!

    1 Safety

    In any laboratory, there is potential for injury if certain common-sense practices are not followed. In 20.309 this is minimal, but its still important to follow a few basic rules.

    1.1 Electrical Safety

    Electrical injuries happen when large amounts of electrical power are dissipated by the body. Most often, this happens in high-current situations, which is why you always hear that its not the voltage, its the current that is dangerous. Strictly speaking, both are dangerous, and its a good idea to avoid becoming a current path.

    In 20.309, we will work with only low-power electronics, and nothing we do is likely to cause injury. However, some common-sense precautions, are in order:

    dont connect supply voltages directly to ground dont touch any current-carrying conductor with your bare hands

    These simple rules will keep you from injuring yourself and damaging circuit components. Some components will have maximum power ratings that should not be exceeded, so pay attention to these values.

    1.2 Laser Safety

    We will use three laser systems in this lab that are considered Class III and therefore require vigilance and caution during use. You will receive an introduction to laser safety at the beginning of the lab, and a reminder about proper safety procedures before each of the relevant lab modules.

    The three laser types are:

    1. 2mW red laser diode with =635nm (AFM)

    This is a Class IIIa laser, and will only damage your eye if you spend prolonged periods of time (many hours) staring at the beam. We do not require safety eyewear. The beam will be well-contained in the apparatus.

    2. 5mW green laser pointer with =532nm (uorescence microscope)

    This Class IIIb laser is the most dangerous type we will use, because the beam is unconstrained, and you can aim the pointer anywhere while you are building your uorescence scope. The beam is strong enough to injure your sight, particularly because the human eye is most sensitive to green light. Safety eyewear will be provided to you, and you are required to wear it at all times, while you or anyone else in the lab is building their uorescence scope. In addition, whenever working with these lasers, you must turn on the blinking laser safety sign near the door, to warn others that laser work is going on.

    1

  • 3. 175mW NIR diode lasers with =975nm (optical traps)

    The hazards of this Class IIIb laser come from its higher power level, and because it is invisible, making it harder to be aware of its location/direction. The beam will be largely constrained in the apparatus, and you will not need to make adjustments that might put you in the beam path. Safety goggles will be available, but not required. Please also switch on the blinking door sign.

    In general, other important things to keep in mind:

    Always know the path of the beam, and keep any body parts or reective items (rings, watches, etc.) out of the beam path.

    Always read the pre-labs and know what special precautions you need to take associated with lasers or optics.

    When in doubt about doing something, dont do it before checking with the lab instructor. You will sometimes view scattered light from the AFM laser through a stereo-microscope this is safe as long as the duration is less than eight hours.

    1.3 Chemical Safety & Biosafety

    Though there is minimal wet work in 20.309, please do not bring food or drink into the lab. The electronics will appreciate it, and we will also later be handling some bacteria and uorescent dyes. When needed, latex gloves will be provided, as well as proper containers for disposing of chemical/biological waste and sharps. Please make sure to wash your hands with soap and water after removing gloves and before leaving the lab. Please report any spills or injuries to the lab instructor immediately.

    2

  • 2 Lab Notebooks

    To record the experiments and measurements you carry out, each of you will keep a lab notebook.

    A lab notebook is one of the key ways that researchers record, organize, and share the work they do. Lab notebooks in research laboratories are the property of the lab itself, and sometimes can serve as legal documents in intellectual property questions and patent disputes. Its therefore important that a lab notebook be complete, organized, and clear. While there isnt necessarily one correct way to keep ones lab notebook, its important to develop good habits from the start, so below are a few helpful guidelines.

    Permanence - Use pen to keep records in your lab notebook. Any photos, print-out graphs, or pages that you add should be taped or stapled in so they dont fall out.

    Completeness - One of the main purposes of keeping a lab notebook is so that you, or another researcher in your eld, can repeat your experiments. Record your experimental procedures and goals, any special techniques or protocols you develop or use, and conclusions you make from your data. All data you collect should be recorded directly into the notebook (NOT copied in later from loose bits of paper). Also, write in any calculations you make or key equations you use or derive. For data collected with and stored on a computer, its a good idea to make note of le names and experimental conditions.

    For 20.309, you do not need to repeat in exhaustive detail the descriptions of lab procedures from the handouts. Paragraphs of description and complete sentences arent required. Record enough key details and information such that another 20.309 student or instructor can understand what you did. Remember, youre keeping a record for yourself and peer researchers.

    Clarity and Organization - Always record the date (and time, if necessary) of experiments on every page, clearly label any plots, charts, or data tables you make. Sometimes, youll need to think ahead to the data you need to collect, so you can write it down neatly and clearly (e.g. creating a data table ahead of time that you will ll in during lab).

    3

  • 3 Lab Report Guidelines

    A report will be due at the end of each lab module. Each module will list certain requirements for its write-up, and give an appropriate page estimate for how long it should be. In addition to this, your report should:

    summarize the question(s) you aimed to answer or measurement(s) you made

    summarize what experiments you performed to that end

    detail the collected data and the experimental results

    explain how you interpreted your results, what conclusions you drew and why

    A few other things to keep in mind about lab reports:

    DO:

    1. Follow the Report Requirements section at the end of each lab module.

    2. Describe any procedures you followed that were dierent from whats suggested in the pre-lab handout.

    3. Present data concisely and clearly: a series of curves all being compared to each other should all appear on the same graph. A caption or explanation of the graph should make evident the meaning of whats plotted.

    4. Use the passive voice i.e. it is typical to write the measurement was repeated three times, rather than I repeated the measurement three times. This is a style somewhat unique to scientic writing, and likely to run counter to other types of writing youve been asked to do.

    DONT:

    1. ... rehash all the details of the lab procedures if you followed them exactly as described in your pre-lab handout. A short summary is sucient.

    2. ... strive for sheer volume of data. If youre including pages of nearly-identical plots, with little discussion of what they mean, something is wrong. A single gure thats well-thought-out is worth a dozen that arent.

    3.1 Authorship and Collaboration

    In 20.309, you will usually work with a partner in the lab. However, every student is responsible for writing and submitting his or her own individual lab report. You should always acknowledge the partner with whom you worked. On occasion, you may need to use data collected by someone else, in which case you must acknowledge that you were not the one to collect it.

    3.2 Graphs, Figures and Tables

    Always label the axes of all graphs or the columns of all tables with what data it is thats being presented, and its units. What you show in a plot isnt always self-evident, even if you followed a procedure suggested in the pre-lab handout. Sometimes, simply making sure you specify the units for something will help you understand the data better.

    4

  • BE.309: Instrumentation and Measurement Laboratory Fall 2005

    MATLAB Fundamentals

    matlab is an abbreviation of Matrix Laboratory, which is a mathematics software package optimized for working with vectors and matrices. It is a powerful tool for data analysis and plotting, and much more. It is available on all our labs PCs, and is very worthwhile to learn, since it can be applied to a tremendously broad range of scientic applications. Well start by learning to manipulate matlab vectors and create plots.

    0 MATLAB Help

    Almost the most important and useful thing in matlab is its help feature. To learn about the details of using any command whose name you know, type:

    help commandname;

    At the end of the help information, youll also get a very useful list of related commands. If you dont know the command name, and need to try nding it out using a related keyword, use

    lookfor keyword -all;

    If youre using a Windows-based implementation of matlab , you can also access the same information via the Help menu.

    1 Vectors and Matrices

    Try the following commands and observe the results:

    > a = 1:10

    > b = 0:0.4:1.5

    > c = [2 5 8 2 ; 2 5 0 0 ; 3 4 2 1]

    > d = a*b;

    > e = ones(100,1);

    Note the dierence between placing a semicolon at the end of a command, and leaving it out in the rst case output is suppressed, which is crucial for working with large matrices. Other useful commands to try are linspace and logspace.

    Example: Generate a sine function with an amplitude of 1.5 and a frequency of 5kHz, and lasting 0.1sec. Youll rst need a vector representation of time. This should be closely-spaced enough to have at least 10 points per cycle of the sinusoid.

    Pay attention to operations dened both as matrix operations and element-by-element. To specify an element-wise operation, put a dot in front of the operator. If the four commands below are run on the variables dened above, the 1st and 3rd will not work, but the 2nd and 4th will:

    1

  • > c*b;

    > c*b;

    > c.*b;

    > c(1,:).*b;

    2 Indexing

    Indexing, or selecting the desired elements of a vector or matrix, is crucial in this environment. The entries of matlab matrices are always numbered starting with 1, and some have special names. Some examples follow:

    > c(:,3) is the third column of matrix c.

    > c(3,:) is its third row.

    > c(4,1) will produce an error, since c only has three rows, as weve dened it.

    > d(2:7,:) gives rows 2-7 of d

    > d(:,2:end) refers to columns 2 through the last one.

    These expressions can be used within other operations and calculations, letting you have powerful access to various subsets of your data.

    Example: Assign a small section of your sinusoid (about one or two cycles) to a new variable, and make an equal-length variable section of the time vector. The Workspace pane in matlab will show you the size of various variables, or you can use size(variable) or length(variable).

    3 Plotting

    For making plots, the most basic syntax is:

    > plot (x_vector,y_vector);

    This must be done with vectors of the same length and plots them one vs. the other.

    > plot(x); simply plots the data in vector x vs. the index of each data point.

    > loglog(x,y); and semilogy(x,y); produces non-linear plotting axes.

    > hold; prevents a plot from being re-drawn when the next plot command is issued, letting you plot multiple curves on the same set of axes.

    > plot (x,y,r.:); plots using a red dotted line, placing a dot at each data point.

    > axis ([-3 2 -1 1);

    sets the limits of the current plot such that the range of the x-axis is from -3 to 2, and the y-axis from -1 to 1.

    2

  • 4

    > figure(2);

    creates a blank new gure window numbered 2, or if the window already exists, makes it active.

    Example: Plot your full-length 0.1sec sinusoid (vs. its time vector), and the one- or two-cycle segment, in two dierent plot windows. Adjust the axes of the full-length plot such so you can see the oscillations of the sinusoid.

    Now, see what happens if you re-generate the sinusoid using fewer time points. How many points per cycle do you need to be able to recognize it as a sinusoid? How many points do you need for it to appear at the correct frequency?

    Here are some example commands for adding labels, gridlines, titles, etc. to your plots:

    > grid; > title(figure title); > xlabel(label for x-axis);

    As always, use help to get the details of usage for any of these commands (in this case help plot).

    m-les and Functions

    Any time you have a series of matlab commands that you are likely to re-use, its worth saving them to an m-le, so named because their le names always end with .m. Such les can be run by simply by typing the lename (without the .m) at the matlab prompt.

    A special case of an m-le is a matlab function. This is analogous to functions in other programming languages, and can be called from other functions, m-les, or the matlab prompt with parameters passing to and from it. If you are unfamiliar with the concept of functions in programming, that is beyond the scope of this introduction, but help is available from your lab instructor.

    A matlab function must always adhere to the following pattern:

    function [output_par]=myfunction(input_par_1, input_par_2)

    command1;

    result1=input_par_1+input_par_2;

    command2;

    output_par=result1;

    The le containing this function must be named myfunction.m. As written, it requires two input arguments, and returns one output argument (i.e. youd use it something like this: outvar=myfunction(invar1, invar2). The numbers of intput/output arguments can, of course, be changed.

    3

  • 5 More Examples

    To get more practice with matlab , work through these few examples related to Lab Module 1. These dont need to be turned in, but its highly worth your while to do them.

    5.1 Voltage Divider

    1. Create a vector of resistance values R1, in the range 1-10k.

    2. If R1 is used to make a voltage divider with a second resistor R2 having a value of 5k, write down two equations representing the output voltage in the two cases, where R1 is upstairs and downstairs.

    3. Plot both curves on the same set of axes. This should give you more insight into the sensitivity of resistive divider setups?

    5.2 Photodiode

    The analytical equation for the i-v curve of a diode is

    I = I0(eqV/kB T 1) ,

    in which V is the applied voltage, q, kB and T are the elemental electrical charge, Boltzmanns constant, and absolute temperature, respectively (the values are q = 1.6 1019C, kB = 1.38 1023J/K, and T = 300K). I0 is the saturation current in reverse bias, which depends on the diode material parameters and how the p-n junction is made.

    1. Start with a vector of voltages, using a range and spacing that will include the transition region of a diode i-v curve, and generate a vector of current values based on those voltages, assuming a value for I0 of 1A. Plot this curve and set the plot axes to be able to see clearly the region where all the action is.

    2. Input your measured data for a diode in darkness either by directly entering the vectors, or by rst entering them into a le, and using the load command. Plot this on the same gure with the ideal curve from above and compare. What is the key dierence from the theoretical diode equation? What is the physical cause?

    3. How can you change the diode equation to model the series resistance Rs of the diode? Try using dierent values of Rs to see if you can get the ideal curve to more closely approximate the data you took.

    4. (time permitting) Create an m-le with a function that computes the ideal diode i-v curve, given a vector of voltage values, and a series resistance R. Show it to your lab instructor.

    4

  • 20.309 Matlab Tutorial By Marcio von Muhlen

    Fall 2006

    Adapted from previous tutorials by Maxim Shusteff, Nate Tedford and other BE students

    Where to use Matlab: In the 20.309 lab, any MIT server or your own computer.

    How to use Matlab (please print and bring to lab): http://openwetware.org/images/5/5f/MatlabIntro.pdf (Intro to Matlab file 2 in the website) We will follow these tutorial notes, with additional material below.

    Additional Material:

    In experimental work you will often encounter the need to fit data to arbitrary (non-polynomial) functions. Matlab provides a variety of methods for doing this, one of which is the function LSQCURVEFIT. Take a few moments to glance through the help file to see what were getting in to. The various paragraphs indicate that this function behaves differently depending on the number of input and output variables specified in calling it.

    In order to generate a fit you need to tell Matlab the form of the equation you believe the data should follow. Bear in mind that Matlab has no way of knowing or telling you if youre incorrect, so its up to you to account for this. The way you do this is by creating a Matlab function file. For example, for an

    C1 Xequation of the form: f (x) 1 C2 X

    The function file might look like:

    function yhat = myfun(beta, x)

    c1 = beta(1);

    c2 = beta(2);

    yhat = (c1*x ./ (1 + c2*x));

    which, since its a function, must be named myfun.m. The coefficients to be fitted are here contained

    in the input variable beta. Make sure to have this function in your working directory.

    Lets try to fit the following data to this function using LSQCURVEFIT:

    (you can find it in digital form at http://openwetware.org/images/8/8f/Fitdata.txt, or just copy and paste)

  • X f(X) 1.0000 1.6523 1.2743 1.8215 1.6238 2.0050 2.0691 2.1106 2.6367 2.3456 3.3598 2.4778 4.2813 2.5952 5.4556 2.8175 6.9519 2.8945 8.8587 3.0125 11.2884 3.0001 14.3845 2.9454 18.3298 3.1056 23.3572 3.1850 29.7635 3.2454 37.9269 3.1170 48.3293 3.2313 61.5848 3.2092 78.4760 3.3027 100.0000 3.2677

    Create a matrix fitData which contains this information. You could use: >>fitData = dlmread('fitdata.txt', '\t', 1, 0);

    Assuming fitdata.txt exists in your working directory. The 1 in the third input tells Matlab the data is starting on the 2nd row of the text file (Aside: Matlab indexes occasionally start with 0 as in JAVA, but usually start with 1 you can tell different coders wrote different parts of this software).

    Assign the X column to the variable X and the f(X) column to the variable Y, then plot the data with a semilog plot.

    >> X = fitData(:,1); >> Y = fitData(:,2); >> semilogx(X,Y, bd) %bd specifies blue diamond, unconnected data points

    We need to provide Matlab with initial guesses for our coefficient values. At this point its a good idea to plot our function to see if the data makes sense in regards to it. We can start by guessing 1 for both coefficients; in a real experiment your prior knowledge of what you are measuring would determine these guesses.

    >>hold on >>semilogx(X, (1 ./(1 + 1*X))

    Now lets have Matlab figure out the best fit (least squares sense) of the data to this function, then plot the data and fit together.

  • >> Cfs = LSQCURVEFIT(@myfun, [1 1], X, Y)

    >> hold off

    >> semilogx(X,Y, bd, X, (Cfs(1)*X ./(1 + Cfs(2)*X)), k-) %what does k- do?

    Here we plotted two sets of data in the same command. See the help file for semilogx to understand how this works. Notice that although our guess wasnt very good, Matlab had no trouble finding good coefficients. This wont always be the case with more complicated data and functions.

    Additional Resources: MITs MATLAB answer page: http://web.mit.edu/answers/matlab/

    Another MATLAB tutorial, with additional material on looping and solving ODEs in MATLAB: http://openwetware.org/images/7/76/MatlabTutorial2.pdf

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    Module 0: Introduction to Electronics

    Contents

    1 Objectives and Learning Goals 1

    2 Roadmap and Milestones 2

    3 Lab Procedures 2

    3.1 DC measurements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    3.2 Impedance and load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    3.3 Photodiode i-v characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    3.4 Time-varying signals and AC measurements . . . . . . . . . . . . . . . . . . . . . . . 6

    3.5 Black-box transfer functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    A Circuit Components 7

    A.1 Resistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    A.2 Capacitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    A.3 Diodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    A.4 Breadboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    A.5 Operational Ampliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    B Instruments 11

    B.1 Digital Multimeter (DMM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    B.2 DC Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    B.3 Function Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    B.4 Oscilloscope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    B.5 LabVIEW and the data acquisition (DAQ) system . . . . . . . . . . . . . . . . . . . 13

    1 Objectives and Learning Goals

    1. Familiarize yourself with standard lab electronics and some common circuit elements: linear and nonlinear, passive and active.

    2. Understand fundamental electronics concepts, including:

    current/voltage dividers impedance & load frequency response & transfer functions

    3. Analyze and build several circuits, which will be of use later.

    This module is an extended lab orientation of sorts. Take this time to explore electronic circuits and really get to know all the features of our labs instrumentation. It will pay o later. What you learn and do this week will underpin many of the experiments during the rest of the semester.

    Since you are mainly concerned with understanding your toolset and learning its uses and limitations, no formal write-up is necessary. However, many parts of this module work hand-inhand with questions on Problem Set 1, so you will still want to record data for completing them.

    1

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    2 Roadmap and Milestones

    1. Practice making DC and AC signal measurements.

    2. Measure circuit input and output impedances and observe loading eects.

    3. Study the nonlinear characteristics of a diode, and learn how a photodiode responds to incident light.

    4. Test several unknown circuits to determine their transfer functions

    3 Lab Procedures

    3.1 DC measurements

    The simplest type of circuit is the direct current (DC) situation. This means simply that the applied voltage does not vary in time. Alternating current (AC) is discussed in Sec. 3.4. Most often, we separate complex signals into their DC and AC components (e.g. a sine wave with a constant oset) to make analysis simpler.

    To get started, wire the circuit shown in Figure 1 on your breadboard, where R1=330 and R2=150. Using the power supply, set Vin to 5V. Well make a few measurements of the behavior of R2 in the circuit. We want to know the voltage across it and the current through it.

    Figure 1: Resistive voltage divider circuit.

    Measuring Voltage with the DMM:

    1. First switch the DMM to voltage mode. Note: Make sure that the DMM test leads are plugged into the right connections. Remember, the correct congurations for current and for voltage/resistance measurements are dierent. See Sec. B.1

    2. Place the two leads across the terminals of R2 so that it is in parallel as shown in Figure 2.

    3. In voltage mode, the DMM has a very large equivalent resistance (ideally innite) so that when placed in parallel with the circuit you are measuring, it will have minimum eect on the circuit under test.

    To prove this:

    (a) Assume rst that the eective 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 DMMs resistance is something very large, like 10M. Now what is the resistance of the parallel combination of R2 and the DMM?

    2

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    Figure 2: Measuring voltage across R2.

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

    Measuring current with the DMM:

    1. Switch the DMM to current mode.

    2. Place the leads of the DMM in series with a device in the path that you want to measure, shown in Figure 3. For this type of measurement you actually need to break the circuit and insert the DMM.

    Figure 3: Measuring current through R2.

    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 eective resistance of the DMM to be small in current mode? Again think about the eect on the circuit under test.

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

    error = 100 Rexp Rmeas

    . Rexp

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

    3

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    Measuring resistance with the DMM:

    1. Turn o 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 aect 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 in Figure 2. Does this match your calculated resistance?

    Resistor i-v characteristics

    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? (Ohms law should make this very easy).

    3.2 Impedance and load

    From the previous section you already have a sense of the importance of considering the equivalent impedances of your instruments when making voltage or current measurements (or connecting any two circuits together) we must always keep in mind the relative output and input impedance of these components.

    An easily observable example: Suppose you have a 5V power source, and need to drive an LED with approximately 2 volts. A voltage divider may seem straightforward to use for this purpose, but one must be careful when designing the circuit. To see why, wire up the circuit in Fig. 4, rst using relatively small resistors (50-500 range), then do it using resistors that are 100 larger.

    Why does the brightness of the LED change so drastically? Measure the voltage at the + node of the LED, before hook ing it up, and after. Also, measure the current through the LED in each case. Does this help you understand whats going on?

    Figure 4: A voltage divider Calculate the output impedance of the driving voltage di- driving an LED. viders in the two varieties you built.

    A brief discussion: Impedance is a generalization of resistance (including capaci

    tance and inductance), and we use the terms somewhat interchangeably here, but you should know that they are not strictly speaking the same.

    A load is a general way of referring to any part of a circuit that has a signal delivered to it, such as a measurement device, or a particular component. What is considered the load depends entirely on how the parts of the circuit are being considered. In the case of the circuit in Fig. 4 the LED is the load for the voltage divider.

    The output impedance of a circuit or device is seen looking into the output port of a circuit (i.e. between the output signal node and ground). Likewise, the input impedance of a device/circuit is the impedance seen between the input node and ground. The agent doing the seeing is whatever connects to the circuit in question e.g. if an oscilloscope is hooked up to a circuit to do a

    4

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    measurement, that circuit sees the input impedance of the oscilloscope. Here, the voltage divider being used to drive the LED sees the LEDs input impedance, and the LED sees the output impedance of the driving circuit.

    3.3 Photodiode i-v characteristics

    In this section, our aim is to measure and plot the current-voltage relationship for a diode in the transition region from non-conducting to conducting. After that, we also want to measure the behavior of photodiodes (see Sec. A.3, which well use a number of times in the course as light detectors.

    Start by covering the window of an FDS100 photodiode with black tape with no light coming in, it is just a regular diode. Then well illuminate it to see its photodiode action.

    (A) Construct the circuit shown in Fig. 5. You have at your disposal your DC power supply, and a variable resistance R (we recommend you use values of 100k, 27k, 8.2k, 4.7k, 2.2k, and 820 this is more straightforward than using a pot and measuring its value every time you turn the knob).

    Figure 5: Circuit for diode i-v measurements.

    (B) Given this circuit, come up with a scheme to measure the diodes i-v curve. Think about these questions to help guide you:

    Is current or voltage easier to measure? For a given setting of VS and R in Figure 5, how can you calculate the current and voltage through the diode by making a single measurement?

    What should you do dierently for the forward and reverse bias regions of the curve? From what you know about diodes, how does their impedance in forward bias compare to that in reverse bias?

    Youll want to generate a set of ID and VD values in your notebook to be used for creating the i-v plot. Then put a plot together using the program of your choice (MS Excel is ne).

    (C) 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 two or three levels of light intensity.

    You can now combine your data to produce four i-v curves for this diode at dierent light levels. Plot these on the same graph to see how incident light aects diode i-v characteristics. Youll need this data for your rst Homework Set.

    5

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    3.4 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 weve used so far is no longer enough to observe what is happening. At this point, youll need to get acquainted with the function generator (Sec. B.3) and the oscilloscope (Sec. B.4), to generate and record AC signals, respectively. Well also start making extensive use of BNC cables and connectors.

    First, lets look at how the resistive voltage divider with which youre already familiar behaves with AC signals. Build the divider circuit as you did in Sec. 3.1, but use the function generator in place of Vin, and the oscilloscope in place of the DMM (Figure 6).

    Figure 6: The familiar divider circuit, with a voltage measurement across R2.

    1. Set the FG503 frequency to 5kHz, and the waveform to sinusoid with no oset.

    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 the FG503 has no markings on its knob.

    3. Connect the waveform to your circuit.

    4. Use the other channel of the scope to measure Vpp across R2. Also measure the frequency across R2 on the scope. You can display both the input and output waveforms at the same time by using the scopes dual mode. Does this resistive voltage divider behave any dierently at AC than it did at DC? Whats 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?

    3.5 Black-box transfer functions

    For this part, youll nd prepared for you several metal boxes with mystery circuits wired up inside, labelled A through D. Your goal is to determine their transfer functions. To streamline the process, weve provided a program that will output a frequency-sweep function, which you can feed into the circuit. The program will then record the amplitude of the output, and plot the data for you. Ask your lab instructor how to use it.

    6

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    Appendices

    A Circuit Components

    A.1 Resistors

    The important things to know about resistors are: (1) value, (2) tolerance, and (3) power rating. The power rating indicates the maximum amount of power a resistor can withstand, e.g. 1/4 watt, 1/2 W, etc. The value and the tolerance of the resistor is printed on the package in the form of a color-band code (see below).

    Potentiometers (or pots) are variable resistors with three leads. The top half of Figure 7 shows a full schematic, but the lower picture is usually used for compactness. The arm at lead #2 is called the wiper, and turning Figure 7: Two the potentiometer knob controls its position. While the resistance between ways potentiome#1 and #3 always remains the same, the knob varies the resistance between ters are shown on leads #1 and #2 (and between #2 and #3). Another way to think of this is schematics. as a variable voltage divider. The value between either #1 and #2 or #2 and #3 can be varied from zero to the pots full value.

    Reading the Resistor Color Code

    We provide this table here for your convenience, but you can always easily look this information up on the web. For instance, http://www.elexp.com/tips/clr code.gif contains a good table of 4-band and 5-band resistor color codes, while this URL does it in an interactive clickable Java applet: http://samengstrom.com/elec/resistor/index.html.

    1. Orient the resistor so that the band that is most separated from the rest is on the right (typically this is gold or silver).

    2. On a four-band resistor, form the number from the rst and second band by placing them as the tens and ones place respectively (e.g. from the left a blue band then a green band means 65).

    First or Second Third Band Fourth Band Color Band (digit) (multiplier) (tolerance) Black 0 1 Brown 1 101 1% Red 2 102 2% Orange 3 103

    Yellow 4 104

    Green 5 105 0.5% Blue 6 106 0.25% Violet 7 107 0.10% Gray 8 108 0.05% White 9 109

    Gold 0.1 5% Silver 0.01 10%

    Table 1: Table of 4-band resistor colors. For a ve-band resistor, the rst band becomes the 100s digit, the second band is the tens the third the ones, the fourth is the multiplier, and the fth the tolerance.

    7

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    3. Multiply the resulting number by the multiplier from the third band (e.g. blue-green-red = 65 100 = 6.5k).

    4. The most common types of resistors are 5% and 1%, so for quick designation the bodies of these resistors are often color coded (brown 5% and blue 1%).

    A.2 Capacitors

    Capacitors immediately make for much more interesting types of circuits than simple resistive networks, because (1) they can store energy and (2) their behavior is time-dependent.

    An intuitive way to think about capacitor behavior is that they are reservoirs for electrical charge, which take time to ll up or empty out. The size of the reservoir (the capacitance C) is one of the factors that determines how quickly or slowly. Because of this, circuits with capacitors in them have time-dependent and frequency-dependent behavior. Capacitors act like open circuits at DC or very low frequencies, and like short circuits at very high frequencies.

    A.3 Diodes

    This is one of the simplest non-linear electronic devices, and is remarkably versatile. It can function as an electronic valve, as a light-emitter (LED) or a light-detector (photodiode). Fig. 8 shows how they appear on schematics.

    A diode as an electrical valve. In the simplest model, we can imagine a diode as a one-way electrical valve - it behaves almost as a short circuit (wire) when a positive voltage is applied across it (called forward bias shown in Fig. 8) and as an open circuit with a negative voltage (reverse bias). As you might guess, this is not the whole story, and is only true for relatively large voltages. You will Figure 8: The explore diode behavior in more detail, especially around the critical transition diode symbol region near 0 volts. on a schematic.

    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 owing through the device (whats the relationship? linear? quadratic?).

    A.4 Breadboards

    Breadboards are a platform that allows for easily building prototype circuits without the need for soldering. Their advantage is that parts can be added, swapped in and out, and dierent congurations tested very easily and quickly. However, breadboards are bulky, pick up signicant excess noise from the environment, have large parasitic capacitance, as well as other limitations. Once a circuit design is nalized, its typically made in a printed circuit board (PCB).

    Figure 9 is an example of a breadboard, where each square represents a hole in which a wire lead can be placed. The lines drawn over the board represent the basic connectivity. The two outermost lines on each side represent power buses that are connected across all rows. In the very center of the board is a divider that separates columns A-E and F-J. Each row is connected: i.e. 1A-E are all connected to each other, as are 1F-J. However, A-E are electrically isolated from

    8

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    Figure 9: A typical breadboard layout. Some breadboards have several panels such as these adjacent to each other, with banana cable jacks for power and ground connections.

    F-J. Finally, rows that are not in the power rail are also electrically isolated (these connections are explicitly shown only in the rst ve rows).

    Of course, if connectivity is unclear, you can use the multimeter to test for electrical continuity between two points on the board. Multimeter leads often dont t in the holes directly, so you can use a wire as a connector between the meter and the board.

    An example of how to place a component in the breadboard is shown in the gure. A resistor is depicted as a red box with two metal leads. There are many ways to place this resistor, and the gure shows two of these ways.

    Breadboard Tips and Techniques

    1. Choose the right length of wire and clip leads to keep components and wires close to the board. This has two benets: (1) It makes debugging a circuit easier if you can easily see all the connections and (2) It prevents pick-up of additional noise from the environment, since big loops of conducting material make for good antennas.

    2. Utilize the power rails, e.g. use one each for the positive supply voltage and negative supply voltage (referred to as +Vcc and Vcc), and one for ground.

    3. Create a common ground. If you use a power supply for DC power, a function generator for an AC supply, and measure using the oscilloscope, then you will have four independent grounds that may not be at the same potential unless connected together (the four grounds are: circuit ground, FG ground, PS ground, and scope ground).

    4. Always turn o power when building and making any changes to the circuit. Also, when measuring resistance, power o the circuit and disconnect the resistor being measured.

    5. As a rule of thumb, always connect the ground lead of an instrument to the circuit rst before the live lead.

    6. In future labs, we will work with Integrated Circuit (IC) packages. Static electricity can destroy ICs. To prevent damage, ground yourself before handling them by touching a metal object, e.g. a metal case or metal bench top.

    9

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    A.5 Operational Ampliers

    In the upcoming lab module we will start using integrated circuits (ICs) known as operational ampliers, or op-amps. They are an enormously versatile circuit component, and come in hundreds of special varieties, built to have particular characteristics and trade-os. 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 in the lab for the op-amps we are using, and youll want to refer to them regularly as you work.

    As youll see in lecture, a typical op-amp circuit looks something like Fig. 10. This is called the inverting conguration, because the input is connected to the inverting () input. As you might guess, the output signal is the Figure 10: A basic inverting op-amp

    negative of the input, times a gain factor set by the circuit. circuit.

    The LM741 package of course does not look like the triangle drawn above. Instead it looks more like Figure 11. Plugged into a breadboard, the two rows of pins straddle a trough.

    Figure 11: 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 (as in Fig. 10), but always shown on the datasheet (in Fig. 11 they are pins 4 and 7). 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 your LM741 there is a dot near Pin 1 (or a semi-circle on one end of the chip, as in the gure to the right). 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.

    10

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    B Instruments

    The brief descriptions in this section will give you an introduction to each instrument. You can always refer to the manuals available in the lab for more details.

    B.1 Digital Multimeter (DMM)

    A very versatile tool, the multimeter serves as a voltmeter, ammeter, ohmmeter, and has a number of other functions as well (see Figure 12(b)). Modern DMMs, such as our Fluke 111, are highly intuitive to use: select the function you want with the central mode dial, plug the leads into the appropriate connectors, and measure. The black (negative) lead always plugs into com while the red (positive) lead is adjusted depending on the function. The voltage and current measurement modes of the DMM are very dierent (youll see why), so dont forget to reconnect the leads.

    In alternating current (AC) mode, the multimeter gives root-mean-square (RMS) measurements, which are useful when you know what the waveforms are. Well discuss RMS later in the course.

    B.2 DC Power Supply

    The power supply we will use is a Tektronix PS503, shown in Figure 12(a). It has one xed 5V output and two adjustable ones. The (+) and () outputs have adjustable current limits and voltages up to 20V can be set either independently, or together (using the dual tracking knob). The white output button on the upper right allows power to ow to the outputs: always remember to turn this o or disconnect it when rewiring your circuits.

    Note that the black common voltage connector is oating, i.e. not directly connected to ground, and cant be assumed to have zero voltage. Youll want to connect it to the white connector of the xed 5V supply, which is tied to ground.

    (a) Tektronix PS503A. (b) Fluke 111.

    Figure 12: (a) The DC power supply and (b) the digital multimeter used in our lab

    11

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    B.3 Function Generator

    A function generator does what its name says generates signal waveforms for standard functions: sinusoids, triangles, square waves. The FG503 is very basic. Its frequency range is about 0.1Hz to 300kHz, and amplitude range from about 0.35V to 10.0V. It can output waveforms with and without oset. The large central dial in Figure 13 is the main frequency knob, which sets the output frequency together with the multiplier knob (labeled). Be warned that the large dials markings can be fairly inaccurate always verify the actual output frequency with an oscilloscope or spectrum analyzer.

    Note that higher-end function generators, such as the DS-345 from Stanford Research Systems, have much more precise controls for waveform frequency, amplitude, and oset, and may have other advanced Figure 13: An FG503 function generator. features like sweeping frequency, generating nonstan- (In this image, the BNC signal connectors dard or arbitrary waveforms, and modulation. are capped.)

    B.4 Oscilloscope

    An oscilloscope 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 eectively a time magnier letting you stretch and compress the timebase (as well as the waveform magnitude) for convenient viewing.

    Ours is an OS-5020 model made by EZ Digital, the front panel of which is shown in Figure 14. Its about as basic as a two-channel analog scope can be. Below is a brief description of the most important controls:

    Figure 14: The OS-5020 oscilloscope.

    12

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    CH1, CH2: channel inputs (2) - Signals connect to these via BNC cables. Above each input is a three-position input coupling switch (ac - gnd - dc). Understanding the three settings is crucial to knowing how the scope is measuring incoming signals.

    VOLTS/DIV: channel gain knobs (2) - Set the magnication of the waveform in the vertical axis. The scale around the knob tells you how many volts each square of the grid represents at a given magnication.

    MODE select - Choose whether the scope is displaying the signal on Ch. 1, Ch. 2, both simultaneously (dual), or their sum (add).

    POSITION knobs (2 vert., 1 horiz.) - Set the zero-position of the trace for each channel, and the time-trace to enable accurate measurements.

    TIME/DIV: timebase selector - Like channel gain, but for the horizontal (time) axis, this sets how much time each square of the grid represents. In its rightmost position, it selects X-Y mode, which plots the two input channels one vs. the other, with no time dependence.

    Most of the other controls deal with triggering, which refers to synchronizing the scan of the display with the input waveform. You will get a feel for these as you use the instrument in lab.

    Youll notice that the scope only measures voltages there are no modes for directly measuring current or resistance. Its 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 cant use just one channel of a scope to measure the voltage between two non-ground nodes in a circuit.

    B.5 LabVIEW and the data acquisition (DAQ) system

    LabVIEW is a software and hardware system designed to perform the functions of many standard bench-top measurement devices. The hardware provides signal input and output for the PC (see Fig. 16, while the software runs what are called virtual instruments (VIs), resulting in a very general-purpose data collection and processing platform. In addition to collecting data, LabVIEW can be used to control instruments, for example via a GPIB interface.

    You will use a number of dierent VIs throughout the course that have been written for you. While they will all perform dierent functions, they all have common run/stop controls in the upper left hand corner, as shown in Fig. 15. The arrow at the left is used to start each VI, and the red stop button will halt Figure 15: it once it is running.

    The great advantage of LabVIEW is its breadth and exibility. The major disadvantage is that when performance is important (high speed, low noise, high precision, etc.) dedicated instruments quickly outperform it.

    Figure 16: The data acquisition (DAQ) connection board, used for signal input and output with LabVIEW. The analog input channels are in two rows, labeled ach0 through ach7, and ach8 through ach15. The two output channels are to their right, labeled dac0out and dac1out, one above the other.

    13

  • 1

    20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    Module 1: Measuring DNA Melting Curves

    Contents

    1 Objectives and Learning Goals 1

    2 Roadmap and Milestones 2

    3 Background 2

    4 Building the apparatus 3

    4.1 Temperature sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    4.1.1 Thermistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    4.1.2 Wheatstone bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    4.2 Fluorescence readout system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    4.2.1 Amplication circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    4.2.2 Oset circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    4.2.3 SYBR Green I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    4.2.4 Optical system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    4.2.5 Sample handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    4.2.6 Heating block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    5 Experimental Protocol 7

    5.1 Preparing the setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    5.2 DNA melting curve experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    6 Report Requirements 8

    6.1 Data to take . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    6.2 Model vs. reality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    Objectives and Learning Goals

    Implement a temperature sensor using the well-known Wheatstone bridge scheme. Build an instrument for recording DNA melting curves. Use your instrument to study the melting behavior of several DNA samples under dierent conditions.

    Understand the factors aecting DNA melting behavior, and what type of information can be usefully obtained from such measurements.

    1

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    2 Roadmap and Milestones

    1. Build and test the temperature-sensing circuit.

    2. Calibrate the circuit for accurate temperature measurement.

    3. Build an amplication/oset circuit for the DNA uorescence signal.

    4. Assemble an optics setup that will enable you to observe the light output of a DNA sample to be studied.

    5. Combine the subsystems you have built to generate a DNA melting curve; troubleshoot and optimize your system.

    6. Obtain DNA melting data for several sequences, and identify a single-base mismatch (SNP) sequence.

    3 Background

    You will learn in lecture about the importance and utility of measuring of DNA melting temperatures. A common application takes advantage of the length-dependence of DNA melting temperatures to examine PCR products, and determine whether the desired sequence was successfully amplied.

    The goal of this lab is to build the hardware to be used for double-stranded DNA (dsDNA) concentration measurement with the common dsDNA-binding dye SYBR Green I. This setup, together with a temperature sensing circuit, enables DNA length and complementarity analysis via melting curve measure-ment. The tools developed in this lab will also be capable of analyzing other uorescent dyes with similar excitation and emission wavelengths.

    A typical plot of temperature-dependent uorescence from a solution of DNA and SYBR Green I is shown in Fig. 1. The melting temperature Tm is dened as the temperature at which 50% of the DNA remains hybridized. Sometimes, the transition is not particularly sharp, or other factors in the mea-surement may create osets or drifts in the signal (evident below 80C in Fig.

    Figure 1: Typical melting curves using SYBR Green I. 1(a)), in which case the derivative of this

    2

    0.35

    0.3

    0.25

    0.2

    0.15

    0.1

    0.05

    060 65 70 75 80 85 90

    Temperature (deg C)

    dRFU

    /dT

    6

    5

    4

    3

    2

    1

    0

    -160 65 70 75 80 85 90

    Temperature (deg C)

    RFU

    (a)

    (b)

    Figure by MIT OCW.

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    curve is plotted (Fig. 1(b)), and the lo

    cation of its peak value gives Tm more clearly. More about this in Section 4.2.3.

    To perform a DNA melting experiment, the temperature of the DNA sample is usually ramped up at a controlled rate, and carefully monitored, while the concentration of dsDNA is recorded, most often using a uorescent dye. To avoid the need for precise temperature control, we will ramp the temperature downward by heating the DNA sample to above its melting temperature, and letting it cool naturally.

    4 Building the apparatus

    Your apparatus will consist of two major subsystems for (a) temperature measurement, and (b) quantication of dsDNA in your sample. The outputs of the subsystems give you the two data sets that constitute a DNA melting curve: temperature and relative uorescence intensity.

    Note: as you build the setup, keep stability in mind. This is a sensitive high-gain system, and it will not perform well if it is constantly getting bumped and wires are being moved or disconnected. This means making solid electrical connections, keeping wires and cables clamped or taped down, and setting things up to move as little as possible when you connect and disconnect the sample.

    4.1 Temperature sensing

    4.1.1 Thermistor

    A thermistor is a resistor whose resistance varies with temperature. Thermistors come in two avors: positive temperature coecient (PTC R increases with higher T) and negative temperature coecients (NTC R decreases with higher T). To build and test your temperature-sensing circuit, you can use a 5 k NTC thermistor (black with red leads, available in our usual small parts drawers part number RL0503-2890-95-MS). Its temperature-resistance characteristic is nonlinear, and the datasheet is available in the lab.

    Once you have a good feel for the temperature sensing circuit (see Sec. 4.1.2), you will actually use a thermistor called an RTD (resistance temperature device) for the melting experiment (see 4.2.6. It is a positive temperature coecient platinum thermistor with a nominal value of 1 k that has a very linear temperature response. This one has part number PPG102A1, and the datasheet can be likewise found in the lab.

    4.1.2 Wheatstone bridge

    Though very simple, the voltage divider is a very powerful concept in electronics divider-based circuits contribute to many types of sensor and measurement systems. Here we will use a well-known circuit called a Wheatstone bridge to make temperature measurements.

    The Wheatstone bridge was invented in the 1800s in order to measure the resistance of an unknown value Rx. The circuit consists of four resistors in the conguration shown in Figure 2. Typically, two have known values, R1 and R2, and a third resistor R3 is variable. The unknown resistance Rx takes the fourth position, and the circuit is wired with a voltage source Vin. The bridge is balanced when the ratio of R1 to R3 is exactly equal to the ratio of R2 to R4, in which case the voltages at nodes a and b are equal. Otherwise a voltage dierence develops, and current will ow if a connection is made across the bridge.

    Wire up a Wheatstone bridge on your breadboard, as shown in Figure 2, using a 1-10 k potentiometer for R3 (blue rectangular, not the round multiturn type) and values for R1 and R2

    3

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    Figure 2: A Wheatstone bridge circuit.

    that will give good sensitivity if Rx is in the 1 k range. Note that the RTD should have no more than 1 mA of current passed through it, so build your circuit accordingly.

    One way to measure the unknown resistance Rx is by monitoring the voltage dierence Va Vb, and adjusting the value of R3 until the bridge is balanced. Another method is to perform a calibration to derive the relationship between the voltage across the bridge to the change in resistance. Our approach will be a combination of these methods you will rst adjust R3 to balance the bridge, then use your knowledge of how Vab depends on Rx to calculate resistances from voltages.

    Test your temperature circuit using the black-with-red-leads thermistor, and small amounts of cold or warm water to vary its temperature. Observe the circuit output and make sure that the temperature reading makes sense to you. A thermometer is likely to be helpful here.

    Once you are satised with this, connect your circuit to a the sample block with the attached RTD. Make sure you are able to convert Vab to resistance, and use the datasheet to determine the calibration relationship between temperature and resistance.

    You should now have a functional electronic thermometer, and a straightforward way to convert its output to temperature.

    4.2 Fluorescence readout system

    4.2.1 Amplication circuit

    (If you need a brush-up on op-amps, refer to Section A.5 in the previous lab module).

    To usefully measure and record the uorescence signal you will need whats called a transimpedance amplier (sometimes called a current-to-voltage converter) with a gain of approximately 108 V/A. Be sure you understand why this is the case, and explain it to your lab instructor.

    The simplest transimpedance amplier looks like Figure 3:

    Determine the DC gain Vout/iin of this conguration (in V/A) in terms of the resistance Rf . It should be clear that getting a large gain from this circuit requires the use of a very large resistor, which wed prefer to avoid. (Optional: Figure 3: Basic transimpedance am-why not simply use a resistor, and omit the op-amp?) plier circuit.

    4

  • 20.309: Biological Instrumentation andMeasurement Laboratory Fall 2006

    Figure 4: The high-gain version of the transimpedance amplier circuit. Dont forget to add a capacitor for high-frequency noise rejection.

    Instead, we can use the circuit from Homework Set 1, which you have already analyzed, shown in Fig. 4. Since the signal you will measure will be very slowly-var