Gas station without pumps

2014 October 2

On senior theses

Filed under: Uncategorized — gasstationwithoutpumps @ 10:07
Tags: , ,
Today is the first day of classes for us, but I’ve already been busy advising both new and returning students. Last week I sent out an e-mail message to the bioengineering and bioinformatics undergrads explaining the senior capstone options. I’ll probably have to send out a similar message each fall, so I thought I would save it here, where I can find it again.  It also might be useful for students and faculty elsewhere, as a lot of the advice is generic for any student starting a research project, though some is specific to our program and even to this year.
A lot of bioengineering seniors are starting senior theses now, a few bioinformatics seniors are, and most juniors will be spending a fair amount of time this year looking for a lab or a senior project, so I thought I’d address a few of the common concerns.  (I’m copying the BME faculty on this message, so they can see what advice I’m giving students.)

Bioengineering, bioinformatics, MCD bio, and other departments all have different expectations or requirements for their capstone projects (which can include senior theses).  I can’t talk for any programs except bioinformatics and bioengineering.

bioinformatics

The bioinformatics capstone is generally satisfied by the project-based grad courses that are required, but some students (20%?) also do a one-quarter or more research or development project as a senior thesis.  These theses, since they are for short projects and not an essential part of the capstone are generally fairly informal, and only 20–40 pages long.  Students planning to go on to grad school are often well advised to do research projects, and the senior thesis is one mechanism for doing that.

Because bioinformatics theses are informal and not very common, most of this message will be about bioengineering theses.  Bioinformatics students may want to look through this message for ideas about how to join labs and find projects to do, but the main audience is bioengineering students.
bioengineering

Bioengineering senior theses are longer and more formal than the bioinformatics ones.  The research projects consist of at least 3 quarters of BME 195 plus BME 123T in Winter quarter (so 17 units, rather than 5 units for a bioinformatics thesis).  Partly this is because wet-lab work is much slower than computer work—turnaround time for an experiment may be days or weeks, rather than minutes or hours.

thesis or group project?

Bioengineering students have the option of doing a group project for a capstone (BME 123A/B) or a senior thesis.  Those planning to go on to grad school should probably choose the thesis option, as it is better preparation for grad school.  Those planning to go into industry may be better off with the group project, though a senior thesis can also be good preparation for industry work.

If you have an idea for something you want to design and build, and can interest other students in working with you, forming a team project may be the best way to go, as faculty generally are more interested in getting help with their many research projects than with close supervision of a student-initiated project.  The BME 123AB and CMPE/EE 129ABC courses are a good umbrella for student-initiated group projects.
finding a lab and a project
No one is going to hand you an assignment and say “do this as a senior thesis!”—you have to find the project yourself.  But we don’t expect novice researchers to come up with great ideas alone (some students do come up with great ideas, of course), and so there is help in finding projects.  Generally students find projects by working with grad students, postdocs, faculty, and other researchers in a lab, and chipping off part of a bigger project that the lab is working on.  It is possible to come up with your own original project and convince a faculty member to supervise it, but that is more commonly done as group projects than individual theses, because most interesting projects are simply too big for one person to do in one year.

For the usual method to work, you need to be in a lab before you start your senior thesis.  Generally, that means finding a lab and working in it your junior year.  Bioengineering students work in labs all over campus—almost any department in the School of Engineering or the Physical and Biological Sciences could have a bioengineering project (and there are some in Social Sciences as well).

So first you need to find out what research on campus is happening and what interests you—that should start freshman year. One good way to find out what is happening in research is to attend research seminars—every department has one, generally weekly.  These are free public seminars, which you can attend without being a member of the department, signing up for a class, or anything else formal. Many of them are also listed as courses on the class schedule, so that rooms can be assigned and grad students can get credit for regular attendance (you can sign up too, if that will help you attend regularly, but make sure that you do attend regularly if you sign up—failing a no-work class for failure to show up sends a really strong message to faculty and future employers).  I particularly recommend BME 280B, the BME department seminar,  in fall quarter, since it is dedicated to showing new grad students the range of research projects available for their rotations. (Other quarters usually have different themes and other departments have different ways of organizing their seminar schedules.)

Don’t limit yourself to BME, though, as the department is too small to have enough undergrad lab positions for all the bioengineering students—bioengineering students have also worked with faculty from MCD bio, Microbiology and Environmental Toxicology, Electrical Engineering, Computer Engineering, and probably several other departments.  Some students have even taken summer research positions elsewhere and expanded those projects into year-long senior theses.

Once you have identified some research teams that look like they would be fun to join, do some homework: read the papers coming out of the group, look at their posters on the walls, talk to students who work in the lab. Once you have a fair idea what questions they are addressing and what techniques they are applying, send email to the head of the lab (often referred to as the “PI”, which is jargon for “Principal Investigator” on grant applications).  Don’t ask immediately for a senior thesis, but introduce yourself and ask if you can sit in on lab group meetings.

You may need to check out several labs simultaneously your junior year, which can take a fair amount of time in a year when you have a fairly heavy course load.

After you have been attending for a while, you might see a project that no one in the lab has time to do (there are always more ideas than time to follow up on them in a good research group).  If the lab group still seems interesting after several meetings, arrange a meeting with the PI to try to outline a possible project for you to work on.  Generally this will be a fairly small project that could grow into a senior thesis, as the PI will not want to commit the resources for a full-year project until you have proven that you are competent and reliable.

switching from finding a lab to senior thesis

Once you have  project identified and a faculty member willing to sponsor the project, you need to write up a 1–2-page proposal outlining the project and submit it to the undergrad director (that’s me).  I have not yet denied any senior thesis proposal, but the exercise of getting down in writing what you plan to do is a very important one, particularly for communicating with your PI about the scope of the project, so I’m not going to treat these as unimportant paperwork.

If the PI has not previously supervised a bioengineering senior thesis, I want to talk with them (at least by e-mail) so that they have a clear understanding of our expectations for a senior thesis (which may be quite different from the expectations in their own department—note the huge difference between a bioinformatics and a bioengineering senior thesis, even within the BME department).

The proposal should be submitted the quarter before the 3 quarters of BME 195, which generally means in the spring or summer for projects that run FWS.

We are planning to create a 2-unit “pre-capstone” course this spring to aid students in putting together group projects and senior thesis proposals.  The course is optional, but is likely to be very useful in crystallizing somewhat vague ideas into productive capstone projects and forming working groups.
what is a bioengineering senior thesis?

A bioengineering senior thesis is modeled after a PhD thesis.  It is obviously smaller (a one-year project, not a 3–7-year project), and a senior thesis does not have to be “novel work” in the sense that a PhD thesis does.  You can do an implementation of someone else’s idea for a senior thesis, but there should be substantial engineering or scientific thought on your part—you should not be merely “hands in the lab”.

A bioengineering thesis can be either a scientific one or an engineering one.  The details of what you do in the lab are similar—the difference is mainly in the goal.  A scientific thesis tries to answer a question about the real world: “what does this protein do? what is the evolutionary history of this virus?”, while an engineering thesis has a design goal “how can I move DNA slowly through a nanopore in 3M KCl? How can a get a halophilic microorganism to produce substantial quantities of butanol?”  You may end up using the same lab techniques for either sort of thesis, and you can often spin the same project as either a science or an engineering project (a lot of “science” is really engineering new lab methods, and a lot of “engineering” requires discovering new science).

Since the bioengineering major is an engineering major, I try to help students view their projects as engineering projects, especially when they are working with a PI who sees them as science projects, but there is no requirement that a bioengineering thesis must be one or the other—either is acceptable.
format of a thesis

You must write up what you do in the format of a thesis: start with a brief statement of the design goal or research question, give a detailed background on what other people have done in the past and why the problem you are tackling is important, then give a detailed description of all the design or experiments you do, including the ones that fail (and how you debugged the failures).    You do need to distinguish clearly what you do from what other people on the project do—a thesis should be written with “I” not “we” (which is different from multi-author journal papers), because the purpose of a thesis is to establish your individual research abilities.  Avoid using passive voice for the same reason—we want to know what you did, not just what was done.  When you use passive voice in a thesis, you are denying that you did it, but failing to tell us who did.

You should be writing a draft of your thesis every quarter of BME 195 and submitting it to the PI for feedback on both the content and the writing.  The first quarter should result in a draft that has a clear statement of the research question or engineering design goals, a thorough literature survey explaining what other people have done and why the question or goal you are tackling is interesting and important, and a research or development plan for how you will answer the question or achieve the design goals.  Each subsequent quarter will result in editing and rewriting big chunks of the thesis, and replacing the research plan with the research results.

The audience for your thesis is not your PI, nor even other members of your lab team.  It is other bioengineering students who might want to join the team—so you can assume that your audience has a basic knowledge of biology and engineering, but not of the specifics of your lab team’s approach.  You need to define jargon the first time you use it, and you need to give a brief intro to any techniques that you use that aren’t covered in the required courses for bioengineering students.

A thesis is not a lab notebook or a lab protocol handbook (though you may wish to give detailed protocols in an appendix to the thesis).  We are interested in the engineering thought, not how many microliters of this or that you mixed for how long—unless your engineering is optimizing the protocol, in which case we need to know why you increased or decreased pH, temperature, salinity, or whatever else you were manipulating to do your optimization.

A thesis is not a journal article.  Journal articles are very limited in space, so are carefully trimmed and edited to remove any dead ends or interesting side trips that don’t appear to contribute to the final result. A thesis should include discussion of the entire project, including the side trips and dead ends.  We want to see how you solved problems, not just the final solution, which is all the journal article usually has room for.

In BME 123T winter quarter (generally in the middle of the thesis research), we will go through several drafts of your thesis, with detailed feedback on the writing (and somewhat less on the content than the PIs are expected to give).  You should be starting Winter quarter with a complete first draft (some parts will still be plans rather than results, of course), and coming out of BME 123T with an almost complete final draft, so the spring quarter can be dedicated to finishing the research, with only a few new results to be written up.

presentation requirements

The new curriculum requires a senior portfolio containing at least two projects, one of which is your capstone project.  (The other project is generally a small one from one of your required courses.)  The portfolio also requires PDFs of three different presentation modes: a final paper, slides for an oral presentation, and a poster.  You need to make sure that you have examples of all three formats for your senior portfolio—if you are missing one at the beginning of your senior year, find a way to create it during the year.

Everyone should be producing a poster for their capstone for the undergraduate symposium in the spring (though posters produced for other venues can be included in the senior portfolio instead).  The senior thesis requires a final paper and the group projects generally require an oral presentation.  BME123T is expected to concentrate mainly on the written report format, but if students need poster or oral presentation opportunities, the course can be used for those as well.

The BME department has agreed to pay for undergrad posters printed at BELS for senior projects or for conferences for bioengineering and bioinformatics students, but NOT RUSH FEES.  If you miss the deadlines for normal charges, then the rush fees come out of your pocket (unless you can sweet-talk your PI into covering them).

2014 March 16

New phototransistor lab

Filed under: Circuits course — gasstationwithoutpumps @ 00:54
Tags: , , , , , ,

In Phototransistor I talked about one possible phototransistor lab, that looked at the response speed of a phototransistor, as a function of the load resistor.  I rejected that last year as insufficiently interesting for bioengineers.

The lab for phototransistors that I used last year was a “tinkering” lab, where I tried to get the students to play with the hysteresis oscillator that they had built, modulating it with light (see Idea for phototransistor/FET lab). I didn’t think that it was a very successful lab (see Tinkering lab reports show problems), and I’d rather have a lab that seems more directly “bio” oriented.

One lab I’ve not given in class, but have played with a lot at home, trying to find something that works at the right level of complexity for the students is an optical pulse monitor:

Scott Prahl's estimate of oxyhemoglobin and deoxyhemoglobin molar extinction coefficients, copied from http://omlc.ogi.edu/spectra/hemoglobin/summary.gif The higher the curve here the less light is transmitted.  Note that 700nm has very low absorption, but 627nm has much higher absorption.

Scott Prahl’s estimate of oxyhemoglobin and deoxyhemoglobin molar extinction coefficients, copied from http://omlc.ogi.edu/spectra/hemoglobin/summary.gif
The higher the curve here the less light is transmitted. Note that 700nm has very low absorption, but 627nm has much higher absorption.

I played around with the idea some more last week, using a transimpedance amplifier to convert current to voltage (as in Colorimeter design—weird behavior). I can easily get enough gain to see pulse for a 700nm LED shining through a finger, but I listed the “brighter” LED red diffuse 3mm 625nm WP710A10ID part for this year’s parts kit, so I need to test with it (or with LED IR emitter 5mm 950nm SFH 4512). Because I’ll be making the mechanical part of the pulse monitor for the students, I have to know whether a 5mm or 3mm LED will be used.

Because oxyhemoglobin has its lowest absorbance near 700nm, I expect that switching to either 950nm or 627nm will greatly reduce the signal, needing an extra gain of 5.

The mechanical design I’m thinking of using is a simple one: a 3/4″ diameter hole drilled 2″ deep into a 3″-long block of wood that is 1.5″ by 1.5″, with a 1/8″ hole drilled at right angles to accommodate the LED and phototransistor. Carving out a small channel allows the block to sit flat on the tabletop.
The block with LED in the top hole and the phototransistor in the bottom hole. The phototransistor has a bit of rim, necessitating a shallow 5/32" drill allow the phototransistor to go deep enough into the block for the block to sit flush on a tabletop.

The block with LED in the top hole and the phototransistor in the bottom hole. The phototransistor has a bit of rim, necessitating a shallow 5/32″ drill allow the phototransistor to go deep enough into the block for the block to sit flush on a tabletop.

Block viewed from end with 3/4" hole.  The cross hole for the LED (or phototransistor) and the channel for its wires can be seen on the front.

Block viewed from end with 3/4″ hole. The cross hole for the LED (or phototransistor) and the channel for its wires can be seen on the front.

To connect the LED and phototransistor to a breadboard, the leads need to be extended:

I added color-coded leads to the phototransistor and LED, making sure that the negative lead (the cathode for the LED and the emitter for the NPN phototransistor) were given the black wire. Careful folding and crimping with long-nose pliers gives a good mechanical connection.

I added color-coded leads to the phototransistor and LED, making sure that the negative lead (the cathode for the LED and the emitter for the NPN phototransistor) were given the black wire.
Careful folding and crimping with long-nose pliers gives a good mechanical connection.

Next the connections are soldered to make good electrical connections. It will be good for students to do a little freehand soldering, as their other soldering projects use PC boards.

Next the connections are soldered to make good electrical connections. It will be good for students to do a little freehand soldering, as their other soldering projects use PC boards.

Finally, one or both of the connections should be covered with electrical tape, so that the wires don't short.  (The students don't have electrical tape in their kits—I'll have to remember to bring some in.)

Finally, one or both of the connections should be covered with electrical tape, so that the wires don’t short. (The students don’t have electrical tape in their kits—I’ll have to remember to bring some in.)

In order to help me remember which side has the phototransistor and which the LED, I color-coded the leads differently (yellow wire for LED anode, green wire for phototransistor collector), and used colored electrical tape to hold the optoelectronic parts in the block (red tape for the LED, blue tape for the phototransistor—matching their package colors).

I did manage to get  the pulse monitor working sometimes, but it seems to be excessively finicky—I need very high gain with careful setting of the bandpass filter parameters to get a signal. The biggest problem is that the second stage of the amplifier, where I do the high-pass filtering to remove the DC component and slow drift, can end up getting saturated.  Because of the high impedance of the feedback resistor, the output stage takes a long time to recover from being saturated. Saturation is a frequent problem with high-gain amplifiers, but I’m not sure I want students dealing with it on this lab.

Initially, the light is bright and the amplifier saturates at one rail.  When a finger is inserted in the sensor, the light drops enormously, and the amplifier output swings to the other rail.  It takes a very long time (about 30 second here) before the limited current through the feedback resistor can charge the capacitor in the high-pass filter enough to restore the op-amp inputs being the same voltage.

Initially, the light is bright and the amplifier saturates at one rail. When a finger is inserted in the sensor, the light drops enormously, and the amplifier output swings to the other rail. It takes a very long time (about 30 second here) before the limited current through the feedback resistor can charge the capacitor in the high-pass filter enough to restore the op-amp inputs being the same voltage.

The combined gain of the two stages at 1Hz (about the frequency of my pulse) is around 132MΩ, and the output is still only about 0.25V, so the fluctuation in the input current must be around 2nA. That’s not as small as the signals in a nanopore, but it is small enough to be troublesome.

I tried a different set of components that gave me a gain of about 240MΩ at 0.9 Hz, and that amplifier started clipping the output, swinging from around -0.8v to +1.6v.

After the first stage (with a gain of about 1.7MΩ at 0.9Hz and 5.6MΩ at 0Hz), I see about a 10mV swing on top of a DC signal of 0.6 to 0.8v (with considerable drift). That implies about a 6nA signal at 0.9Hz, while the DC signal is about 125nA.  The magnitude of both the DC and the AC component varies a lot, depending on which finger I use and how firmly I press the finger against the sensor.  I can pretty consistently get 2–9nA of AC on top of 100–150nA DC.  I think that good corner frequencies for the low-pass and high-pass filters are around 0.3Hz and 30Hz. By making the gain of the transimpedance amplifier as high as I can (without saturating with the DC signal), I can keep the gain of the second amplifier low enough to avoid the problem of saturation in the second stage, and the pulse monitor can detect the pulse within 5 seconds.

 

Another option is to make the first-stage amplification be a logarithmic transimpedance amplifier, rather than linear one, by using a Schottky diode as the feedback element instead of a resistor.  But that is getting well outside what I’m comfortable assigning as a design exercise to the Applied Circuits class. I tried it anyway, but the signal from the log amplifier was too small:  a 10% variation in current only results in a 2.4mV change in the output of the log amplifier, needing a much higher gain than my second stage currently provides.

While the 700nm LED provides a stronger signal, the 627nm LED works well enough, and a 2-stage transimpedance amplifier is reasonable for the students to design.  I probably want it to be a 2-day lab, though, with the low-pass first stage designed and tested for the first day, then the high-pass second stage added to solve the problem of DC offset and drift.  That will require reworking my schedule, as I only allowed one day for the lab in the current schedule.

2014 March 2

Colorimeter design—weird behavior

In Colorimeter design—almost working, I talked about the prototype colorimeter made out of foamcore, and the non-linear behavior of its phototransistor circuit. I suggested some possible reasons for the non-linearity, and I tried experiments this weekend to try to remove the problems.

The first thing I did was to remake the dilution series, with one drop of blue food dye in 10ml of distilled water for the highest concentration, then twofold serial dilution to get 1/2, 1/4, 1/8, 1/16, 1/32, 1/64, and 1/128, each in its own cuvette.

The next thing I did was to make a transimpedance amplifier (current-to-voltage converter), so that I could have a constant voltage across the phototransistor, even as the current changed. I also made it so that I could swap out the phototransistor and use a photodiode instead, to see if that gave me more linear behavior.

LED circuits and transimpedance amplifiers for phototransistor and photodiode. The phototransistor amplifier has a gain of 100kΩ, and the photodiode one a gain of 22.4MΩ.  Only the 627nm LED has been tested so far. Both are intended for differential (E20–E21) analog-to-digital conversion.

LED circuits and transimpedance amplifiers for phototransistor and photodiode. The phototransistor amplifier has a gain of 100kΩ, and the photodiode one a gain of 22.4MΩ. Only the 627nm LED has been tested so far.
Both are intended for differential (E20–E21) analog-to-digital conversion.

I have not yet managed to get full-scale range with the phototransistor—the 1/64 and 1/128 dilutions often come out having lower absorbance than the blank! I did manage to get some decent series with the photodiode:

I began and ended with a blank (distilled water only) cuvette.  The difference between the beginning and the ending values is fairly large (an absorbance of about 0.02), and probably reflects changes in alignment of the optical components, which are not very rigidly held by the foamcore.

I began and ended with a blank (distilled water only) cuvette. The difference between the beginning and the ending values is fairly large (an absorbance of about 0.02), and probably reflects changes in alignment of the optical components, which are not very rigidly held by the foamcore.

The high gain on the photodiode transimpedance amplifier causes another problem: 60Hz pickup from capacitive coupling. I get a 60Hz signal that is quite large compared to the DC signal I’m interested in. Adding a 0.022µF capacitor in parallel with the 5.9MΩ resistor got rid of most of the 60Hz noise (a corner frequency of about 1.2Hz). It may be better to use 0.01µF, for a corner frequency of 2.7Hz—that seems to work fairly well also, and may give a bit better time-domain response to changing absorbance.

My first calculation of the desired capacitor size was way off (what I get for doing it in my head instead of with a calculator).  Using only a 100pF capacitor did not reduce the 60Hz noise.

My first calculation of the desired capacitor size was way off (what I get for doing it in my head instead of with a calculator). Using only a 100pF capacitor did not reduce the 60Hz noise.

Adding a 0.022µF capacitor in parallel with the 5.6MΩ resistor did clean up the 60Hz noise.

Adding a 0.022µF capacitor in parallel with the 5.6MΩ resistor did clean up the 60Hz noise.

The values from three runs (no capacitor, 100pF, and 0.022µF) were monotonic (except for one or two measurements of 1/64 and 1/128), fairly consistent, and substantially larger than the error in the re-reading of the blank cuvette, so I tried plotting them against the relative concentration:

 Three different sets of measurements with the photodiode colorimeter. Ideally , the measured absorbance should be linear with the concentration, but I am getting a relationship that looks more like the square root of concentration!

Three different sets of measurements with the photodiode colorimeter. Ideally , the measured absorbance should be linear with the concentration, but I am getting a relationship that looks more like the square root of concentration!

I’ve been getting pretty frustrated with this design, as I have no idea where the non-linearity is coming from.  I’ve checked that both Beer’s Law and the current from a photodiode refer to the same measure of light intensity (W/cm2).

The non-repeatability of the measurements (which is probably due to changes in the light path from movement of the LED and photodiode) also limits the usefulness of this colorimeter.  If I could figure out was going wrong with the light measurement and conversion to absorbance, I could probably fix the changing light path by making a new holder out of sturdier materials—drilling 3mm holes in wood or aluminum is pretty simple.

I did try to do some debugging—the problem is not in the Freedom board or the software, as the voltages reported by the Freedom board are consistent with ones measured with a multimeter, and calculating absorbance from the multimeter measurements gives me the same numbers as the program on the Freedom board (within measurement errors).  The dilution series looks good—if I stack cuvettes,  1/2+1/4+1/8 is almost as dark as 1/1 (and similarly for other combinations).  That leaves only my understanding of how photodiode currents are generated and how transimpedance amplifiers convert current to voltage as potential failures (unless I’m missing something obvious).

2014 February 26

Colorimeter design—almost working

Filed under: freshman design seminar — gasstationwithoutpumps @ 00:34
Tags: , , , ,

Since my freshman design students did not show much interest in designing their own colorimeters, and my son has just gotten to the colorimetry labs in his online AP chemistry class, I decided to prototype my own colorimeter design.  (His AP lab relies on eyeballing the light through two columns of fluid and adjusting the length of the light path through one until the intensities seem to match—that’s a very low tech approach, but it seems rather tedious.)

I had made a prototype colorimeter out of black foamcore,which I mentioned in Seventh day of freshman design seminar. I’d meant to blog about it earlier, but I got a bad virus infection of some sort and was out of action for a while.  The prototype I’d made earlier was not very functional—it fit the cuvette tightly, but did not provide an easy way to remove the cuvette from the colorimeter.  I went through two more prototypes today that would allow me to remove the cuvette, but they looked like they would have bad light leaks.  I finally settled on a 4th design, that uses a separate lid, rather than trying to make a hinged lid.  I’ve included a PDF file that has the design for this version: Colorimeter-draft4.

I constructed the colorimeter by spray-gluing the pattern I made to the black foam core, then carefully cutting it out with a razor knife.  The dashed lines are cut only through the top layer of paper and part way through the foam—bending the foam core then snaps the rest of the foam and leaves the paper on the back as a hinge.  I used black electrical tape to hold the colorimeter together, and to block light from coming through the backs of the phototransistor and the LED.

Top view of the colorimeter with the lid in place.

Top view of the colorimeter with the lid in place.

Top view of the colorimeter with the lid off and the wings open to allow grasping the sides of the cuvette.

Top view of the colorimeter with the lid off and the wings open to allow grasping the sides of the cuvette.

I connected the LED through a current-limiting resistor to the 3.3v supply on the Freedom KL25Z board, and the phototransistor with a current-to-voltage resistor to E22. I actually ended up doing two different circuits, using different LEDs:

    I started with the circuit on the left, using a deep red LED that has a peak wavelength of 700nm. Later I switched to a different LED, with a peak wavelength of 627nm. In both cases, I picked the current-to-voltage resistor so that I got near full-scale readings on a blank cuvette.

I started with the circuit on the left, using a deep red LED that has a peak wavelength of 700nm. Later I switched to a different LED, with a peak wavelength of 627nm. In both cases, I picked the current-to-voltage resistor so that I got near full-scale readings on a blank cuvette.

When the KL25Z is reset, the analog-to-digital measurement on E20 is recorded as the intensity for the blank cuvette.  Then the transmittance (measurement/blank) and absorbance (–log10(transmittance)) are reported 10 times a second on the USB serial line.

With the 700nm LED, I could measure from A=0 to A=1.8 (with an opaque piece of foam core blocking the light). Light leakage around the cuvette and from the outside prevented me from measuring higher absorbancy.

The first thing we tried measuring was a solution of blue food coloring (blue dye #1). My son made a stock solution of 1 drop in 10 ml, and we measured the absorbance (with the 700nm LED) at about 0.0028, which seemed rather low to us. He then made a very concentrated solution with 5 drops in 5ml, which looked almost black to us, and the colorimeter reported it as having an absorbance of 0.157, which seemed absurd—that’s almost clear! We tried looking at the sky through the solution and noticed that the sky looked deep red through the blue. This lead me to suspect that the dye was transparent in the near IR where much of the light from the LED was concentrated.

When I switched to a 627nm LED, I had to use a larger current-to-voltage conversion resistor, as the phototransistor is less sensitive to those wavelengths. This meant that the noise level from light level was increased, and so an opaque object read as absorbance around 1. The stock solution read as 1, as did a 2-fold and 4-fold dilution. We went to a 40-fold dilution (so equivalent to 1 drop in 40ml) and got a reading of 0.637. From there, we started 2-fold dilutions:

dilution Absorbance at 627nm
1/40 0.637
1/80 0.407
1/160 0.230
1/320 0.139
1/640 0.0679
water 0.0040
1/1280 0.0380

I was worried that cuvette was stained by the dye, but putting in distilled water after the 1/640 dilution showed that any residual staining could only be contributing a small error.

Here is a plot of one run of the colorimeter:

The colorimeter is reset with a blank cuvette (filled with distilled water).  After a few seconds the blank is removed and the test cuvette is inserted.  After waiting about 20 seconds, it is removed and the blank re-inserted.  The absorbance is fit on the flat part in the middle.  Note that the colorimeter did not return exactly to 0 on this run.

The colorimeter is reset with a blank cuvette (filled with distilled water). After a few seconds the blank is removed and the test cuvette is inserted. After waiting about 20 seconds, it is removed and the blank re-inserted. The absorbance is fit on the flat part in the middle. Note that the colorimeter did not return exactly to 0 on this run.

The data from the run did not fit the straight line of Beer's Law.  It did fit a power-law curve, but the exponent is too low.

The data from the run did not fit the straight line of Beer’s Law. It did fit a power-law curve, but the exponent is too low.

I’m now trying to figure out why we did not get a good fit for Beer’s Law. Here are some possibilities:

  • The dilutions were not done accurately.  That would explain random fluctuations, but seems unlikely to give such a clean, consistent deviation from theory.
  • Beer’s Law doesn’t apply to this example.  That seems really, really unlikely, since this is the canonical experiment done by 1000s of students a year.
  • The colorimeter is not linear.  I’m relying on the phototransistor providing a current proportional to light intensity, even though the voltage across the phototransistor varies.  I think that this is likely to be the problem.  To check it, we’d have to redo the experiment with a different circuit—probably a transimpedance amplifier to do the current-to-voltage conversion.

Unfortunately, my son did not keep all the serial dilutions, so to test a different colorimeter circuit I’d have to make a new series.  I might do that this weekend if I have time.  At least I know what stock concentration to start with—about one drop of food color in 25ml of distilled water.

I’m also interested in trying the colorimeter design with an RGB LED, so that we could try different wavelengths—perhaps doing a Beer’s Law test with yellow food coloring.

2014 February 13

Tenth day of freshman design seminar

Filed under: freshman design seminar — gasstationwithoutpumps @ 17:22
Tags: , , ,

Yesterday’s class was originally planned to be an Arduino demo of analogRead() and Serial.print(), using either a pressure sensor or a phototransistor, but the class ended up going in a totally different direction.

At the beginning of class, I passed around a cheap vernier caliper and showed students how to measure the disposable cuvettes to 0.05mm precision. This was part of my continuing effort to expose students to simple tools that they should have seen in high school, but for the most part have not.

I started the class by collecting the proposals for design projects.  Since these were group efforts, there were only three proposals: a centrifuge, an incubator, and a PCR thermal cycler.  I’ve not read the proposals yet (I’m still under the weather, and ended up falling asleep last night right after dinner, and only waking up this morning barely in time to get to the department research seminar at noon), but I did read the titles in class, and started talking about what computer aspects there might be for each project.  The centrifuge is mainly a mechanical design, but a non-contact sensor (probably optical) for measuring the rotor speed would be useful—one might even want to include a motor speed control, but that depends on what they use for a motor. The other two designs both depend on regulating a temperature.  Important parameters include how tightly controlled the temperature has to be and how fast you have to move from one temperature to another.  An incubator generally needs to have a fairly fixed temperature, and only needs to respond to slow heat loss, except when the incubator is opened.  A PCR machine has to switch rapidly between three temperatures,  generally around 95° C, 50° C, and 75° C.

So we ended up talking about thermal control.  First I described the basic idea of having a “set point” and of simple on-off heater control, with high threshold and a low threshold.  We talked about temperature sensors, including the old-fashioned bimetal-strip thermostats, thermistors, thermocouples, and RTD sensors. I talked a little about how to choose among the different types (thermocouples for high temperature, RTD for high precision, thermistors for low cost and ease of interfacing).  I also mentioned semiconductor temperature sensors, which are used in a lot of integrated circuits (like CPUs and GPUs on their laptops), but are not very good for general temperature measurement.

We focused on thermistors as the simplest to use with the Arduino, and I showed them a data sheet for the NTCLE413E2103F520L thermistor we use in the Applied Circuits lab.  This lead to a discussion of how the thermistor resistance varies with temperature, and I showed them the Wikipedia page on thermistors, with its discussion of the Steinhart-Hart equation and the “B” parameterization of the formula.  I also explained what the B25/85 specification on the data sheet meant (measuring resistance at only 25° C and 85° C, and solving for B).

I then tried to get the class to come up with a circuit to convert resistance variation into voltage variation, but they were stumped. So I showed them a voltage divider and had them work out as a class what the output voltage was using just Ohms law. They were then able to see that replacing one resistor with a thermistor would allow them to see a voltage variation as a function of temperature. I told them about the first homework in the Applied Circuits course (figuring out the optimal value for the fixed resistor, to get the maximum change in voltage with temperature at a particular operating temperature), but did not assign the problem. Not everyone in the class has had calculus yet, and the problem really does require being able to differentiate and use the chain rule.

I ran out of time before doing anything with the Arduino! I did assign them an Arduino homework, though:

For Wednesday 2014 Feb 19 (no class Monday Feb 17), write an Arduino program that will report over the USB cable once every two seconds the status of pins 8, 9, and 10, whether that pin is high or low. The report should be viewable on the Arduino Serial Monitor. It should look something like

 8:HIGH 9: LOW 10: LOW
 8: LOW 9:HIGH 10: LOW
 8: LOW 9:HIGH 10: LOW
 8: LOW 9: LOW 10: LOW

As a matter of common programming style, there should be a “block comment” at the beginning of every program telling what the program does (from a user’s standpoint, not how it works from a programmer’s standpoint), who wrote it, and when it was written. You may work on the programs in pairs (not larger groups), but the names of everyone who worked on

Turn in a printout of your program. This program is simple enough that I don’t need evidence of it working—for other class you may be asked to turn in the source code electronically, so that the graders can test the program, or provide input-output pairs that show evidence that the program is working correctly.

For those who find this program too easy, you can challenge yourself to do more ambitious programs:

  • Read analog inputs from A0 through A5 and report the values.
  • Accept characters from the USB serial line that change which pins you examine. (For example, getting the character ‘8’ with Serial.read() might turn on looking at pin 8, and getting ‘*’ might turn it off looking at pin 8.)
  • Write a little control program that turns on the on-board LED (pin 13) when some combination of conditions is true and off when the conditions are false.

At the end of class, I had everyone use my wire strippers to cut and strip a few small pieces of wire, so that they could do the hardware portion of the Arduino programming.

Next Page »

The Rubric Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 276 other followers

%d bloggers like this: