# Gas station without pumps

## 2015 May 11

### Lecture on pressure sensors

Today’s lecture was fairly straightforward:

• Feedback on the audio-amplifier design report
• Explanation of RMS vs. amplitude vs. peak-to-peak voltage measurements
• How pressure sensor works
• Wheatstone bridge, developed from voltage divider, with second fixed voltage divider to subtract off effect of supply voltage changes

I had wanted to get to the internals of how an instrumentation amplifier is built (the 3-op-amp and 2-op-amp designs), but that can wait until Wednesday.  I also wanted to do a demo of the pressure sensor with digital filtering, but that can wait until Wednesday also (and I forgot to bring in my KL25Z board today anyway).  Discussions of systolic and diastolic blood pressure will need to be done on Wednesday also—I’ll start with that, then move to the demo and show how to measure pulse rate and estimate the blood pressures from the recording.

The main feedback I gave on the design reports consisted of the following points:

• A lot of students are still invoking V=IR without thinking about what the variables mean—they have to be talking about the voltage across and current through the same resistor, not some other random voltage in the system.  For the design they just did, it was impossible to know the voltage across the resistor until the power supply voltage was chosen, but the voltage across the resistor was not the power-supply voltage!
• Many students did not justify their design choice for the power supply.  There were constraints on it (from the op-amp data sheet), and they should have chosen a voltage near the upper end, because they wanted as loud an output as possible, and the current limits increased with power-supply voltage.  One or two sentences that said those two things would have sufficed.
• RC time constants have units (called “seconds”).  I showed the students that ΩF is seconds, by using the definition of Ω as V/A, A as C/s, and F as C/V.
• Voltage gain, on the other hand, is unitless, being a ratio of two voltages.  I also explained the convention of showing what the ratios are of, express  gain in “units” of V/V.
• The gain for their audio amplifiers needed to be designed (based on the current limits at the outputs and the loudspeaker impedance, divided by the calculated or measured input voltage to the amplifier).  Too many students got a hint from the group tutor for the class (that turned out to be wrong) and took it as a specification, rather than doing their own design.
• Many students did not report their loudspeaker impedance, but it was essential for computing the voltage at which the amplifier would clip, and different students had different loudspeakers (some 6Ω and some 8Ω).
• Paralleling op amps doesn’t increase the gain, merely the current limit for the amplifier.  So clipping happens at a higher voltage, but the gain for small signals remains unchanged.
• Several students had misdrawn the gain control circuit, using the two ends of potentiometer symbol as if it were a variable resistor. I showed them both the standard symbol for a variable resistor and how to draw the potentiometer used as a variable resistor correctly.
• Lots of students had very approximate gain measurements, because they had relied exclusively on the oscilloscope for measuring voltages.  I explained why the oscilloscope is inherently less accurate for measuring voltage than a voltmeter.
• I explained that “surround sound” and “stereo” require different signals to the multiple loudspeakers—multiple speakers wired to the same signal don’t produce the aural position illusion that stereo and multi-channel sound does.
• One of my pet writing peeves is the mixing up of prepositions in “substitute x for y” and “replace y with x”.  Note that what replaces what swaps positions in the two phrases.  When students mix and match to get “substitute x with y” or “replace y for x” I don’t know whether the verb or the preposition is dominating the meaning.  (In some dialects of English one or both of these phrases may be unambiguous, but they don’t seem to be consistently used in California, so I treat them as errors, rather than as dialect variations.)
• Students are still starting numbers with periods.  I’ve told them repeatedly not to—numbers shouldn’t start with punctuation (other than a + or – sign), and there should always be a digit in front of any decimal point.
• The triangle used as a ground symbol should always point down.

## 2015 April 26

Friday’s lecture went fairly well.

There were a few questions at the beginning of class, one of which lent itself well to my talking about choosing different models for the same phenomenon and using the simplest model that worked for the design being done.  In this case it was about the relaxation oscillator using a 74HC14N Schmitt trigger and where the constraints on the feedback resistor came from.  I told them about some more detailed models we could do of the Schmitt trigger, including input capacitance (max value on the data sheet), input leakage current (not specified, but probably fairly small, under 1µA), and output resistance (which would get added to the feedback resistance).  I’ll have to incorporate some of those ideas into the book, when I rewrite those chapters this summer—the hysteresis lab needs the most rework of anything so far this quarter.

After the questions I mainly talked about polarizable and non-polarizable electrodes developing the R +  (R||C) + half-cell model of an electrode that they will be fitting (without the half cell) in labs this week.

This weekend’s grading was a bit painful, and I’m probably going to have to spend all of Monday’s lecture filling in gaps in their prior education that I had not anticipated.  Some holes also became apparent from e-mail questions I got from students over the weekend.

I’ll try to gather the common problems here, so that I can use the list as lecture notes tomorrow.

• There were a lot of REDO grades for errors on schematics.  I hate giving REDO (since it doubles my grading load), but I told students at the beginning of the quarter that any error on the schematics was an automatic REDO.  I plan to stick to that, despite the pain for both me and the students, because they have to develop the habit of double and triple checking their non-redundant documents (schematics, PCR primers, …).  Sloppy documentation is a serious problem in engineering and too many faculty and graders have been perpetuating the myth that the almost right idea is good enough.  I’m particularly harsh on students who change kHz into Hz or pF into nF.  Off-by-a-factor-of-1000 is not good enough!  The most extreme case so far is someone who specified a capacitor as being in the gigafarads (they’d typed 109 instead of 10-9). A factor of 1,000,000,000,000,000,000 off is not the sort of thing one can ignore.  I also get annoyed by students who randomly pick a unit (H when they need Ω, or Ω when they need Hz), as if all units were just decorations to please a teacher, with no real meaning to them
• Frequency is 1/period.  For the relaxation oscillator, they do two charge/discharge calculations to get the period as a multiple of RC (though many blindly copied one of the formulas for just the charge time without understanding it, and assumed it was the period). But even after computing the charging time students blindly used  2πf = 1/(RC) as a magic incantation.  That formula was relevant for the corner frequency of RC filters, but has nothing to do with the oscillation frequency of the relaxation oscillator.
• The capacitance calculation being done in the prelab was for the capacitance of a finger touch to the touch plate, but a lot of students claimed that it was the calculation to determine the size of the ceramic capacitor.  Only a couple of groups bothered to explain the connection between the two capacitances. I think I need to rewrite the prompts in the book to force the values to be more different, so that students have to think which capacitance they are talking about.
• I find that students often talk about “the voltage” or “the capacitance” as if there was only one in their circuit, and when asked which one they are talking about are completely mystified—to them invoking the magic word is all that can be expected of them—actually knowing what it refers to is unreasonable.
• Students in general were doing too much ritual magic. They would put down a formula they thought was relevant (often copying it incorrectly), then claim that from that formula they got some number for their design.  Often the formula was not relevant, or additional assumptions needed to be made (like choosing arbitrary values for some variables).  At the very least, there was some substantial algebra to be done to convert the formula into a usable form.  Some students claimed that Wolfram alpha gave them the solution (when there was not enough information to solve for the variable they wanted a value for).  Basically, I’m a bit angry at the students for trying to bullshit their way through the assignment. One pair of students said quite honestly that they did not know how to do a computation and got the value they used from the students at the next bench.  I gave them bonus points, and I’ll help them figure out how to do the computation they were having trouble with—I have no problems with students not knowing how to do something new and somewhat tricky, but I do have trouble with students deliberately looking dishonest and stupid by writing bullshit.
• The computation that the honest students had trouble with is one that many students had trouble with, so I’ll go over it in class.  I gave the students a derivation of a formula for the charging time of the capacitor in the relaxation oscillator, but I didn’t have time to step them through the derivation.  It seems like most of the class can’t read math, since many just copied the final formula without reading the text that said it was the time to charge the capacitor.  There was an exercise immediately afterwards asking students to compute the time to discharge the capacitor, but this exercise was added to the book after the students had done their prelab exercises, so they didn’t bother to look at the exercise. What they needed to do for the lab was to add the charge and discharge times (which are not quite the same) to get the period.
• I need to remind the students that they are turning in design reports, not lab reports.  I’m not looking for fill-in-the-blank worksheets, but descriptions of how they designed and tested their circuits.  Omitting the design steps is omitting the most important part of the report!
• I gave the students three models to fit to the data, and showed them how to do the fits for two of the models in Wednesday’s lecture.  There wasn’t time to get to the third model, so I just told them to use the same technique as the second model, but with the different formula.  Most of the class never bothered to fit the third model (the only one that really fits the data well)—if I didn’t do all the work for them in lecture, then they weren’t going to generalize even a tiny bit to do it themselves.
• A lot of students did not do a good job of fitting the models, because they fit the data with linear scaling, rather than with log scaling as I had shown them.  This is a fairly subtle point (errors on a linear y axis are differences, but on a log y axis are ratios), so I’ll review it in class.
• I  think that some students don’t have any idea when one would use a log-log plot, a log-linear plot, a linear-log plot, or a linear-linear plot.  I thought that was covered in precalculus, but I guess not. So tomorrow I’ll present the idea that the only curve most people understand visually is a straight line, so one wants to choose axis scaling so that the expected relationship is a straight line.  Linear plots are for linear (or affine) models, log-log plots are for power laws, log-linear are for exponentials, and linear-log are for logarithmic relationships.  I’ll put a general straight line on each and derive the form of the function that matches that straight line.
• The purpose of the Tuesday lab was to collect data and model the loudspeaker with a few parameters.  But many students neglected to report those parameters in their design reports!  They produced a plot and fitted models to it, but nowhere on the plot, in the figure caption, or in the main body (in decreasing order of usefulness) did they report what the parameter values were that the fit produced.  For students who are so focussed on answer getting that they neglect to explain how they came up with their answers, this seems like a strange omission.
• For the Thursday lab, no one did back calculations from their observed frequencies to estimate the capacitance of the 74HC14N input, of the untouched touch plate, or even of the touch itself, to see whether their observations were consistent with their design predictions. One group of students claimed to have done sanity checks, but I don’t believe them, as they also reported oscillations around 20Hz, instead of 20kHz.
• For the prelab, it seems that a lot of students computed $R + \omega L$ instead of $| R + j \omega L|$, though most got it right in the gnuplot scripts for the lab itself.  I have to remind students that $|A+B| \neq |A|+|B|$.
• On the typesetting front, I’m making some progress on getting students to put their plots in as figures with captions, though way too many are still referring to “the plot below” rather than to “Figure 3”.  I’m also having some difficulty getting them to be sure to refer to all the figures in the main body text.  A lot of times they’ll toss in a handful of plots with no reference to them at all.
• On the opposite side of the coin, I have to teach them that equations are properly part of a sentence, generally as a noun phrase, and are not standalone sentences.  When there is an explanation of variables after a formula (“where A is this, and B is that”), the where-clauses are still part of the same sentence.
• Some other little things to tell them:
• The word “significant” should be reserved for its technical meaning of “statistical significance”—very unlikely to have occurred by chance according to the specified null model. It should not be used in the normal English way to mean “big”, “important”, or “something I like”.
• To get gnuplot to produce smooth curves when there are sharp changes in function, it is necessary to do set samples 3000 to compute the function at more points than the small default number.
• Students have been misusing the word “shunt” for any resistor. Properly, it is a low resistance used to divert current from some other part of the circuit—in our designs, it is the resistor being used to sense current and change it into voltage. I wonder if I should switch terms and talk about a “sense” resistor, though “shunt” is the standard term for ammeters.
• A minor pet peeve of mine: I hate the word “utilize”. I have yet to see a context in which “use” does not do the same job better.

## 2015 February 25

### Freshman design seminar writing notes

Along with the senior-thesis writing course this quarter, I’m also teaching a freshman design seminar. Many of the problems in their first design reports are similar to the problems I see in senior theses (Senior thesis pet peeves, More senior thesis pet peeves, and Still more senior thesis pet peeves). I hope that by catching them early, I can squelch the problems.

Here are some things I saw in the first design report turned in by the freshmen:

• Every design document should have a title, author, and date. If the document is more than one page log, it should have page numbers.
• Passive voice should be used very sparingly—use it to turn sentences around to pull the object into the first position, when that is needed to get a smooth old-info-to-new-info flow.  Sometimes you can use it to hide the actor, when you really don’t know who did something, but that should be very rare.
• Errors in schematics, programs, block diagrams, and other low-redundancy representations are very serious.  In the circuits class, any error in a schematic triggers an automatic REDO for the assignment.  I’m not as harsh in the freshman design class, but there is no notion of “just a little mistake” in a schematic.
• The battery symbol is not the right way to show a voltage source that is not a battery.  Use the power-port symbol, to indicate connect to a power supply that is not included in the schematic, or include the Arduino board from which you are getting power as a component in the schematic.
• Bar charts are not appropriate for all that many data representations in the physical and biological sciences.   If you have 2-D data, use a scatter diagram.  A bar should only be used when the area of the bar communicates the quantity of something that is labeled in discrete classes.  (And even then a single point is often clearer.)
• Captions on figures should be about a paragraph long.  Remember that people generally flip through a paper looking at the pictures before deciding whether to read it.  If the figures and captions are mysterious, they’ll give up without ever reading the paper.  A lot of academic authors, when writing a paper for publication, start by choosing the figures and writing the captions.  Those figures and captions then form the backbone of the paper, which is written to explain and amplify that backbone.
• In academic writing, figures are treated as floating insertions, not fixed with respect to the text.  Therefore, it is correct to refer to the figures by name, “Figure 1”, but not by location (“above” or “below”). Every figure in a paper should be referred to explicitly by name in the main body of the text, and the floating insertion put near where the first reference to the figure occurs.
• Citations in modern scholarly works are not done as footnotes—those went out of style 50 or 60 years ago, and only high school teachers still use that style.  Modern papers put all the citations at the end (in any of several different styles, usually specific to a particular journal).  I have a slight preference for reference lists that are sorted by author, rather than by order cited in the paper, and I have a preference towards high-redundancy reference list formats rather than minimalist ones, but I don’t have a particular style that I recommend.
• There is no point to saying “web” in a citation—if something comes from the web, then give me the URL (or DOI). For material that is only on the web (not citable as a journal article), you must give the URL or DOI.
• When typing numbers, never start them with a decimal point—use a leading zero to prevent the easily missed leading decimal point. Even better is to follow the engineering convention of using numbers between 1 and 1000 with exponents of 10 that are multiples of three.  That is, instead of saying .01, or even 0.01, say 10E-3.  The advantage is that the powers of 1000 have prefix names, so that .01A becomes 10mA.  Don’t worry about significant figure meanings, because engineers express significance explicitly, not through imprecise sig-fig conventions.  That is, and engineer would say 10mA±2mA, not 1.E-2A (which a physicist would interpret as 10mA±5mA) or 1.0E-2A (which a physicist would interpret as 10mA±0.5mA).
• In describing where components are in a schematic diagram, “before” and “after” don’t make much sense.  I have no idea what you mean if you say that a resistor is before an LED. When engineers use “before” or “after” it is generally in an information-flow sense.  For example, you may filter before amplifying or amplify before filtering, but if a resistor and capacitor are in series, neither is “before” the other.
• Students use “would” in many different ways, but mostly incorrectly, as if it were some formal form of “was” or “will be”, while it is actually a past subjunctive form of the modal auxiliary “will”.  There are many correct uses of “would” in general English, but in technical writing, it is usually reserved for “contrary to fact” statements. When a student writes “I would grow bacteria for 2 days”, I immediately want to know why they don’t.
• The pronoun “this” is very confusing, as the reader has to work out what antecedent is meant. A lot of effort can be saved if “this” and “these” are not used as pronouns but only as demonstrative adjectives modifying a noun. This usage is much easier for people to follow, as the noun helps enormously in figuring out the antecedent.  If you can’t figure out what noun to use, then your reader has no hope of understanding what you meant by “this”.
• “First” is already an adverb and needs no -ly. The same is true of “second”, “third”, and “last”.  For some reason, no one makes the mistake with “next”, which follows the same pattern of being both an adjective and an adverb.  I wonder why that is?