E80
Experimental Engineering
Experimental Engineering
Team size: 2
After successful completion of this lab, you will be able to…
Design an operational amplifier circuit to appropriately scale and shift an input from a sensor to be read.
Explain why operational amplifiers are needed for making measurements
The purpose of this lab is to use operational amplifiers to build a turbidity meter, a sensor that measures physical quantities that are often of interest in the ocean. The lab will require sensor design, circuit design and experiment design. Extra credit sections offer the opportunity to explore many other interesting marine sensors. The main take away from the laboratory is that operational amplifier circuits can be used for a variety of sensing applications and that careful sensor design is necessary to achieve repeatable results.
This lab will be carried out as sub-teams of two. As discussed in the class Home page, teams of 4 will be assigned by the instructor. Before this lab you must decide how you will split your team. Two other labs will also be completed as sub-teams, and you must use a different sub-team for each of these labs. Each sub-team will be responsible for its own version of the lab's deliverables. Pre-lab work may still be carried out with your whole team but be sure each sub-team is ready to tackle the in-lab work independently. Between lab and Friday (the post-lab period) the two sub-teams in a team may discuss their experiences, but the sub-teams may not share data, code or text with one another.
It is up to the sub-team to determine which parts of the lab are done by whom, and at what time during the 4 hours of lab time. A work breakdown showing what each team member intends to work on during the 4-hour lab time is required for entry to the lab. The work breakdown will be submitted on paper to the lab instructor or proctor at the start of lab. Here is an example work breakdown. No hardware can be used outside of lab hours and no real data can be processed outside of lab hours. However, writing software or processing simulated data sets is allowed and, in fact, encouraged during the pre-lab period.
For pre-lab purposes, a sample submission sheet that contains all of the questions and requirements on the submission sheet is here.
You will work with some expensive hardware in this lab and in many future labs. This hardware needs to be explicitly checked out from a professor or proctor so that we can track where it is. If any hardware that you checked out breaks, then you will need to request a replacement from a professor. You make this request by filling out an error report (paper copies will be in lab). This report needs to be well thought out. Professors will reject reports that don't represent sufficient testing or thought. You will keep this hardware with you throughout the semester in your storage box.
There are four extra credit sections. They would make the lab too long for most teams of two to complete. If you complete the required sections, you may attempt any or all and include the results in a separate written document summarizing your findings. We DO request that you remember the extra credit sections in this lab when deciding on instrumentation for your final project.
This lab will often call upon you to prepare solutions or handle chemicals. Though we aren't working with anything hazardous (or which can't be flushed down the drain), be sure to observe good chemical hygiene practices and use gloves and goggles when handling chemicals or sensitive equipment. Notably, always use gloves when handling any glassware that will go into the turbidity meter.
There are a few resources used in this lab which must be shared. Please respect others and don’t abuse these resources. All the teams in lab are going to have to share a single turbidity meter and beaker of mystery solution. There will be three digital scales available. For Extra Credit 1, we have a limited supply of buffer solutions which must last for all our labs, so don't pour out more than you need to cover your pH probes and be sure to use the smaller set of beakers.
Read the datasheets for the TL081, OP07, MCP601, and MCP6004. Find the following values: single rail or dual rail, maximum supply voltage, minimum supply voltage, positive input pin, negative input pin, output pin, open-loop gain (which is A from our class videos), maximum input voltage.
Read the datasheet for the AD623. The AD623 is a type of amplifier called an instrumentation amplifier which is similar to an operational amplifier. Is the AD623 single rail or dual rail? What is the input impedance of the AD623? What is the maximum gain of the AD623? Note that the datasheet reports a gain for the AD623 and NOT an open loop gain: the AD623 isn't a simple op-amp.
First, use an MCP601 to build a single-rail non-inverting amplifier with a gain of two. Be sure to stay within the supply voltage limits you found earlier when powering it. Exceeding the supply voltages is a sure way to destroy the op amp. Apply the following signals to the amplifier input: a 100mV amplitude sine wave with a 1 V offset, and a 100 mV amplitude sine wave with a 0 V offset. What do you observe at the amplifier's output and why?
Use an MCP601 to build a single rail inverting amplifier with a gain of five. Apply an input sine wave to this amplifier that obeys the input voltage limits you found earlier. What output do you observe and why? After observing the output of a standard inverting amplifier, use offset amplifier techniques to observe a sine wave at the output. What resistor values did you use for your inverting amplifier? Describe your offset circuit.
We will be using voltage dividers and op-amp circuits to demonstrate how op-amps can reduce instrument loading.
Build the circuit shown here using values of Z1 and Z2 specified in case (A) and case (D) in the table here, Measure the outputs of these circuits with an Elenco (you may ignore all of the other measurement tools in the table. You may find this reference useful.). Calculate the expected output of this circuit including instrument impedances (for our purposes the DC resistances of the instrument inputs and/or outputs) and compare with measurements.
Replace the circuit in Case (A) of the table on your breadboard with this circuit and repeat your measurements. Power the op-amp with ±15 V. Compare and contrast your results from Case (A) with your current results. What is the function of the op-amp in this measurement?
Replace the circuit in Case (D) of the table on your breadboard with this circuit and repeat your measurements. Power the op-amp with ±15 V. Compare and contrast your results from Case (D) with your current results. What is the function of the op-amp in this circuit?
It may help to read up a bit on how the type of circuit you load the op-amp with affects the op-amp impedance. See this link.
Turbidity is an optical measurement which is related to the total undissolved solids in the water, which is an important environmental monitor since undissolved solids can be indicative of eroded runoff, disturbance of the sea floor or other sources of particles. In contrast, salinity (Extra Credit 2) is a measurement related to the total dissolved solids in the water. Because of time constraints we’ve relegated it to Extra Credit 2.
Modern electronic measurements of turbidity are measured by shining light through a sample and measuring transmission — how much light passes directly through — and 90° scattering — how much light bounces off the particles to a sensor located at 90° relative to the light source. Devices which measure only 90° scattering are called nephelometers, and devices which measure the ratio of the 90° signal to the transmitted signal are called turbidity meters or turbidimeters. The relative effectiveness of the two devices depends on exactly how many solids are in the water.
The device you build will compare transmission against 90° scattering to make a prediction of turbidity. You will use an IR1503 IR LED as a light source and two OP950 IR photodiodes as sensors. Why use IR instead of colored light? (Hint: what if the suspended particles were a mix of red clay and green organic matter?) What is the emission wavelength of the IR1503? What is the wavelengths of peak sensitivity of the OP950? This reference provides background information on LEDs and photodiodes. Note that IR LEDs are invisible to the human eye. You'll need a photodiode or an IR-sensitive camera, like some cell-phone cameras, to tell if it is on.
This link has some additional information about turbidity, including a picture of some suspensions of different turbidity for visual reference.
The current through a photodiode is linear in irradiance, so measuring the current passing through a photodiode is equivalent to making a linear measure of incident optical power. Operational amplifiers can help with this, but this is different than the voltage-amplifying operational amplifier configurations that we have observed so far. This schematic, depicts an operational amplifier configuration called a transimpedance amplifier that measures current. Analyze this schematic so that you understand how transimpedance amplifiers work. An equivalent circuit for the photodiode can help when analyzing this circuit: under illumination the photodiode looks like a current source pointing away from the amplifier.
Design and test your own transimpedance amplifier using an MCP6004 for your turbidity meter. Configure any unused op amps in the MCP6004 as unity gain buffers with the input connected to ground. Note that flipping the leads on the photodiode reverses the current direction and the sign of the output voltage; if the output voltage appears to be 0 on a single supply op-amp, try flipping the photodiode and see if the voltage appears. The photodiode in the schematic above is correctly oriented. Report the value of R1 that you picked. A quick experiment using only a scope, a photodiode, an LED, and power for the LED (see the next paragraph) might help you to estimate the currents in your system.
Note: Transimpedance amplifiers can be designed in many ways. The design we are recommending that you use is not the highest-speed design, but it does have excellent low-noise characteristics. High-speed designs will reverse bias the diode to reduce its junction capacitance (a type of parasitic capacitance found in all diodes) and add a capacitor in parallel with the feedback resistor to filter out noise. However, applying the reverse bias makes current flow the other direction, which would require that the op-amp be dual rail or have an offset to ensure correct operation. This design is the simplest for a single-rail system, and it doesn't lose performance when measuring large, slow signals like ours.
We are going to power our LEDs using an alternating current signal. You will produce this signal using a 555 timer in astable operation mode. Using the reference information in the datasheet, select resistors such that the 555 timer output has a frequency between 500 Hz and 1 kHz and an output waveform duty cycle (ratio of high time to sum of low time and high time) of 3/5 (60%). Then build your 555 timer and verify that it produces a square wave output. Why are we having you use alternating signals in your LED instead of just using a DC input for the LED and reading the DC outputs of the photodiode circuits?
LEDs, like all diodes, have an exponential relationship between the voltage applied across them and the current that passes through them. That means applying voltage carelessly can easily blow them up. We are going to fix that by installing a resistor in series with our 555 timer output. You will connect a resistor and the IR1503 in series between the output of the 555 timer and ground. Read the IR1503 datasheet to find the voltage-current relationship for the diode and pick values of Vcc and the series resistor that will result in 20-40 mA of current. Build it, and then check that your LED + 555 timer assembly is working by shining it at a photodiode and observing a signal of appropriate frequency.
Now it is time to assemble and use the turbidity meter. There is a two-piece fixture for holding the cuvette, LED and photodiodes. The instructions for its use are here. Use a cuvette to hold your solution. You should not need to fill it more than 1/2 full. Place the LED and photodiodes in the fixture, secure the fixture to your bench top (perhaps using the base legs with blue tape, electrical tape, or double-sided tape) and connect the components to their circuits in a reliable manner. Soldering long wires to your components or using female-female jumpers may help, but you may also be able to use a breadboard as a base and put component feet directly into it. (For reference: The Solidworks part for the fixture base is here and the Solidworks part for the fixture cover is here.)
Prepare a set of solutions of different turbidities using milk and water. Eyedroppers or beakers may help you to add more precise volumes of milk to your solution. Check the turbidities of your solutions using the TU-2016 calibrated laboratory turbidity meter. Be sure to read the instruction manual to familiarize yourself with the operation of the meter before using it. Never touch the glass of the turbidity testing containers with your fingers (why?). You may need to perform a calibration on the laboratory turbidity meter to get best performance, be sure to sanity check the measurements it produces before measuring your sample. DO NOT EVER OPEN THE CALIBRATION STANDARDS.
Measure your solutions with your own turbidity measurement setup. Examine the effect of ambient light on your measurements. Plot the ratio of the 90° Vpp to the transmission Vpp against the calibrated turbidity of your solutions (recall that the turbidity is calculated from the ratio of the 90° signal to the transmitted (straight through) signal). Add a line of best fit and appropriate uncertainty measurements.
All labs require two submissions per group. The first submission is a submission sheet in which specific data must be shown. The submission sheet is due at the end of the 4-hour lab period and must be uploaded before the end of your lab session at 5:15 pm. Note that only ONE member of each team should access and submit the submission sheet. It is the responsibility of that team member to add the rest of the team’s names to the submission sheet.
For pre-lab purposes, a sample submission sheet that contains all of the questions and requirements on the submission sheet is here.
The second submission is a writing assignment, usually around 1 page in length. Each writing assignment will be based on a prompt and must be completed by each student individually; no collaboration is allowed on the text or figures in these assignments, though you may speak among yourselves about concepts in keeping with the collaboration rules of the course. A first draft of the writing assignment must be uploaded by noon on Friday, and you need to bring a printed copy of your draft to the writing and reflection section on Friday at 1:15 p.m. During the first hour of the writing and reflection, you will engage in a peer editing exercise. The second hour of the Writing and Reflection section is reserved for you to edit your draft to produce a final draft of the writing assignment. This final draft must be uploaded before the end of the Writing and Reflection section on Friday at 3:15 p.m. Since multiple submissions are permitted, and only the last one is graded, you may want to submit a draft at 3 p.m. as insurance. The writing assignment is based on this prompt. This is the peer feedback worksheet.
Note that the rubric is included in the prompt.
Recall that no late work is accepted, we will grade whatever is submitted oat the deadlines.
After the writing and reflection section at the end of each week every person (not just one person per team) must submit a team dynamics check-in survey. These are part of your participation grade. The survey link can be found on the home page.
pH needs no introduction, but in oceanography it can be an important indicator of acidic runoff from the surface. The pH of the water also has a strong impact on the health of various plant and animal species, notably coral. You will build a circuit to interact with a pH sensor and calibrate it against buffer solutions.
You will be using buffer solutions in this portion of the lab and they are relatively expensive chemicals. Use the smaller 50mL beakers to hold buffer solutions at your station and take pains not to spill any buffer solution when pouring it from the main supply. Buffer solutions may be rinsed down the sink when you are done with them.
Find a Pasco pH electrode. These electrodes are generally used with interface boxes provided by Pasco (the Pasport system), but we are going to be hooking circuits directly to the BNC connector of the pH probe. The pH probes are delicate instruments, so be sure to always re-cap them in a bath of pH 7 buffer solution and never leave them sitting exposed to air. Rinse them in a bath of deionized water and shake off any excess droplets before returning them to buffer solution.
The probes need special care to make repeatable and accurate measurements, so a few experimental tips will help you to get consistent results: stir the probes gently when you first immerse them in a bath, be sure to wait for the probe voltage to stabilize when taking a measurement because their time constants are long, and keep your hands away from the probes during measurement because the unshielded connections are sensitive to noise that can couple in through your body.
Measure the output voltage on the BNC connector in pH 4, 7 and 10 buffer solutions with a multimeter. What values do you observe?
You are going to attempt to improve the voltage swing achieved with these measurements by using a circuit. Your choice of circuit depends on the output impedance of the pH probe, consult this application note to get a ballpark estimate for the output impedance and report it. Also, read this reference, a handy guide to the operation of pH sensors, and then describe the physical mechanism which explains the value of the output impedance for this sensor.
Use a TL081 to interface with the pH sensor to achieve a voltage swing of at least 1V between pH 4 and pH 10. What circuit topology did you use and why? Describe your interface circuit.
Measure the voltage your interface circuit produces when the pH sensor is immersed in pH 4, 7 and 10 buffer solutions. Use these measurements to make a calibration plot and add a line of best fit with appropriate quantification of uncertainty. Use your sensor and the line of best fit to determine the pH with confidence limits of the mystery solution in the middle of the room. There is only one small flask of mystery solution that should last for all teams in all sections. DO NOT pour the contents of the flask into another beaker! Rinse off your probe in distilled water. Uncap the mystery solution. Test the pH in situ. Remove the electrode and recap the solution. Rinse off your electrode and store it properly.
Salinity is a measure of the total dissolved salt content of water. It is an extremely important and common measurement in oceanographic studies. Salinity measurements are used to track the flow of water and map the hydrological cycle, calibrate acoustic communication links, and understand biological phenomena like algal blooms. In this section you will build a sensor to measure salinity using an inverting operational amplifier. You will prove that it works by calibrating it against saline solutions with different salinity.
In order to design your sensor, you need to know reasonable values for what you're trying to measure. Your sensor will measure conductivity and the measured value will be used to extract salinity. Find the salinity and conductivity of the ocean using any resource you choose. Note that the equivalent circuit model of a saline solution whose value depends on the separation of the probe electrodes and the salt concentration (why?) is a resistor in parallel with a capacitor. We will ignore the capacitor for this extra credit section, but it is critically important in a design for the final project. You may want to read this reference for further information.
Design an inverting operational amplifier circuit using one or more TL081 op-amps which has an output voltage that is linear with the conductivity of your solution. Be sure to consider source and load impedances when designing your circuit. Ensure that the output voltage of this circuit will vary over a wide voltage range for the range of saline solutions that you plan to use for calibrating your circuit. This design depends on some of your experimental parameters including the separation of electrodes and the conductivities of the solutions you intend to measure.
One thing to be careful of when measuring salinity is that salt, water and electrons will undergo chemical reactions which can deposit metal salts on your electrodes. These salts can form non-conductive films which stop your conductivity measurements. What kind of waveform should you apply to your circuit in order to make a measurement stable over time? This chemistry can also cause your circuit to fail if the electrode area is too small or the voltage applied to the solution is too low.
Prepare an experimental setup that will allow you to measure the conductivity of salt water. You have access to beakers, wire, electrical tape and digital thermometers. Prepare a set of saline solutions to be used with this setup which are sufficient to prove the sensor is linear. Graduated cylinders would usually be used to measure the volume of water in these solutions. Those are not available to you, so instead you will need to use the digital scales and the well-known relationship between the mass and volume of water. What is that relationship?
Record a calibration curve for your sensor which plots the voltage output of your sensor against the concentration of your salt solution in units of grams per liter on logarithmic X and Y axes. Find a line of best fit including appropriate uncertainty measurements. Then use your sensor and your calibration curve to measure the salinity of the mystery salinity solution on the central table.
Note: You may use this resource to convert from a measured conductivity to salinity and this resource to convert from salinity to conductivity.
Writeups for this extra credit section are not counted against the page limit of your report. You may submit this as an additional document labeled "Lab 3 salinity extra credit addendum."
In this section you will replicate the pressure circuit on your E79 board to understand its operation. After that you will modify the sensing circuit to optimize the range of the output voltage for the graduated cylinder test that we have used to test pressure sensor operation.
Analyze this circuit and select values of R1, R2 and R3 such that output voltage will swing from 1V to 4V when you apply a pressure varying from atmospheric to 50cm below water. Implement the circuit using the MPX5700 pressure sensor and the MCP601 op-amp, which are the devices used on the E79 board. Use Vdd=5V. Why is the pressure sensor attached to the positive input of the amplifier?
Create an experimental setup to vary the pressure on the sensor using a large graduated cylinder, water and plastic tubing. Create a calibration curve relating your measured voltage to the applied pressure, and include appropriate measures of uncertainty.
Return the pressure sensor to stock when you are done with it under pain of a grade penalty and be careful not to damage the pins while using it in your breadboard.
Writeups for this extra credit section are not counted against the page limit of your report. You may submit this as an additional document labeled "lab 3 pressure extra credit addendum."
In this section you will do true synchronous detection like you would do when using the Teensy on an AUV. In true synchronous detection, the excitation is generated by a modulated or chopped signal of known (measured) frequency. In our case we're using the signal generator to modulate the LED. In some cases, a slotted wheel is spun at a known frequency in front of a constant light source to provide the modulated signal. Either hardware or software is used to generate two constant-amplitude signals at the same frequency as the excitation signal. One is a sine wave in phase with the excitation signal and the other is a cosine wave 90° out of phase with the excitation signal. Each measured response signal (in our case the directly transmitted and the scattered signals form the photodiodes) is multiplied (either by analog or digital means) by the sine and the cosine signals. The two resulting signals (per measured input signal) are lowpass filtered with a cutoff frequency of at most the modulation frequency, and perhaps much lower if a great deal of noise reduction is required. The lowpass-filtered signals are then added in quadrature (square root of the sum of the squares of the signals) and if desired, the phase is calculated as atan2(sin signal, cosine signal). In our case, the phase information is not needed, and the ratio of the scattered quadrature signal to the transmitted quadrature signal is used to calculate the turbidity. In practice, lock-in amplifiers are used to recover signals that are -60 dB below the noise floor. In other words, the noise amplitude is 1000 times the signal amplitude.
For this extra credit, you need to wire up a connector to input three analog signals to your motherboard (a scaled and shifted reference signal, the 90° scattered signal, and the transmitted signal; all scaled and shifted to fit into the 0-to-3.3 V input range of the Teensy), and then log the three signals onto your microSD card and then modify LockInTest.m to process your results. You may need to consult with a proctor or professor to find out how to wire the motherboard or Teensy for three analog inputs, and for access to the basic robot package, that has code for high-speed data logging to the Teensy.
Writeups for this extra credit section are not counted against the page limit of your report. You may submit this as an additional document labeled "lab 3 synchronous detection extra credit addendum."