Gas station without pumps

2012 September 30

Learnable programming is not necessarily visual

Filed under: Uncategorized — gasstationwithoutpumps @ 20:35
Tags: , , ,

Everybody seems to be blogging about the multi-media essay Learnable Programming by Bret Victor.

I read it and found some of it interesting, but it seemed rather narrow-minded and dogmatic to me.  Already in the 3rd paragraph, there was a statement ringing alarm bells for me:

People understand what they can see. If a programmer cannot see what a program is doing, she can’t understand it.

If that were really true, then blind people would be incapable of programming, but this is demonstrably false.  Blind programmers may be rare, but they have certainly been around for the last 30–40 years.

If Bret had said “If a programmer cannot imagine what a program is doing, she can’t understand it,” then I would have nodded my head and agreed with him.  But he specifically wants to argue that all programming instruction and perhaps all programming should be visual, a conclusion that I do not support.  I’m not even certain that the visual representations of data that he regards as essential are even helpful.

Other than his insistence on visual modes of thinking and interacting as the only valid modes, he has some pretty good ideas, which he outlines as a set of design principles:

The environment should allow the learner to:

  • read the vocabulary– what do these words mean?
  • follow the flow– what happens when?
  • see the state– what is the computer thinking?
  • create by reacting– start somewhere, then sculpt
  • create by abstracting– start concrete, then generalize

The language should provide:

  • identity and metaphor – how can I relate the computer’s world to my own?
  • decomposition – how do I break down my thoughts into mind-sized pieces?
  • recomposition – how do I glue pieces together?
  • readability – what do these words mean?

One aspect of the “essay” that I found irritating was the frequent embedding of  things that looked like video play buttons, but which did not seem to do anything except disappear when clicked on.  I examined them with Firefox’s “Inspect Element” tool, and found that they were Chrome-specific extensions to make videos.  I viewed a couple of them using the Chrome browser, and found that they just slowed the essay down without adding much to the content.  Still, it seems strange to me that someone who wants to be read would deliberately hide parts of his content in non-standard formats.  Perhaps Bret is more enamored of flashy features than he claims to be, or perhaps he thinks that the flamboyant visual style of his essay is essential to understanding it—I found the extreme typography more an irritant than an aid.

I doubt that Bret would get far as a bioinformatician, since he strongly holds the view that “only visually understandable data is considered sound”, but most of our data is too voluminous to handle with purely visual understanding.  We have to trust abstractions that we can’t see, because there is no way that we can visualize the terabytes or petabytes of data that make up our databases.

Of course, Bret is right that visualizing data is a very powerful metaphor, much more powerful than visualizing programs.  Huge amounts of effort go into coming up with new ways to visualize genomes, interaction graphs, protein structures, signalling pathways, metabolic networks, alignments, and other computational artifacts of bioinformatics. The visualizations are often extremely valuable in viewing small parts of the data.

Better visualizations do allow better views of the data: for example, sequence logos allow a summary view of an alignment with tens of thousands of sequences in it, showing what is conserved through evolution clearly. But viewing all the individual sequences (as earlier visualization tools did) is totally useless.

But visualization of data is just a metaphor, and, like all metaphors, it breaks down sometimes.  Some of the things we deal with frequently (like neural network weight matrices and parameters of SVM machines) are not particularly amenable to visual interpretation, and I would argue that they don’t need to be.  We can understand them well enough without seeing them, and seeing them wouldn’t add to our understanding.

Bret’s essay is an interesting one and worth the time to read, but far from convincing to me.  I don’t want students to “debug a program into existence”, which is essentially what his “create by reacting” and “create by abstracting” processes are. I want students to think before they act, at least much of the time, whereas Bret wants them to think after they act.

Some of the user interface issues he describes are interesting design challenges (like a graphics library designed for auto-completion), but I doubt that the design challenges could be met by a programmer who programmed in pure versions of the “create by reacting” and “create by abstracting” modes that Bret describes.

Thoughts about Mazur’s AP50 class

Filed under: Uncategorized — gasstationwithoutpumps @ 12:49
Tags: ,

On Turn to Your Neighbor: The Official Peer Instruction Blog, the latest post is 3 ways to get your students to like doing homework in a flipped class, which talks about Eric Mazur’s Applied Physics class at Harvard.  Eric Mazur is the poster boy for the peer-instruction movement, having gotten enormous improvements in his physics classes on widely accepted tests like the Force Motion Inventory by switching from a lecture-based approach to one using peer instruction.

This post by Julie Schell seems to me a bit misleading, as she provides pictures contrasting an enormous lecture hall with 100s of students with a flipped classroom showing a dozen students in a room equipped for maybe 30 students. Mazur’s poster boy status comes from his getting good results in huge classes, not from small, boutique classes, which many instructors can do well in with many different pedagogical aproaches.  She clarifies in a comment: “34 students, the preceptor is full time, and the room is a large open space with 10 round tables on wheels, each with a large whiteboard, also with wheels.” So the lecture course for 200 and the tiny course for 34 students with a faculty member and a fulltime preceptor are not at all comparable in price per student. Harvard can afford boutique freshman courses, but it is getting very difficult for public universities to do so.

The three ways mentioned in the title are simple:

  1. Graded on effort versus correctness
  2. Autonomy is encouraged
  3. Reflection is built in, rewarded, and the opposite of boring

The first point is questionable.  I think (hope) that what Mazur is doing is grading on the reasonableness of the argument, rather than on getting the same answer as the instructor.  For open-ended physics problems, there can be many different assumptions made, resulting in very different conclusions, all of which are correct in the context of the problem.  That is very different from grading only on effort, as students can put in a lot of effort in doing things in completely wrong-headed ways.  As an engineering professor I put a lot of weight on getting right answers to simple questions, and reasonable answers with good reasoning to complex questions, and I would expect physics professors to have a similar value system.

I think (hope) that Julie Schell has misunderstood what is happening in Mazur’s classrooms, and that what is really happening is that Mazur is assigning complex open-ended problems and assessing the correctness of the reasoning process, and not just effort as Julie claims.  There is a big difference between assigning problems that have many reasonable solutions and not caring whether what the students does is reasonable.  In engineering design classes (like the circuits course I’ve been boring my blog readers about), we often ask open-ended questions where the result is judged by whether the design works, not by whether it is the same as some canonical design.

I like seeing the second point.  One of the biggest problems I have with many approaches to peer instruction, which has so far stopped me from formally using it in any of my classes, is the ease with which students can offload their thinking to their peers. The approach Mazur has of asking students to work on their own first, then mark up their work in a different color during group work may help alleviate some of my concerns about freeloaders. I wonder how well it works with other groups of students, though, particularly those who are taking required classes whose material they are not very interested in.

The third point is again one I have trouble with “They are provided with a reflection handout, on which they write up their own reflections on how they can improve their learning and hand that in with their marked up work.”  I’ve always found such reflection exercises to be rather pointless makework and remain unconvinced that they actually add anything to student learning.  I know that that such reflection is very popular in ed schools these days (often to the exclusion of things I regard as more important), but is there any evidence that it really helps students with anything other than learning how to write bulls**t to satisfy teachers?

A lot of the peer-instruction model seems to rely heavily on students buying into the model and becoming seriously interested in learning the material (as opposed to just passing the class).  Instructors who can inspire their students to care about the material may do equally well with other pedagogical approaches.  (Mazur’s status as poster boy for the movement comes largely from before and after studies with him as instructor, removing a lot of instructor-charisma factor from the studies—the good results he got can be attributed largely to changes in his pedagogy.)

I suspect that peer instruction as described here relies on having enough high-performing students that group discussion corrects misunderstandings, rather than propagating them—or on having a good enough ratio of TAs and instructors to students that group errors can be caught and corrected before they become entrenched.  With the budget cuts over the past 2 decades and the expected budget cuts over the next 2 decades, it is getting harder and harder for public universities to provide an adequate teacher/student ratio.  Although Mazur is convinced that the approach is easily scalable, I suspect that the scaling does not allow the sort of teacher/student ratios that our administration forces on us.

Bad question for math classes

Filed under: Uncategorized — gasstationwithoutpumps @ 11:02
Tags: , , ,

Mr. K, a math teacher, in his blog post Math Stories : Quick check for understanding, suggested asking students the following question:

Pick two numbers, randomly. What is the probability that the product will be even?

This question illustrates the standard problem with the way high schools teach (or rather don’t teach) probability, a problem that still plagues scientists even after they are in grad school. The problem is that “picking randomly” is not an adequate description of a process, as no distribution is given. For example, I can pick two numbers randomly and always get an odd number, if the distribution I pick from has zero probability on the evens.

There are other problems with the question, like what Mr. K meant by “numbers”, but we’ll be generous and assume that in his classes “number” means “integer”, since the odd/even question otherwise makes no sense. It is also possible that Mr. K meant “decimal digit”, in which case the complaint I’m making below does not apply, and I’d have to change my critique to the sloppiness of using “number” to mean “digit”, but in my experience math teachers are fairly careful about the number/digit distinction, but sloppy about the word “randomly”, and so I will continue as if the problem is with the use of “randomly”. (Aside: that last, overly long sentence is an informal version of Bayesian reasoning.)

Often, when no distribution is given, people mean that they used the uniform distribution.  More specifically, they usually mean an independent, identically distributed process (i.i.d) drawn from a uniform distribution, that is, one where each item is chosen independently from the same underlying distribution, which happens to be a uniform distribution.  This is a mathematically easy choice to analyze, though it is often a poor choice for a null model. Bayesian statistics was panned for centuries, because of the poor choice of uniform priors in the initial development of the methods.

But for a countably infinite set like the integers, a uniform distribution can’t be defined—some numbers must be more probable than others or you can’t get the probabilities to sum to one over all integers. (You have the same problem with integrals if you choose the real or complex numbers.)  That means the standard meaning of “pick randomly” doesn’t exist, and the question is badly formed.

Mr. K probably meant for students to pick integers randomly from a distribution in which odd and even numbers were equally likely, in which case his question becomes trivial, with the probability of an even product being ¾.  We can even go a step further and say that if the probability of choosing an odd number in the underlying distribution is p, then the probability that the product is odd is p2.

The important part of the question is not the properties of odd and even numbers or of multiplying probabilities of independent events, which I believe are the understandings that Mr. K was interested in, but the importance of knowing what distribution you are drawing from, which I don’t believe Mr. K gave any thought to.

The same problem comes up all the time when biologists (and, presumably, other scientists) try to use p-values to establish statistical significance.  The p-value is thought of as the probability that the observed data could have arisen “by chance”, which is as bad a phrase as “picking randomly”. The crucial question is what that “chance” process is—for what distribution are you computing the probability?  This is the “null model” or “null hypothesis” and for the p-value to be at all interpretable, the null model must include every phenomenon other than the hypothesis you are testing.  That is, your null hypothesis is as complicated as your hypothesis, but leaves out one (hopefully crucial) idea.

Most scientists choose a mathematically tractable model that is unlikely to fit any real data (like the i.i.d. with a uniform distribution).  They then show that this ridiculously simple model can’t explain the data, and jump from there to the conclusion that their hypothesis must be correct (a leap of faith more suitable for theology than science).  All that they have really shown is that the stupid model is wrong, which everyone already knew.  (Except sometimes the data is so meager that even the stupid, obviously wrong model can’t be ruled out by frequentist techniques, but those papers rarely get published.)

A large fraction of the papers I read or referee have badly designed null models, often invalidating their conclusions, so I believe that this sloppiness about the use of the word “randomly” is a serious problem in the education of future generations of scientists.  And it isn’t hard to rewrite questions to avoid the sloppiness by being explicit about the random process:

  • Pick two integers from a distribution in which odd and even numbers equally likely.
  • Pick two numbers uniformly with replacement from the integers from 1 to 10.
  • Roll a fair 20-sided die twice.
  • Draw a card from a deck containing just ace through 10 cards (no face cards).  Replace the card, shuffle the deck, and draw again.

For the age group that Mr. K teaches, the dice or card processes are probably the best to use, as the vocabulary used by probability theorists is more likely to confuse than to clarify.

2012 September 29

Supplemental sheets, draft 2

This post updates  and replaces the Supplemental sheet for lecture, draft 1 and Supplemental sheet for lab, draft 1

Lecture Course

Undergraduate Supplemental Sheet
Information to accompany Request for Course Approval
Sponsoring Agency: Biomolecular Engineering
Course #:
101
Catalog Title: Applied Circuits for Bioengineers

Please answer all of the following questions using a separate sheet for your response.
1. Are you proposing a revision to an existing course? If so give the name, number, and GE designations (if applicable) currently held.

This is not a revision to any existing course.

2. In concrete, substantive terms explain how the course will proceed. List the major topics to be covered, preferably by week.

The Applied circuits course is centered around the labs in the accompanying lab course.  Concepts are taught as needed for the labs, with design and analysis exercises in the lecture course cementing the understanding.

  1. Basic DC circuit concept review: voltage current, resistance, Kirchhoff’s Laws, Ohm’s Law, voltage divider, notion of a transducer.
    The first week should cover all the concepts needed to do the thermistor lab successfully.
  2. Voltage and current sources, AC vs DC, DC blocking by capacitors, RC time constant, complex numbers, sine waves, RMS voltage, properties varying with frequency, phasors.
    The second week should cover all the concepts needed to do the electret microphone lab successfully.
  3. In preparation for the lab in which students model a pair of electrodes as R+(C||R), we will need a variety of both electronics and electrochemistry concepts: variation of parameters with frequency, impedance of capacitors, magnitude of impedance, series and parallel circuits, limitations of R+(C||R) mode, at least a vague understanding of half-cell potentials. Ag → Ag+ + e-, Ag+ + Cl- → AgCl, Fe + 2 Cl-→ FeCl2 + 2 e-.
  4. Concepts necessary for properly understanding digitized signals: quantized time, quantized voltage, sampling frequency, Nyquist frequency, aliasing. The accompanying lab is not a design lab but a hands-on demo for viewing the effects of quantization (both in voltage and in time) on real signals.
  5. Amplifier basics: op amps, AC coupling, gain computation, DC bias for single-power-supply offsets, bias source with unity-gain amplifier.  In the lab, students will design, build, and test a low-gain amplifier (around 10 V/V) for audio signals from an electret microphone. If time permits, we will add some simplified transistor models (current amplifier models) to allow the design of amplifiers with higher output power than the op amps we are using.
  6. Op amps with feedback that has complex impedance (frequency-dependent feedback), RC time constants, parallel capacitors, square-wave oscillator using op amp as comparator with hysteresis, capacitance-output sensors, capacitance-to-frequency conversion.   Topics are selected to support students designing a capacitive touch sensor in the accompanying lab.
  7. Detection of light: photoresistors, photodiodes, phototransistors, optoisolators. We will not be doing detailed device models, only looking at the differences in what the different photodetectors are good for and how to interface to them.  This week is intentionally a bit lighter than other weeks, to allow either review of concepts that students have struggled with, or to start earlier on subsequent concepts.
  8. Differential signals, twisted-pair wiring to reduce noise, strain gauge bridges, instrumentation amplifier, DC coupling, multi-stage amplifiers.
    Topics are selected to support the design of a 2-stage amplifier for a piezoresistive pressure sensor in the lab.
  9. Revisiting the hydraulic analogy, frequency response (both amplitude and phase), Bode plots. Topics are selected to support the use of pressure sensors to model a fluidic system (consisting of two reservoirs connected by a flexible hose) in terms of resistors, capacitors, and inductors.  Measurements of the system in the lab will be used to fit the model.
  10. The last week will include a little electrophysiology: action potentials, electromyograms, electrocardiograms.There will also be a bit more development of simple (single-pole) filters.
    Topics are chosen so that students can design a simple 3-wire electrocardiogram (EKG) in the lab.

3. Systemwide Senate Regulation 760 specifies that 1 academic credit corresponds to 3 hours of work per week for the student in a 10-week quarter. Please briefly explain how the course will lead to sufficient work with reference to e.g., lectures, sections, amount of homework, field trips, etc. [Please note that if significant changes are proposed to the format of the course after its initial approval, you will need to submit new course approval paperwork to answer this question in light of the new course format.]

This is a 5-unit course. Three and a half hours a week will be spent in lectures, 1–2 hours a week in discussion, 4 hours a week on readings, and 6 hours per week on homework and design exercises.  The reading/homework ratio will vary from week, but should sum to 8–10 hours a week.

4. Include a complete reading list or its equivalent in other media.

Wikipedia book: http://en.wikipedia.org/wiki/User:Kevin_k/Books/applied_circuits
Because no existing textbook covers all the material of the course, a collection of relevant Wikipedia articles has been made that covers all the major topics. The book is available online for free, but students can purchase a printed and bound version (about 350 pages), if they want. Some of the Wikipedia articles contain more detail than is needed for the course, but about 90% of the content is relevant and will be required.

Op amps for everyone by Ron Mancini http://www.e-booksdirectory.com/details.php?ebook=1469 Chapters 1–6 This free book duplicates some of the material in the Wikipedia book, but provides more detail and a cleaner presentation of some of the op-amp material.

Op Amp Applications Handbook by Analog Devices http://www.analog.com/library/analogDialogue/archives/39-05/op_amp_applications_handbook.html has some useful material, particularly in Sections 1-1 and 1-4, but is generally too advanced for a first circuits course. Readings in this book will be optional for the more advanced students.

The classic book The Art of Electronics by Horowitz and Hill has one of the best presentations of op amps in Chapter 4. Chapters 1 and 4, and parts of Chapters 5 and 7 are relevant to this course. Unfortunately, the book is now 23 years old and much of the description of specific chips is obsolete, and the book is still quite expensive. We will provide page and section numbers for optional readings in this book that correspond to the readings in the main texts, but not require this book.

5. State the basis on which evaluation of individual students’ achievements in this course will be made by the instructor (e.g., class participation, examinations, papers, projects).

Students will be evaluated on homework and design exercises, plus a final exam.  A midterm exam may be given, if the homework does not provide us enough feedback about student learning.

6. List other UCSC courses covering similar material, if known.

EE 101 covers some of the same circuit material, but without the focus on sensors and without instrumentation amps.  EE 101 has more low-level device modeling and less circuit design.

Physics 160 offers a similar level of practical electronics, but focuses on physics applications, rather than on bioengineering applications, and is only offered in alternate years.

7. List expected resource requirements including course support and specialized facilities or equipment for divisional review. (This information must also be reported to the scheduling office each quarter the course is offered.)

The lecture part of the course needs no special equipment—a standard media-equipped classroom with a whiteboard, screen, and data projector should suffice. Having a portable laptop-connected oscilloscope would make demos much easier to do, but is not essential.

The lecture course is not really separable from the associated lab course,whose equipment needs are described on the supplemental sheet for that course.

The course requires a faculty member (simultaneously teaching the co-requisite Applied Circuits course) and a teaching assistant or undergraduate group tutor for discussion sections and assistance in grading.  The same TA/group tutor can be used for both the lecture and the lab courses.

8. If applicable, justify any pre-requisites or enrollment restrictions proposed for this course. For pre-requisites sponsored by other departments/programs, please provide evidence of consultation.

Students will be required to have single-variable calculus and a physics electricity and magnetism course. Both are standard prerequisites for any circuits course. Although DC circuits can be analyzed without calculus, differentiation and integration are fundamental to AC analysis. Students should have already been introduced to the ideas of capacitors and inductors.

The prerequisite courses are already required courses for bioengineering majors, so no additional impact on the courses is expected.

9. Proposals for new or revised Disciplinary Communication courses will be considered within the context of the approved DC plan for the relevant major(s). If applicable, please complete and submit the new proposal form (http://reg.ucsc.edu/forms/DC_statement_form.doc or http://reg.ucsc.edu/forms/DC_statement_form.pdf) or the revisions to approved plans form (http://reg.ucsc.edu/forms/DC_approval_revision.doc or http://reg.ucsc.edu/forms/DC_approval_revision.pdf).

This course is not expected to contribute to any major’s disciplinary communication requirement.

10. If you are requesting a GE designation for the proposed course, please justify your request making reference to the attached guidelines.

No General Education code is proposed for this course, as all relevant codes will have already been satisfied by the prerequisites.

11. If this is a new course and you requesting a new GE, do you think an old GE designation(s) is also appropriate? (CEP would like to maintain as many old GE offerings as is possible for the time being.)

No General Education code is proposed for this course, as all relevant codes (old or new) will have already been satisfied by the prerequisites.

Lab course

Undergraduate Supplemental Sheet
Information to accompany Request for Course Approval
Sponsoring Agency Biomolecular Engineering
Course #
101L
Catalog Title
Applied Circuits Lab

Please answer all of the following questions using a separate sheet for your response.
1. Are you proposing a revision to an existing course? If so give the name, number, and GE designations (if applicable) currently held.

This is not a revision to any existing course.

2. In concrete, substantive terms explain how the course will proceed. List the major topics to be covered, preferably by week.

The course is a lab course to accompany BME 101, Applied Circuits for Bioengineers.  The labs have been designed to be relevant to bioengineers and to have as much design as is feasible in a first circuits course.

  1. Thermistor lab
    The lab will start with having students learn about the test equipment by having them use the multimeters to measure other multimeters. What is the resistance of a multimeter that is measuring voltage? of one that is measuring current? what current or voltage is used for the resistance measurement? The first lab will then have three parts, all involving the use of a Vishay BC Components NTCLE413E2103F520Lthermistor or equivalent.First, the students will use a bench multimeter to measure the resistance of the thermistor, dunking it in various water baths (with thermometers in them to measure the temperature). They should fit a simple Ae^{B/T}curve to this data (warning: temperature needs to be on an absolute scale).Second, they will add a series resistor to make a voltage divider. They have to choose a value to get as large and linear a voltage response as possible at some specified “most-interesting” temperature (perhaps body temperature, perhaps room temperature, perhaps DNA melting temperature). There will be a pre-lab exercise where they derive the formula for maximizing $latex|dV/dt|$. They will then measure and plot the voltage output for the same set of water baths. If they do it right, they should get a much more linear response than for their resistance measurements.

    Finally, they will hook up the voltage divider to an Arduino analog input and record a time series of a water bath cooling off (perhaps adding an ice cube to warm water to get a fast temperature change), and plot temperature as a function of time.EE concepts needed: voltage, resistance, voltage divider, notion of a transducer.  We will provide a data logger program for the Arduino, as computer programming is not a prerequisite for this course.

    Lab skills developed: use of multimeter for measuring resistance and voltage, use of Arduino with data-acquisition program to record a time series, fitting a model to data points, simple breadboarding.

    Equipment needed: multimeter, power supply, thermistor, selection of various resistors, breadboard, clip leads, thermoses for water baths, secondary containment tubs to avoid water spills in the electronics lab. Arduino boards will be part of the student-purchased lab kit (separate from rest of kit, so that students can use Arduinos purchased for other courses). All uses of the Arduino board assume connection via USB cable to a desktop or laptop computer that has the data logger software that we will provide.

  2. Electret microphone
    First, we will have the students measure and plot the DC current vs. voltage for the microphone. The microphone is normally operated with a 3V drop across it, but can stand up to 10V, so they should be able to set the Agilent E3631A  bench power supply to various values from 0V to 10V and get the voltage and current readings directly from the bench supply, which has 4-place accuracy for both voltage and current. There is some danger of the students accidentally delivering too much voltage and frying the mic, but as long as they get the polarity right, that isn’t too big a hazard. Ideally, they should see that the current is nearly constant as voltage is varied—nothing like a resistor.Second, we will have them do current-to-voltage conversion with a 5v power supply and a resistor to get a 2.5v DC output from the microphone and hook up the output of the microphone to the input of the oscilloscope. Input can be whistling, talking, iPod earpiece, … . They should learn the difference between AC-coupled and DC-coupled inputs to the scope, and how to set the horizontal and vertical scales of the scope.

    Third, we will have them design and wire their own DC blocking RC filter (going down to about 1Hz), and confirm that it has a similar effect to the AC coupling on the scope.

    Fourth, they will play sine waves from the function generator through a loudspeaker next to the mic, observe the voltage output with the scope, and measure the voltage with a multimeter, plotting output voltage as a function of frequency. Note: the specs for the electret mic show a fairly flat response from 50Hz to 3kHz, so most of what the students will see here is the poor response of a cheap speaker at low frequencies.

    Those with extra time could look at putting the speaker and mic at opposite ends of tube and seeing what difference that makes.

    EE concepts: current sources, AC vs DC, DC blocking by capacitors, RC time constant, sine waves, RMS voltage, properties varying with frequency.

    Lab skills: power supply, oscilloscope, function generator, RMS AC voltage measurement.

    Equipment needed: multimeter, oscilloscope, function generator, power supply, electret microphone, small loudspeaker, selection of various resistors, breadboard, clip leads.

  3. Electrode measurements
    First, we will have the students attempt to measure the resistance of a saline solution using a pair of stainless steel electrodes and a multimeter. This should fail, as the multimeter gradually charges the capacitance of the electrode/electrolyte interface.Second, the students will use a function generator driving a voltage divider with a load resistor in the range 10–100Ω. The students will measure the RMS voltage across the resistor and across the electrodes for different frequencies from 3Hz to 300kHz (the range of the AC measurements for the Agilent 34401A Multimeter). They will plot the magnitude of the impedance of the electrodes as a function of frequency and fit an R2+(R1||C1) model to the data, most likely using gnuplot. There will be a prelab exercise to set up plotting of the model and do a little hand tweaking of parameters to help them understand what each parameter changes about the curve.

    Third, the students will repeat the measurements and fits for different concentrations of NaCl, from 0.01M to 1M. Seeing what parameters change a lot and what parameters change only slightly should help them understand the physical basis for the electrical model.

    Fourth, students will make Ag/AgCl electrodes from fine silver wire. The two standard methods for this involve either soaking in chlorine bleach or electroplating. To reduce chemical hazards, we will use the electroplating method. As a prelab exercise, students will calculate the area of their electrodes and the recommended electroplating current.  In the lab, they will adjust the voltage on the bench supplies until they get the desired plating current.

    Fifth, the students will measure and plot the resistance of a pair of Ag/AgCl electrodes as a function of frequency (as with the stainless steel electrodes).

    Sixth, if there is time, students will measure the potential between a stainless steel electrode and an Ag/AgCl electrode.

    EE concepts: magnitude of impedance, series and parallel circuits, variation of parameters with frequency, limitations of R+(C||R) model.

    Electrochemistry concepts: At least a vague understanding of half-cell potentials, current density, Ag → Ag+ + e-, Ag+ + Cl- → AgCl, Fe + 2 Cl-→ FeCl2 + 2 e-.

    Lab skills: bench power supply, function generator, multimeter, fitting functions of complex numbers, handling liquids in proximity of electronic equipment.

    Equipment needed: multimeter, function generator, power supply, stainless steel electrode pairs, silver wires, frame for mounting silver wire, resistors, breadboard, clip leads, NaCl solutions in different concentrations, beakers for salt water, secondary containment tubs to avoid salt water spills in the electronics lab.

  4. Sampling and AliasingStudents will use a PC board that samples and digitizes an input with an 8-bit ADC, then reconstructs the waveform with a DAC. An existing lab has been used in other EE courses for explaining and demonstrating aliasing of sampled signals using this board, a signal generator, and a dual-trace oscilloscope. Note: this is a student-executed demo, rather than a design or measurement lab.EE concepts: quantized time, quantized voltage, sampling frequency, Nyquist frequency, aliasing.

    Lab skills: dual traces on oscilloscope.Equipment needed: ADC/DAC board, dual-trace oscilloscope, function generator.

  5. Audio amplifierStudents will use an op amp to build a simple non-inverting audio amplifier for an electret microphone, setting the gain to around 6 or 7. Note that we are using single-power-supply op amps, so they will have to design a bias voltage supply as well. We may increase the difficulty of the lab by requiring an extra transistor on the output to get higher currents to drive a loudspeaker.If this lab is too short, then students could feed the output of the amplifier into an analog input of the Arduino and record the waveform at the highest sampling rate they can with the software we provide (probably around 300–500 Hz). This would again demonstrate aliasing.

    EE concepts: op amp, DC bias, bias source with unity-gain amplifier, AC coupling, gain computation.

    Lab skills: complicated breadboarding (enough wires to have problems with messy wiring). If we add the Arduino recording, we could get into interesting problems with buffer overrun if their sampling rate is higher than the Arduino’s USB link can handle.

    Equipment needed: breadboard, op amp chip, assorted resistors and capacitors, electret microphone, Arduino board, optional loudspeaker.

  6. Capacitive touch sensorThe students will build an op-amp oscillator (a square-wave one, not a sine wave) whose frequency is dependent on the parasitic capacitance of a touch plate, which the students can make from Al foil and plastic food wrap. Students will have to measure the frequency of the oscillator with and without the plate being touched.Instead of breadboarding, students will wire this circuit by soldering wires and components on a PC board designed for prototyping op amp and instrumentation amp circuits. We will also provide a simple Arduino program that is sensitive to changes in the period of the oscillator and turns an LED on or off, to turn the frequency change into an on/off switch.

    EE concepts: frequency-dependent feedback, oscillator, RC time constants, parallel capacitors.

    Lab skills: soldering. Frequency measurement with multimeter.

    Equipment needed: Power supply, multimeter, Arduino, clip leads, amplifier prototyping board, oscilloscope.

  7. Phototransistor
    This lab will compare the use of phototransistors, photodiodes, and CdS photoresistors as light sensors.  Students will make optoisolators from an LED and each of the detectors and characterize the response of the optoisolator as a function of frequency.EE concepts: LEDs ,phototransistors, photodiodes, photoresistors, optoisolators.

    Equipment needed: breadboard, LED, phototransistor, photodiode, CdS cell, resistors, function generator, oscilloscope, multimeter.

  8. Pressure sensor 1—instrumentation amplifier
    Students will design an instrumentation amplifier with a gain of 300 or 500 to amplify the differential strain-gauge signal from a medical-grade pressure sensor (the Freescale MPX2300DT1), to make a signal large enough to be read with the Arduino A/D converter. The circuit will be soldered on the instrumentation amp/op amp protoboard. The sensor calibration will be checked with water depth in a small reservoir. Note: the pressure sensor comes in a package that exposes the wire bonds and is too delicate for student assembly by novice solderers. We will make a sensor module that protects the sensor and mounts the sensor side to a 3/4″ PVC male-threaded plug, so that it can be easily incorporated into a reservoir, and mounts the electronic side on a PC board with screw terminals for connecting to student circuits.  This sensor is currently being prototyped, and if it turns out to be too fragile, we will use a Freescale MPX2050GP, which has a sturdier package, but is slightly less sensitive and more expensive. (It also isn’t made of medical-grade plastics, but that is not important for this lab.) Note that we are deliberately notusing pressure sensors with integrated amplifiers, as the pedagogical point of this lab is to learn about instrumentation amplifiers.EE concepts: differential signals, twisted-pair wiring, strain gauge bridges, instrumentation amplifier, DC coupling, gain.

    Equipment needed: Power supply, amplifier prototyping board, oscilloscope, pressure sensor mounted in PVC plug with breakout board for easy connection, water reservoir made of PVC pipe, secondary containment tub to avoid water spills in electronics lab.

  9. Pressure sensor 2—modeling fluidics with linear circuits
    Students will use the pressure sensors and amplifiers from the previous labs to characterize a pair of water reservoirs connected by a flexible hose. One reservoir will be mounted on a homemade shaker table driven by a function generator and an audio amplifier. Pressure measurements will be made in both reservoirs and used to model the hose between the reservoirs. Note: this lab is still being prototyped and may still need to be adjusted to the appropriate difficulty for this course.
    EE concepts: hydraulic analogy, frequency response (both amplitude and phase), possibly transmission line modeling.

    Equipment needed: Power supply, instrumentation amplifier prototyping board, oscilloscope, Arduino, pressure sensor mounted in PVC plug with breakout board for easy connection, 2 water reservoirs made of PVC pipe, hose connections, secondary containment tub to avoid water spills in electronics lab, possibly home-made shaker table. Note: the shaker table and power amplifier is the most expensive piece of equipment not already in the lab: it will cost about $20–$30 to build for each of 12 stations.

  10. Electrocardiogram (EKG)
    Students will design and solder an instrumentation amplifier with a gain of 2000 and bandpass of about 0.1Hz to 100Hz. The amplifier will be used with 3 disposable EKG electrodes to display EKG signals on the oscilloscope and record them on the Arduino.

    Equipment needed: Instrumentation amplifier protoboard, EKG electrodes, alligator clips, Arduino, oscilloscope.

3. Systemwide Senate Regulation 760 specifies that 1 academic credit corresponds to 3 hours of work per week for the student in a 10-week quarter. Please briefly explain how the course will lead to sufficient work with reference to e.g., lectures, sections, amount of homework, field trips, etc. [Please note that if significant changes are proposed to the format of the course after its initial approval, you will need to submit new course approval paperwork to answer this question in light of the new course format.]

This is a 2-unit course. Three hours a week will be spent in scheduled labs, another 3 hours a week in pre-lab design activity and post-lab write-ups.

4. Include a complete reading list or its equivalent in other media.

Data sheets: Students will be required to find and read data sheets for each of the components that they use in the lab.  All components are current commodity components, and so have data sheets easily found on the web.  Other readings are associated with the lecture course.

5. State the basis on which evaluation of individual students’ achievements in this course will be made by the instructor (e.g., class participation, examinations, papers, projects).

Students will be evaluated on in-lab demonstrations of skills (including functional designs) and on the lab write-ups.

6. List other UCSC courses covering similar material, if known.

EE 101L covers some of the same basic electronic lab skills, but without the focus on sensors or design, and without instrumentation amps.

Physics 160 offers a similar level of practical electronics, but focuses on physics applications, rather than on bioengineering applications, and is only offered in alternate years.

7. List expected resource requirements including course support and specialized facilities or equipment for divisional review. (This information must also be reported to the scheduling office each quarter the course is offered.)

The course will need the equipment of a standard analog electronics teaching lab: power supply, multimeter, function generator,  oscilloscope,  computer, and soldering irons. The equipment in Baskin Engineering 150 (commonly used for EE 101L) is ideally suited for this lab. There are 24 stations in the lab, but only 12 function generators. Adding a dozen $300 function generators would make all 24 stations simultaneously usable, but the lab could be run with only half the stations, if all labs requiring function generators are done only with student pairs rather than individuals.  It is likely that many of the labs will be run with paired partners for pedagogical reasons anyway, so having 24 complete stations is not necessary for this course.

In addition, a few special-purpose setups will be needed for some of the labs. The special-purpose equipment was designed to be easily constructed with simple tools and to cost at most $50/station. One of the teachers is prototyping all the lab setups at home, to make sure that they can be effectively made within budget without expensive parts or much shop time.

There are a number of consumable parts used for the labs (integrated circuits, resistors, capacitors, PC boards, wire, and so forth), but these are easily covered by standard School of Engineering lab fees.

The course requires a faculty member (simultaneously teaching the co-requisite Applied Circuits course) and a teaching assistant (for providing help in the labs and for evaluating student lab demonstrations).

8. If applicable, justify any pre-requisites or enrollment restrictions proposed for this course. For pre-requisites sponsored by other departments/programs, please provide evidence of consultation.

Students will be required to have single-variable calculus and a physics electricity and magnetism course. Both are standard prerequisites for any circuits course. Most of the labs can be done without calculus, but it is essential for the accompanying lecture course.

9. Proposals for new or revised Disciplinary Communication courses will be considered within the context of the approved DC plan for the relevant major(s). If applicable, please complete and submit the new proposal form (http://reg.ucsc.edu/forms/DC_statement_form.doc or http://reg.ucsc.edu/forms/DC_statement_form.pdf) or the revisions to approved plans form (http://reg.ucsc.edu/forms/DC_approval_revision.doc or http://reg.ucsc.edu/forms/DC_approval_revision.pdf).

This course is not expected to contribute to any major’s disciplinary communication requirement.

10. If you are requesting a GE designation for the proposed course, please justify your request making reference to the attached guidelines.

No General Education code is proposed for this course, as all relevant codes will have already been satisfied by the prerequisites.

11. If this is a new course and you requesting a new GE, do you think an old GE designation(s) is also appropriate? (CEP would like to maintain as many old GE offerings as is possible for the time being.)

No General Education code is proposed for this course, as all relevant codes (old or new) will have already been satisfied by the prerequisites.

New amplifier and shaker table

For the pressure sensor labs, I’ve built a homemade shaker table using a function generator to drive a Dayton Audio TT25-16 PUCK tactile transducer mounted on a 9″ circle of ½” plywood sitting on large rubber feet.  I finally got a chance to try hooking up the 20W LP-2020A+ Lepai Tripath 20W amplifier that took a couple of weeks to arrive from China.

Perspective view of the shaker table, showing the clip intended to hold the water reservoir.

Top view of the shaker table. The two holes on the top right were used for mounting an ADXL335 accelerometer breakout board. Unfortunately, the shaker table does not move vigorously enough for that to produce a strong signal.
The extra cutout for the wires is too large—I was in a hurry and did a sloppy job.

Bottom of the shaker table, showing the Puck screwed to the plywood with 6 6×½” wood screws.

Before hooking up the amplifier to the shaker table, I decided to look at the output waveform with just the oscilloscope as a load. With the tone controls switched out, the amplifier looks fairly linear (on an X-Y plot on the oscilloscope) up to about 1kHz, but at higher frequencies I see a lot of ripple, and with a 7.5 kHz input there is a huge ripple for a signal at about 65kHz.  Once the 65kHz oscillation starts, it remains present even if the gain is turned down to 0.  Turning the gain back up can reduce the oscillation, until the gain is turned up too high.  The harmonic distortion is truly terrible around 12.5kHz, with the 5th harmonic being about half the amplitude of the fundamental.  At 10.35kHz, the 6th harmonic is large, at 9.53kHz, there is a ripple at 6.5 times the frequency of the fundamental, at 6.22kHz the ripple is at 10 times the frequency, and at 12.8kHz the ripple is 5 times the frequency.  So this ripple seems to be around 62–64kHz, with the frequency pretty much independent of the input.  The magnitude of the ripple depends on the input and is much larger when a harmonic of the input excites the instability.  When the gain is set too high, the ripple becomes quite large, even before clipping occurs.

The amplifier is advertised as a “class T” amplifier, which seems to be a slight variant of the “class D” digital amplifier design.  The 64kHz is probably the frequency of the underlying oscillator for determining when to switch the output transistor on and off, and the ripple is inherent to the digital amplifier design.  It seems much larger than I would have expected, though.  The ripple is not an artifact of the high-impedance load, as it is still very strong even with the 16Ω Puck as a load.

To avoid clipping with the 16Ω Puck as a load, the output voltage has to be kept down to about 6.5V RMS, which is about 8dB more gain than I got from the op-amp-and-transistor amplifier I used in Characterizing tactile transducer again.  I get a strong resonance from the amplifier around 64.5kHz and a mechanical resonance from the Puck around 23Hz.  I may have to use some softer feet, as the shaker table dances around a lot at the mechanical resonance.

I think that we may be better off using the op-amp-and-transistor amplifier, despite the lower power, because the 64.5kHz ringing of the LP-2020A+ amplifier may be too confusing to the students and may throw off RMS voltage measurements.  We could up the power of the op-amp-and-transistor amplifier. With a slightly higher power transistor, like the 2N4401, the op-amp-and-transistor amplifier would be limited mainly by the 6V power-supply limit for the MCP6002 op amp I used.  I don’t know whether this amplifier application is enough justification to change which op amp we plan to use.

For the driver amplifier, do we have the students design their own amplifier for the shaker table, do we give them a design and have them build it, or do we build it for them? This comes down to a decision about whether the shaker table is to be thought of as a pre-existing piece of equipment (like the oscilloscopes or multimeters) or as something that they are making (though we will do the mechanical construction for them, as they do not have access to a wood shop nor the time to make the shaker tables).

It might be useful to have them do the design, but then we’d have to talk about bipolar transistors as current amplifiers, and I was thinking that we would remove a lot of the usual device-level modeling from the course in order to have room for the op-amp design stuff.

 

 

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: