Difference between revisions of "DNA Melting Part 2: Lock-in Amplifier and Temperature Control"

From Course Wiki
Jump to: navigation, search
(Update and test the Matlab GUI)
Line 195: Line 195:
  
 
If any of the steps above do not give the expected outcome: Investigate, hypothesize, make an adjustment, and start again at the DAQ connections.
 
If any of the steps above do not give the expected outcome: Investigate, hypothesize, make an adjustment, and start again at the DAQ connections.
 +
 +
 +
 +
<center> Lock-In GUI screens </center>
 +
<center>
 +
{|
 +
| [[Image:GUILockInEarlyView.jpg|300 px|thumb|center|Early in melting cycle]]
 +
| [[Image:GUILockInLaterView.jpg|300 px|thumb|center|Late in melting cycle]]
 +
|}
 +
</center>
  
 
{|
 
{|

Revision as of 19:29, 27 March 2014

20.309: Biological Instrumentation and Measurement

ImageBar 774.jpg


In Part 2 of the DNA Melting Lab you will make revisions to allow greater control of your instrument and to reduce the effects of noise. You will add a pulse-width modulation (PWM) heater controller to enable careful control of the heating and cooling rates of the DNA sample. This will allow you to maintain a melting rate below the melting rate of the DNA and to work around the thermal lag of the instrument.

You will use an op-amp to enable modulation of the light flux emitted from the blue LED. The modulated illumination will then result in an oscillating amount of fluorescent light flux from the DNA sample. The oscillating flux will be detected by a photodiode and then amplified using a lock-in amplifier. The modulation and the lock-in amplifier will allow you to place your signal in a low-noise area of the frequency spectrum, and to recover the signal at DC, respectively.

Add heater/controller board

Background

In your instrument, both the actual and apparent behavior of the melting DNA sample are dependent on the heating and cooling rate of the sample holder. The temperature of the DNA sample always lags behind that of the sample holder. If the rates are reasonable, then the lag is not severe and a correction can be applied to the measured sample holder temperature to predict the sample temperature. If, on the other hand, the rates are too high, then the correction becomes unreliable. In addition, the melting and annealing reactions have a time scale associated with them as well. You will control the rates to yield the best data possible with your instrument. To do this, a specially-designed printed circuit boards (PCB) is provided. The PCB controls the current supplied to the TECs in contact with the smaple holder. Since the sample holder is aluminum, the parts of it in contact with the TEC, the RTD and the sample vial are all identical for reasonable heating and cooling rates. The PCB will be controlled by a modified version of the software, which you will implement later on in Part 2.

Gather the following components:

  • 1 PCB heater-cooler board
  • 1 red/black connector cable from the counter top opposite the wet bench
DNA Melting Heater/cooler PCB

Assembly

Points of connection are labeled on the PCB and described in the table and figure below. Refer to both in the instructions that follow.

  1. Disconnect the yellow/white cable between the supply and the TEC stack.
  2. Place the PCB in the pre-drilled holes on the sheet metal support bracket.
    • If the nylon "feet" are missing, add them now. The are in the DNA Melting drawer at the right of the wet bench.
  3. Turn off the Diablotek power supply.
  4. Connect the Diablotek 4-pin/3-color power supply connector to the 4-pin connector on the PCB.
    • Quickly cycle the Diablotek power to confirm a green power status light in the upper right corner of the PCB.
    • Turn off the Diablotek.
  5. Connect orange Fan signal pin to the Fan signal connector at the top of the PCB.
  6. Connect the fan itself to the Fan +/- connections at the bottom of the PCB.
  7. Connect the black digital GND signal pin to the DGND connector at the top of the PCB.
  8. Connect the red Heat/cool signal pin to the Heat/cool connector at the top of the PCB.
  9. Connect the green/blue or green/black Heater/cooler On/off signal pins to the connector at the top of the PCB.
Signal name Signal location Ground location Pin wire color
DAQ Outputs
Fan P1.1 N/A Orange
Heat/Cool P1.0 N/A Red
Digital GND DGND N/A Black (bundled with Red/Orange)
Heater/Cooler On/Off CTR0 DGND/AOGND +Green / -Blue or -Black

The DAQ connections and cable wire colors are also summarized in a memo.

DAQ Connection Cable

All points of connection are labeled on the PCB. Using the reference images above, make connections between your PCB and your DAQ cable (as described in the next section). Connect the red wire of the fan to "Fan+" and the black wire to "Fan-" on the PCB.

Next, connect your TEC and the computer power supply for the TEC and fan. Do not yet switch on the Diablotek computer power supply. Connect your TEC to the 2-pin Molex male connector on the left of the board using a Part 2 (red/black wires) female connector provided on the counter in the same box as the Part 1 connector (Black/White wires). Connect the free end of the new TEC wires to your TEC stack using wire nuts as before. If your TEC is installed correctly, connect red-to-red and black-to-black. If it is upside down, reverse the connections. Now verify that the Diablotek computer power supply is not switched on. Then connect the the 4-pin connector from the Diablotek that IS NOT labeled for Part 1 to the "Diablotek" 4-pin connector labeled on the PCB. These 2-pin and 4-pin connectors are all white, in contrast to the one black connector that you used for Part 1.

Do not yet switch on the Diablotek.

Three status LEDs are provided on the PCB. A lighted green LED will confirm that the Diablotek is turned on. If the TEC is properly connected, a red LED will indicate that the sample block is being heated. A blue LED will indicate that the sample block is being cooled.

Lock-in signal detection

Lock-in signal detection provides some immunity to the very noisy lab environment. The plots below show typical Power Spectral Density measurements of noise in the 20.309 lab, a mix of optical and electronic noise. Fluorescent lighting creates a very strong technical noise at 120 Hz and harmonics. The lock-in technique moves the signal spectrum from the riotous low frequency realm to a calmer range of frequencies within the laboratory background noise spectrum. Noise in lab the may change without notice, so it may be useful to measure the noise spectrum before settling on a modulation frequency for your lock-in amplifier.

Three views of the noise in the lab:
VI Raw Signals
VI Lock-in
VI Control Panel
1) Electrical noise with photodiode covered (no light).
2) Photodiode pointed at a fluorescent light.
3) Photodiode installed in a melting instrument.

A block diagram of the lock-in scheme is shown below. Implementing lock-in detection requires the ability to modulate the LED output with a carrier frequency and signal processing (in software) to recover the baseband signal. To support these functions, the LED circuit must be modified to include a feedback brightness controller. In addition, the photodiode amplifier must be modified to accommodate the change in signal frequency range. In the VI, you will need to choose all LED driver and filter frequencies to support your design.

Block diagram of lock-in amplifier for DNA melting

LED modulation

LED driver circuit

The LED used in this lab can operate up to 30mA of current when driven to its full range. In Part 1 of the lab you had used roughly the full 30 mA. For Part 2 you will drive the LED with an op-amp which will limit the current to about 10 mA. LED radiant flux — your excitation light — is proportional to current, so we will implement a controlled current source and direct it through the LED to provide a stable sample excitation.

To implement the current source to drive your LED, you will use an LM741 op-amp[1], with the output connected to the LED and a current sensing feedback resistor. The feedback setup allows controlling the total current through the LED. The feedback voltage is directly proportional to the resistor current and because of our choice of resistor value, the current through the LED is proportional to the voltage applied to the op-amp positive input by the DAQ. (Remember the golden rules.) So we are easily able to control the current through the LED, and likewise able to control the excitation light delivered to our dsDNA specimen. This means for a sinusoidal input, the excitation and therefore the fluorescence emission will also be sinusoidal.


Warning.jpg As before, double check your wiring before powering the LED. The LED can be damaged by excessive current. Reduce the offset and amplitude of your driving current to protect the LED as well as to minimize photobleaching.


Adjust photodiode amplifier gain and add high-pass filter

For Part 2 of the lab you will want to make some adjustments to your amplifier circuit. Principle among these are the adjustment of your low pass filter on the first stage and the addition of a high pass filter between stages. In Part 1, you were amplifying an essentially constant signal, aside from it's slow variation as the dsDNA denatured. Thus your low-pass filter in stage one was most likely tuned to remove noise at 60 Hz and above. In Part 2, the LED excitation light is modulated at a frequency much greater than 60 Hz and therefore the fluorescent emission from the SYBR Green is also modulated. You need to modify this low-pass filter to allow the modulated signal to get through the first stage.

Next, since the 60 Hz, 1/f, fluorescent light switching and other noise sources are likely lower than your LED modulation carrier frequency, you will want to insert a high-pass filter as shown in the updated schematic below. Think about the frequencies of the noise sources and your carrier frequency and choose an appropriate filter cutoff frequency.

Also be sure to re-evaluate the way in which you have gain distributed between the two stages. Now that the op-amps are responding to higher frequency signals, additional non-ideal characteristics may come into play. Among these is the fact that the op-amps can only slew their output voltages at a certain rate. Because this limited slew-rate limits the peak-to-peak voltage that can be achieved over small time scales, the maximum gain that can be achieved will likewise be limited. Review the datasheet for your LF411 op-amps, dig around online or in the course reading materials, talk to an Instructor or TA, and research the "unity gain bandwidth" or the "gain-bandwidth product." The gain-bandwidth product is only applicable to the op-amp's use in the typical non-inverting or "voltage-in voltage-out" inverting topolgy. However, a white paper has been written that applies this spec to the transimpedance architecture. The white paper is available on Stellar under Materials.

Multi-stage photodiode amplification circuit

Update your PC data acquisition system

Update the DAQ connections

In the DAQ connections inset above, the "Fan" connection is a 0 or 5 V signal from the DAQ, controlled by the Lock-In GUI. The "Heat/Cool" connection is a 0 or 5 V signal, also sent by the DAQ and controlled by the GUI, that tells the heater/cooler logic circuits to either heat (high, 5 V) or cool (low, 0 V). The DGND slot next to both the Fan and Heat/Cool connections should be connected to the digital ground of the DAQ, which is provide using the bare wire from your DAQ connector, as described in the handout.

Next, the "On/Off" connection also accepts a 0 or 5 V signal from the DAQ. However this signal is provided a square wave of varying duty cycle. This approach forms the heart of PWM power control. When the signal is high, the power switches in the large BTN7930 half-bridge chips are configured to allow current to flow through the TEC. The Heat/Cool signal controls the direction of power flow as noted above. When the On/Off signal is low, no power flows through the switches in either direction, when it is high, power will flow. A control loop inside the Lock-In GUI implements a Proportional-Integral-Derivative (PID) controller to set both the On/Off pulse widths and the Heat/Cool signal level in such a way as to maintain a desired temperature, or follow a desired temperature profile in time. The frequency of this duty cycle is pre-set at 10 Hz so that its overtones do not interfere with the typical 10 kHz LED modulation frequency of your lock-in amplifier. If you choose a different LED modulation frequency, you may want to adjust the PWM frequency as well. The two half-bridge chips, connected and controlled as they are here, form what is called an H-bridge. If you want to know more, please ask an Instructor or TA.

Signal Name Signal Location Ground Location Pin wire color
DAQ Inputs
RTD AI0+ AI0- +Orange / -Black
Photodiode AI1+ AI1- +Green / -White
DAQ Outputs
Fan P1.1 N/A Orange
Heat/Cool P1.0 N/A Red
Digital GND DGND N/A Black (bundled with Red/Orange)
Heater/Cooler On/Off CTR0 DGND/AOGND +Green / -Blue or -Black
LED Modulation Carrier AO0 AOGND +Yellow or +White / -Blue

The DAQ connections and cable wire colors are also summarized in a memo.

DAQ Connection Cable

Update and test the Lock-In GUI

Data acquisition and control is done by the "Lockin DNA Melter GUI", provided for you on the lab computer desktop. Follow the instructions in the GUI to run an experiment.

However, before you run any experiments, verify that you have connected the PCB board to the DAQ and TEC power supply appropriately. First open the Lock-In GUI. Next turn on your +/- 15 V power supply and toggle the LED button in the GUI to verify that your LED circuit works. If not, make a note of it to come back to it later.

Now turn on the Diablotek TEC power supply. Your fan should start at the same time. Any time the TEC power supply is on, the fan will turn on automatically when you first start-up this GUI, it will turn off when you start to heat, and it will turn back on when either the temperature profile enters the cool-down phase or when you click on the cool-down override button in the GUI. The fan is necessary to help your heat sink dissipate the waste heat that is pumped from the top side of the TEC stack during cooling operations.

Finally, click "START" to start a heating cycle. The fan should turn off, the red heating status LED should light up, and the temperature of your heating block should start to respond. Be sure that your TEC power supply is on for this test. You may want to adjust the heating profile for debugging purposes.

Documentation for the Lock-In DNAMelter software is available here: DNA Melting: Using the LockIn DNAMelter GUI

If any of the steps above do not give the expected outcome: Investigate, hypothesize, make an adjustment, and start again at the DAQ connections.


Lock-In GUI screens
Early in melting cycle
Late in melting cycle
Lock-In GUI screens EARLY in a melting/annealing cycle
GUI Raw Signals
GUI Lock-in
GUI Control Panel
Lock-In GUI screens LATE in a melting/annealing cycle (notice large bleaching)
GUI Raw Signals
GUI Lock-in
GUI Control Panel

Measurement bandwidth

The lock-in amplifier software includes a low-pass filter that limits the bandwidth of the final output signal. In the lock-in block diagram above, the input to the filter is number 4 and the output is number 5.

By default, the filter has an impulse response h(t)=1 for t=0 and 0 everywhere else. You can change the frequency response of the low-pass filter by passing a function pointer to DNALockIn in the optional parameter LowPassFilterFcn. The function should take 1 argument and return a vector containing the filter kernel. The argument is equal to the sample rate of the data going in to the filter.

For example, to generate a 256th low-pass filter with a cutoff of 1 Hz using an anonymous function declaration, use this syntax:

DNALockIn( 'LowPassFilterFcn', @(F) fir1(256,1/(F/2)) )
 

Experimental procedure

Modify your instrument to include the lock-in amplifier, temperature controller, and any other improvements you would like to make. Fluorescein and DNA will be available to to use for debugging and bringup. Run several samples and process the data to ensure that your instrument is operating well. Please consume DNA sparingly. Continue improving and testing your instrument until you are satisfied with the results.

When you have completed your modifications, ask an instructor for your part 2 DNA samples. You will receive 1.5 ml each of four samples. Three of the samples will be identified by their sequence, salt ion concentration, and degree of complementarity. The fourth sample matches one of the three identified samples. You will not be told which one.

Use the known samples to characterize and calibrate your instrument. One of the most important characteristics of your instrument to measure is the variability of results. One way to characterize variability is to repeatedly measure a sample and report the standard deviation of the results. At minimum, you should measure one of the known samples three times. Running a single sample in triplicate is adequate for purposes of your lab report; however, a much more thorough procedure would be necessary to characterize the performance of your instrument over a wide range of conditions. What kind of experiments would you do if you were asked to develop a detailed specification for your instrument? If you have the time and inclination, run additional experiments to better quantify your instrument's performance.

Finally, use your instrument to identify the unknown sample. You must report a quantitative measure of your confidence in your answer. Since the variability of your instrument is not be completely characterized, it is a very good idea to run the unknown sample at least three times.

Measure SNR

Carry out a test of the signal to noise ratio (SNR) of your instrument by inserting a fresh sample of dsDNA and then running the GUI, SNRLockIn.m, provided under the CourseMaterials/Labs/DNAMelting folder. Run this GUI with your desired operating conditions until the strip chart at the top of the screen is full of good data, and click "Save Data" to record this data to disk. Next, open Matlab, load your file into an array and run its transpose through the SToNCalculator.m function provided, using no semicolon after the function name. This function will output graphical representations of your data along with your calculated SNR numbers. Your instrument will be rated based on its "Adjusted SNR."

Opportunities for further development

For those so-inclined, there is much fertile ground for further improvement of both the instrument and our understanding of the physical processes involved. We welcome your interest in pursuing such improvements. Some possibilities are listed here.

  • There is another method for controlling the heating profile of your DNA sample. It so happens that the heater/cooler board has been designed as a "shield" for an Arduino controller board. An initial version of software for that purpose has been tested and debugged. One next step that could be to integrate the Arduino controller into the over-all Lock-In GUI. See us if you are interested.
  • You will fit a multi-parameter model to your data. One primary weakness in our implementation of such a model at this time involves the convective heat loss term in the transfer function of the heating lag model between the block and the sample. We have some ideas to address this. If you do also, or would like to hear more, please see us.
  • Also, to do a DNA melting curve properly, one must heat (or cool) the sample extremely slowly. If we tried this with our current approach the sample would be far too bleached by the end. One method to address this would be to revise the Lock-In GUI so that the LED turns only briefly, and only after temperatures have stabilized to eliminate the lag between block and sample. If you are interested in tackling this, please see one of us.
  • Next, we do not believe that we have a fully-developed bleaching correction for this experiment. You may agree after trying your hand at this correction. If you would like to investigate further, please see one of us.
  • Any and all other ideas for improvement will also be given fair review!

Lab manual sections

References

  1. LM741 Op-amp datasheet

Datasheets

  1. SYBR Green I datasheet
  2. LF411 Op-amp datasheet
  3. LM741 Op-amp datasheet