# Gas station without pumps

## 2014 June 12

### Starting on book for circuits lab—scheduling labs

Filed under: Circuits course — gasstationwithoutpumps @ 23:59
Tags: , , , , ,

In Revised plan for circuits labs I provided a tentative schedule for the applied circuits course and lab, which I ended up not really following (dropping the FET measurements, moving the sampling lab after the loudspeaker lab, and swapping the order of the pressure sensor and the class-D amplifier).

I’m now trying to turn the course lab handouts into a book (which means adding everything that was previously just in lectures), and I’m trying to rearrange the lab schedule to fit better into the 10-week quarter and to flow a little better pedagogically.

In this post, I’ll ignore the lecture component, but just look at a possible reordering of the labs.  Squeezing the KL25Z soldering and both halves of the thermistor lab was too much, and the sampling and aliasing lab did not work well late in the quarter, so I’ll strip the filter design out of the sampling lab and simplify it a bit to get it in the first week, and move the thermistor lab fully to the second week.  I’ll have to squeeze somewhere else, and I think that the best bet is the hysteresis lab, which took far longer than it should have.  I still want to have data-analysis Wednesdays, and reports due on Fridays.

I’m not really comfortable with the class-D amplifier in the week with Memorial Day. I’ll have to double check when Memorial Day comes next year.

## 2014 March 17

### Revised plan for circuits labs

Filed under: Circuits course — gasstationwithoutpumps @ 14:39
Tags: , , , ,

In Plan for rearranged circuits labs I provided a tentative schedule for the applied circuits course and lab,  which starts on 2014 March 31.But after my experimenting with optical pulse detection this weekend, I need to rearrange the labs to move the phototransistor lab later and allow more time for it.  This post is my attempt to do that rearrangement.

I’m not 100% satisfied with this schedule, and things will probably slip as I discover unexpected difficulties in student preparation, but I think it is likely to run more smoothly than last year, and last year was not bad.

If any of my readers have suggestions on improvements that could be made in the labs or the order of topics, please let me know. I have to buckle down and (re)write the lab handouts soon!

## 2014 March 12

### Plan for rearranged circuits labs

Filed under: Circuits course — gasstationwithoutpumps @ 22:50
Tags: , , , ,

The Applied Circuits for Bioengineers class starts on 2014 March 31. The big change from last year’s prototype run of the course is that we’ll have two 3-hour lab sessions a week, not just one, so I need to rewrite all the lab handouts to split the work (and, in many cases, increase it slightly). There are also a couple of labs that I want to replace or redo extensively, to make them more useful or require less assistance to the students.

This post, which I’ve been working on fairly solidly all week, is an attempt to schedule the labs for the quarter.  There are 20 lab slots (2/week for 10 weeks), and I plan to use them all, though I might keep one or two open late in the quarter for students who need extra time to catch up after illness or other absence.  Currently I’m planning for the Wednesday lectures between the two halves of the lab to be a data analysis and presentation day, often using Gnuplot.

One big question for me is when lab design reports will be due. If I make them due on Fridays, I can grade them over the weekend and get the feedback to students by the next class, but students will have very little time for the writeup. If I make them due on Mondays, I might not be able to get them back to the students for a week, but students will have more time for the writeup. Currently I’m leaning towards Friday due dates, as students should be writing up the labs the same day they do them, and Wednesdays will be a good time for them to ask questions about the lab data.

 Monday 2014 Mar 31 Administrivia: structure of course, rotating partners, labs not cookbook—need to read carefully before coming to lab. Pre-lab homework. Demo pressure sensor or EKG? Ohms law, voltage dividers. Homework: install gnuplot on own computers, read Wikipedia on thermistors and the Steinhart-Hart equation, draw voltage divider with schematic capture tool (probably Digi-key’s SchemeIt) Tuesday 2014 Apr 1 Unpacking parts, labeling capacitor bags, using wire strippers, making clip leads, measuring input resistance of multimeter, measuring thermistor resistance at many temperatures. Wednesday 2014 Apr 2 Do-now resistance-to-voltage converter. Gnuplot: fitting thermistor theory to measured data. Derivatives of voltage w.r.t. temperature to maximize sensitivity (and linearize output). Homework: install data logger on own computer and KL25Z, record accelerometer? Thursday 2014 Apr 3 Soldering headers onto KL25Z boards, downloading data logger to KL25Z, if not already done. Measuring voltage of thermistor voltage divider, recording voltage vs. time. See soldering instructions at Soldering headers on a Freedom board and Jameco soldering tips Friday 2014 Apr 4 Voltage-divider do-now exercise. Other temperature measuring devices (RTDs, thermocouples, silicon bandgap temp sensors). Monday 2014 Apr 7 Three-resistor do-now question. Feedback on design reports, i-vs-v plots, how electret mic works.  AC voltage (sine wave: amplitude, peak-to-peak, RMS voltage). DC blocking capacitors, RC filters (without complex impedance). Tuesday 2014 Apr 8 Measure I-vs-V DC characteristic of resistor and of electret mic, both with multimeter and with KL25Z board. Wednesday 2014 Apr 9 Gnuplot: plotting transformed data, fitting various models to i-vs-v (resistor, current source, blending of resistor and current source, more complex model). Thursday 2014 Apr 10 Look at mic with resistor load on oscilloscope (AC & DC coupling).  Capacitor for own AC coupling. Loudspeaker on function generator? Friday 2014 Apr 11 Another 3-resistor do-now question. Voltage sources, current sources, load lines, Thévenin and Norton equivalents. Monday 2014 April 14 Hysteresis. Applications: cleaning up noisy signals to on/off signals, feedback control. Differential equation for capacitor, derived from Q=CV, RC time constant. Basic idea of hysteresis oscillator (demo of touch tensor?) Tuesday 2014 Apr 15 Characterize hysteresis in Schmitt trigger chip using data logger. Breadboard hysteresis oscillator with various R and C values, measuring frequency or period (oscilloscope or frequency meter?) Wednesday 2014 Apr 16 Analysis of hysteresis oscillators: deriving formula for frequency. Homework: estimate increase in capacitance of touch sensor when touched.  Design hysteresis oscillator that will change period by factor of 2 or more when sensor touched.$e^{j \theta}= \cos \theta + j \sin \theta$, polar representation as magnitude and phase, $e^{j \omega t}$, current through capacitor for sinusoidal voltage, complex impedance. Thursday 2014 Apr 17 Make and test touch sensor with breadboard oscillator. Solder hysteresis oscillator. Note:I’ll have to write touch sensor code for KL25Z.Estimate capacitance of touch from change in period of hysteresis oscillator. Friday 2014 Apr 18 High-pass and low-pass RC filters as voltage dividers. Gnuplot plots and Bode plots for amplitude. Make sure they see ω=0 and ω=∞ simplifications, and straight-line approximations (f, 1/f, constant) away from corner frequency.  Introduce dB and dB/decade rolloff. Monday 2014 Apr 21 RC filter/voltage divider quiz/midterm Tuesday 2014 Apr 22 Impedance of stainless steel (polarizing) electrodes in different NaCl concentrations (at several frequencies). Wednesday 2014 Apr 23 Gnuplot: Functions for impedance: Z_C, Z_L, Z_parallel. Fitting R1+(R2‖C) models to data, maybe fitting other models?Polarizing and nonpolarizing electrodes. Properties of stainless steel (corrosion resistance in oxidizing environments, biocompatibility, poor choice for electrodes) Thursday 2014 Apr 24 Impedance of Ag/AgCl (non-polarizing) electrodes in different NaCl concentrations (at several frequencies) Friday 2014 Apr 25 Intro to op amps, unity gain buffer, transimpedance amplifier. Monday 2014 Apr 28 Theory of sampling and aliasing Tuesday 2014 Apr 29 Characterizing impedance of loudspeaker vs. frequency Wednesday 2014 Apr 30 Gnuplot: fitting models for loudspeaker impedance. Thursday 2014 May 1 Sampling and aliasing lab. Awkward that this gets split from sampling and aliasing theory, but I want to analyze loudspeaker data this week. Friday 2014 May 2 Inverting and non-inverting amplifier. Monday 2014 May 5 System thinking and block diagrams: developing for audio amplifier Tuesday 2014 May 6 Low-power single-stage audio amplifier with op amp Wednesday 2014 May 7 Do now: transimpedance amplifier.  Models for photodiodes and phototransistors.  (other photosensors?) Develop block diagram for phototransistor amplifier with bandpass. Thursday 2014 May 8 Photodiode and phototransistor with transimpedance amplifier.Fingertip pulse sensor? (doable at 3.3v with 700nm red LED, but I put a 627nm red LED in parts list—I’ll have to test with that also—may need higher gain to compensate for greater finger opacity at that wavelength).  Need higher gain for IR also.  I’d also need to drill a dozen blocks of wood for making the fingertip alignment blocks.  May need to use bandpass filtering (2-stage).  Too complicated for one day? Friday 2014 May 9 Op-amp quiz/midterm Monday 2014 May 12 Review of op amps based on quiz? Tuesday 2014 May 13 Measuring nFET current with constant VDS and varying VGS, also with constant VGS and varying VDS. (Diode-connected also?) Wednesday 2014 May 14 Gnuplot: fitting nMOS transistor models to measured data. Thursday 2014 May 15 Catch up lab day? measuring pFET current? Friday 2014 May 16 class D amplifier  concept.  nFET & pFET as switches. Monday 2014 May19 Developing class D block diagram Tuesday 2014 May 20 class D audio amplifier day 1(preamp and comparators) Wednesday 2014 May 21 Gnuplot: analyzing loudspeaker load, adding LC filter in front of loudspeaker to make sharp cutoff without ringing. Thursday 2014 May 22 class D audio amplifier day 2 (output stage) Friday 2014 May 23 Strain gauges and Wheatstone bridges. Instrumentation amps.  Homework: block diagram and design for pressure sensor. Monday 2014 May 26 Memorial Day, no class Tuesday 2014 May 27 Pressure sensor day 1: design and soldering instrumentation amp prototype board Wednesday 2014 May 28 catch up day? Thursday 2014 May 29 Pressure sensor day 2: further debugging.Recording pressure pulses from aquarium air pump?  Would need to buy some more air pumps. Friday 2014 May 30 Action potentials in nerve and muscle cells? Monday 2014 Jun 2 Why EKG signals differ based on placement of electrodes.  (Vector model) Tuesday 2014 Jun 3 EKG day 1:  breadboard and debugging (confident students could go directly to soldering) Wednesday 2014 Jun 4 Catch up? Thursday 2014 Jun 5 EKG day 2: soldering, debugging, and demo.  Last day for any catchup labs. Friday 2014 Jun 6 Catch up? Monday 2014 Jun 9 4–7 p.m. Final exam? (probably not needed, except as a lab catch-up day)

I’m not 100% satisfied with this schedule, and things will probably slip as I discover unexpected difficulties in student preparation, but I think it is likely to run more smoothly than last year, and last year was not bad.

If any of my readers have suggestions on improvements that could be made in the labs or the order of topics, please let me know. I have to buckle down and (re)write the lab handouts soon!

## 2012 December 26

### Three lab handout drafts done

Filed under: Circuits course,Raspberry Pi — gasstationwithoutpumps @ 15:09
Tags: , , , ,

On Tuesdays, my son and I usually have our weekly physics class, but in deference to the national holiday on Dec 25th we canceled this week’s class. I spent the day preparing drafts of lab handouts for the first three labs in the circuits course. The handouts are taking longer to produce than I expected, and they are coming out longer than expected also.  I’ll post links to the lab pages once they are past the draft stage—I’m hoping to get feedback from my co-instructor by next week.

1. The draft for the first (thermistor) lab is 10 pages, and still is missing pictures and a couple of paragraphs of text, particularly about using the data logger that my son is still writing for the students in the course to use.
2. The draft for the second (microphone) lab is 5 pages, and still doesn’t explain how to use an oscilloscope. We have both analog and digital scopes in the lab, and the analog ones a pretty easy to learn to use, but the Tektronix digital scopes have a very confusing menu interface that takes a long time to become familiar with. I still have to check out whether the function generators in the lab can drive a loudspeaker, as I’m expecting the students to be able to play sine waves into the microphones.
3. The draft for the third (electrodes) lab is also 5 pages, but it is looking fairly complete to me.

I’ve posted a tentative schedule for the 10 labs of the quarter, http://courses.soe.ucsc.edu/courses/bme194/Winter13/01/schedule:

1. Thermistor lab
2. Microphone lab
3. Electrodes lab
4. Sampling and aliasing lab
5. Audio amplifier lab 1 (op amps)
6. FET measurement lab, phototransistor measurement lab
7. Audio amplifier lab 2 (power amp)
8. Hysteresis lab (capacitive touch sensor, 1st soldering project)
9. Pressure sensor lab (instrumentation amp, soldering)
10. EKG lab

There is a little more measurement and less design content than I had wanted in the first half of the course—I’ve only come up with fairly trivial design exercises until we get to amplifiers, and then the designs get much harder.  I’m still trying to come up with a design lab for the phototransistors—right now I’m just looking a characterizing an LED and phototransistor pair for use as an optoisolator, with appropriate biasing for each to transfer analog signals (digital signals are too easy).  The students will have 3 LEDs (green, red, and infrared), so we could also look at the signal levels with each, to see whether the infrared emitter provides a better signal.

I don’t really know exactly what is in the sampling and aliasing lab, which my co-instructor created for a different course.  I’ll have to get his handouts for it, and type them up in the format I’m using for this course.  I’ll probably have to borrow a board from him also, to run through the lab myself.  It was probably designed as a 2-hour lab, not a 3-hour one, so I may want to add a bit to it.

The Digikey order for parts shipped today, the last on-line order I made, and it looks like the cost per student will be between $65 and$66 for tools and parts (see Parts orders for Applied Circuits W13 for more details on the pricing).  I still have to make a packing list for each kit, and put the kits together.  I hope that all the orders arrive by the middle of next week, so that we can distribute the parts kits on Wednesday 2013 Jan 9.

I also hope I’ll be able to package the kits in 1-gallon ZipLock bags—I’m beginning to think I might need to leave the loudspeakers separate, and that it will still be a tight fit. ZipLock does make bigger bags: 3 gallon, 10 gallon, and 20 gallon), but at \$1.18 each for the 3-gallon bags, I’d rather not go there—even 40¢ each for the 2-gallon bags is a bit high.

I’ve also been thinking of getting an Arduino Leonardo for testing my son’s DataLogger code, as the Leonardo has a different serial interface and a different number of analog and digital pins available: 20 I/O pins, of which 7 can be configured for PWM and 12 as analog inputs though 3 of those are also PWM pins, as opposed to the 20 I/O pins of the Uno, 6 of which can be configured for PWM and 6 as analog inputs.  There are several other incompatibilities (like where the TWI interface and that the Leonardo does not reset when the serial connection is first opened as on all previous Arduino boards).  Designing shields for Arduino boards has gotten much more complicated lately, as Arduino has proliferated a number of incompatible interfaces.  I think that this might hurt them in their main market.  I’m wondering it the Raspberry Pi is cheap enough, available enough, and easy enough to interface and program to edge out Arduino in the next few years.  I have some Raspberry Pi boards now, and when I get some time I’ll want to try playing with them.

## 2011 April 5

### Shifting Phases: Quick Fixes for Canned Labs

Filed under: Uncategorized — gasstationwithoutpumps @ 17:46
Tags: , ,

Mylene has just posted an interesting approach to fixing canned lab exercises: Quick Fixes for Canned Labs (Semester Review Pt 3).

The idea is simple:  don’t assign labs in numerical order, but provide a library of lab exercises and assign things like “make a prediction about … and do an experiment to test your prediction”.  The students have to either design their own experiments or find a relevant one.  To finish the assignment, they have to present their prediction (and the theory they used to generate that prediction), the experiment to test the prediction, and explanations of discrepancies between what they predicted and what actually happened.

She also mentions focusing the students on measuring the differences between reality and predictions, rather than on trying to make an experiment demonstrate a theory.