Gas station without pumps

2014 April 13

Designing courses to teach design—draft 3

The talk I was scheduled to give last quarter (2014 Feb 24) was rescheduled, because two of the four speakers were unable to make that date.  It is now scheduled for Wed 2014 Apr 23  at 3:30 in the Merrill Cultural Center, which used to be the Merrill Dining Hall, before they consolidated dining halls in the east colleges. There are now 6 speakers in 90 minutes, which means 15 minutes each (maybe 10 minutes speaking, 5 minutes for questions).  I’ll have to run over from my class which ends at 3:10 on the opposite side of campus (0.6 miles, 13 minutes according to Google Maps), though running may be difficult along the crowded sidewalks between classes.

The talk needs to be updated from last quarter, as I have now taught prototype runs for both the applied circuits class and the freshman design class, and am in the second run of the applied circuits class.

Here is my current draft of the text—please give me some suggestions in the comments for improvement.  The ending seems particularly awkward to me, but I’m having trouble fixing it.

Designing Courses to Teach Design

I believe that the main value of a University education does not come from MOOCable mega-lecture courses, but from students working in their field and getting detailed feedback on that work. I’ll talk today about some courses I’ve created ths year and last to teach students to do engineering design. These courses are high-contact, hands-on courses—the antithesis of MOOC courses.

Design starts from goals and constraints: “what problem are you trying to solve?” and “what resources are available?” So what were my goals and constraints?

The two problems I was trying to solve were in the bioengineering curriculum:

  1. students weren’t getting enough engineering design practice (and what they were getting was mostly in the senior year, which is much too late) and
  2. too many students were selecting the biomolecular concentration, where we were exceeding our capacity for senior capstone and senior thesis projects.  The other concentrations were under-enrolled.

The main constraints were that

  1. there was no room in the curriculum for adding required courses,
  2. there were no resources for new lab space or equipment, and
  3. all relevant engineering courses had huge prerequisite chains.

Furthermore, I would have to teach any new course myself, so the content had to be something I already knew or could learn quickly. Those constraints meant the new course would not have wet labs (though I have encouraged wet-lab faculty to add design exercises to their existing courses).

My first partial solution was to replace the required EE circuits course with a new Applied Circuits course. The existing EE101 course is a theory class (mostly applied math) that prepares students to do design in later courses—but most bioengineering students never take those later courses, so were getting prepared for something they didn’t do. Due to “creeping prerequistism” in the 8 or 9 departments providing courses for the major, the bioengineering students were already taking far too many preparatory courses and far too few courses where they actually did things.

The goal of the new course is to have students design and build simple amplifiers to interface biosensors to computers. I chose a range of sensors from easy ones like thermistors, microphones, and phototransistors to ones more difficult to interface like EKG electrodes and strain-gauge pressure sensors. I’m not interested in cookbook, fill-in-the-blank labs—I want students to experience doing design in every lab, even the first one where they knew almost no electronics—and I want them to write detailed design reports on each lab, not fill-in-the-blank worksheets, like they get in chem and physics labs, and even intro EE labs.

The course was designed around the weekly design projects, not around preset topics that must be covered. Themes emerged only after the design projects were selected—the class comes back again and again to variations on voltage dividers, complex impedance, and op amps with negative feedback.

Students used a free online textbook rather than buying one, but bought about $90 of tools and parts. I tried out every potential design exercise at home—rejecting some as too hard, some as too easy, and tweaking others until they seemed feasible. I designed and had fabricated three different printed circuit boards for the course (not counting two boards which I redesigned after testing the lab at home).  One of the PC boards is a prototyping board for students to solder their own amplifier designs for the pressure-sensor and EKG labs. (Pass boards around.)

Developing a hands-on course like this is not a trivial exercise. I spent about 6 months almost full time working on the course design (without course relief). I made over 100 blog posts about the design of the course before class even started, and I now have over 230 posts (the URL is on the quarter-page handout, along with the URL for the course syllabus and lab assignments).  Since the posts average a couple of pages, this is more writing than a textbook (though not nearly as organized).

The course was prototyped last year as BME 194+194F “Group Tutorial” before being submitted to CEP for approval, and I wrote up notes after each class or lab (another 60 or so blog posts). Last year’s prototyping lead me to increase the lab time from 3 hours to 6 hours a week, which means I’m spending a lot of time this quarter rewriting all the lab handouts—splitting the material between the lab times and adding at-home or in-class design exercises between the two parts. Some of the fixes have worked well (students got comfortable plotting their data with gnuplot weeks earlier this year), but we’ve still run over time in some labs, even with 6 hours a week of lab, so more tweaking is needed.

This course is expensive in terms of professor time: I’m spending over 10 hours a week of direct classroom and lab time (not counting office hours, grading, prep time, or rewriting the lab handouts). Just providing feedback on the 5–10-page weekly design reports takes about 15 minutes per student per week (half an hour per report).

The students taking Applied Circuits last year were mostly seniors who had been avoiding EE 101, rather than the sophomores I’d intended the class for. This year, I have juniors and seniors, but still no sophomores. So the course still does not provide early exposure to engineering design, nor does it direct more students to the bioelectronics concentration rather than the biomolecular one (those there’s still hope for the latter).

My second partial solution was to create a new freshman design seminar in conjunction with the student Biomedical Engineering Society. This course has no prereqs, is only 2 units, and does not count towards any major or campus requirements.

Unlike the Applied Circuits course, I didn’t choose the design projects for this course ahead of time, because I had no idea what skills and interests the students would bring to the class—I’d not taught a freshman class in over a decade, having taught mainly seniors and grad students. I did try out 3 or 4 design projects on my own to gauge the skills needed to do them, but those projects all assumed some computer programming skills.

I prototyped the freshman design course last quarter as BME 94F and have submitted course forms to CEP for approval. Once again, I blogged notes after each class meeting (only about 39 posts, though—this was a less intensive effort on my part).

With no prereqs, I couldn’t assume that students had any relevant skills, though it turned out that all this year’s students had had biology, chemistry, and at least conceptual physics in high school. Only one student had ever done any computer programming, though—a big hole in California high school education—and only a few had any experience building anything. (AP physics classes were the most common exposure to building something.) On the first-day survey the students indicated an interest in learning some programming and electronics, so we did a little programming with an Arduino microcontroller board—I’ll try to up that content next year.

I started out teaching generic design concepts using a photospectrometer as an example. The concepts include specifying design goals and constraints, dividing a problem into subproblems, interface specification, and iterative design.The photospectrometer turned out to be too complex, and I’ll probably start with a simpler colorimeter next year, and have the students design, build, and program it before they start on their own projects.

My third partial solution has been a complete overhaul of the bioengineering curriculum, which is currently before CEP for approval. No new courses were created for this overhaul, but all the concentrations were changed. For example, half the chemistry courses were removed from concentrations other than biomolecular, to make room for more courses in electronics, robotics, psychology, or computer science. And some the orphan math courses were removed from the biomolecular concentration to make room for more advanced biology. Long-term, I’m hoping to convince some of the other departments to remove excessive prerequisites, so that students can take more interesting and useful courses before their senior year.

I could go on all afternoon about these courses and curriculum design, but I’m running out of  time, so I’ll leave you with these take-away messages:

  1. The value of University education is in detailed feedback from professors in labs and on written reports, not in the lectures.
  2. Students should be solving real problems with multiple solutions, not fill-in-the-blank or multiple-choice toy exercises.
  3. These courses require a lot of time from the professors, and so they are expensive to offer.
  4. Failure to teach such courses, though, makes the University education no longer worthy of the name.

For those of you not present—the quarter-page handout will have the URLs for this blog’s table of contents pages for the circuits course and the freshman design course, in addition to the two class web pages:

In addition to the quarter-page handout, I also plan to have copies of the prototyping board (both bare boards and ones that I used for testing out EKG or instrumentation amp circuits), one of the pressure sensors (on another PC board I designed), and the hysteresis oscillator boards.  If I can get it working again, I may also wear the blinky EKG while I’m talking.

Preparing this talk has been weird for me—I can’t remember ever having scripted out a talk to this level of detail.  For research talks, I usually spend many hours designing slides, and relying on the slides to trigger the appropriate talk. For classes, I usually think obsessively about the material for a day or two ahead of time, sometimes writing down a few key words to trigger my memory, but mainly giving an extemporaneous performance that relies heavily on audience participation. I had one memorable experience where a student asked me for a copy of my lecture notes after a class—I handed her the 1″ PostIt that had my notes, but warned her that I’d only covered the first word that day, and that it would take the rest of the week to cover the rest.

Doing this short a talk without slides and without time to rehearse will probably require me to read the talk—something else I’ve never done. (I know, I should have rehearsed during our one-week spring break, but I had a 2-day RNA research symposium, a faculty meeting about who we would offer our faculty slot to, meetings with grad students, and feverish rewriting of the first few lab handouts for the circuits course.)

2014 March 11

Why few women in engineering?

Filed under: Uncategorized — gasstationwithoutpumps @ 11:33
Tags: , , ,
The Washington Post recently published an opinion piece by Catherine Rampell with a somewhat unusual, but plausible explanation why some fields end up with more men than women (as most of the engineering fields do). The theory is that women are more discouraged by a B in an entry-level course than men are (she cites some data from econ courses that support that theory, though it is only correlation, not necessarily causation).
Plenty has been written about whether hostility toward female students or a lack of female faculty members might be pushing women out of male-dominated majors such as computer science. Arcidiacono’s research, while preliminary, suggests that women might also value high grades more than men do and sort themselves into fields where grading curves are more lenient.
As parents and teachers we encourage children to pursue fields that they enjoy, that they are good at, and that can support them later in life. It may be that girls are getting the “that they are good at” message more strongly than boys are, or that enjoyment is more related to grades for girls. These habits of thought can become firmly set by the time students become men and women in college, so minor setbacks (like getting a B in an intro CS course) may have a larger effect on women than on men.
I’m a little wary of putting too much faith in this theory, though, as the author exhibits some naiveté:
But I fear that women are dropping out of fields such as math and computer science not because they’ve discovered passions elsewhere but because they fear delivering imperfection in the “hard” fields that they (and potential employers) genuinely love. Remember, on net, many more women enter college intending to major in STEM or economics than exit with a degree in those fields. If women were changing their majors because they discovered new intellectual appetites, you’d expect to see greater flows into STEM fields, too.
It is very difficult for students, male or female, to transfer into STEM majors late—the number of required courses and prerequisite chains are too long.  As long as the humanities majors have few, unchained requirements and STEM majors have many, chained requirements, the transfer out of STEM will be far larger than the transfer into STEM. Expecting equal flow in both directions is naive.
But there is, I believe, a greater proportional loss of women from STEM fields in college than men, and most of the interventions trying to reduce that loss have not been very effective.  (Harvey Mudd has had some success, attributed to various causes.) If the theory put forth by Rampell is valid, what interventions might be useful? Here are a few I thought of:
  • Higher grades in beginning classes. Engineering courses generally average 0.4 or 0.5 grade points lower than the massively inflated grades in humanities courses. I doubt, somehow, that many engineering faculty will be comfortable with the humanities approach of giving anyone who shows up an A, no matter how bad their work. So I don’t think that this idea has any merit.
  • Lower entry points. One of the things that Harvey Mudd did was to require every freshman to take CS and to introduce a lower-level CS course for those who did not have previous programming. By having some lower-level courses, students could get high grades in their first course without teachers having to water down existing classes or engage in grade inflation. By requiring the course of all students, students who avoided the subject for fear of not being able to compete are given a chance to discover an interest in the field (and, apparently, many women at Harvey Mudd do discover an interest in CS as a result of the required course).
  • Extra tutoring help for B students in entry-level courses. Almost all the “help” resources at the University seem to be aimed at getting students from failing to passing—but the students who are barely passing after massive help do not make good engineering majors, and are likely to fail out of the major later on. It would be far more productive to try to turn the Bs into As, retaining more women (and minorities) in the field. Of course, this means that the assistance has to be at a higher level than it often is now—the tutors need to know the material extremely well and be able to assist others to achieve that expertise.  Basic study skills and generic group help may be good for getting from failing to passing, but may not be enough to get from B to A.
  • More information to students about the feasibility and desirability of continuing with a B. This sort of encouragement probably has to happen one-on-one from highly trusted people (more likely peers than adults).

These ideas are definitely half-baked—I’m not even fully convinced that the theory behind them is valid, much less that they would have the desired effect. I welcome comments and suggestions from my readers.

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 Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 250 other followers

%d bloggers like this: