Gas station without pumps

2016 August 20

Using 4¢ diode for log-transimpedance

In Transimpedance pulse monitor does need low-pass, I realized that Schottky diodes were not going to work well for the transimpedance amplifier, and in Using nFET body diode for log-transimpedance, I tested using the body diode of a power nFET, finding that it worked quite well over at least 7.5 decades (from 1nA to 40mA).  But I wanted to see whether students could use a cheap 4¢ general-purpose diode.

I used the same setup as when testing the nFET body diodes.  The results were pretty much the same whether I used a 1N914B or 1N4148 diode (they share a datasheet, but the 1N914B has somewhat better constraints on the forward voltage):

The gain (in mV/dB) is about 85% larger than using an nFET body diode.

The gain (in mV/dB) is about 85% larger than using an nFET body diode.

Note that at currents over about 1mA the diode current starts to saturate, deviating from the exponential pattern.

Note that at currents over about 1mA the diode current starts to saturate, deviating from the exponential pattern.

When I tried using the 1N914B diode in the same log-transimpedance amplifier as I used for the nFET body diode, it didn’t work—I got output that looked nothing like a pulse (nor like 60Hz interference). I could recover proper behavior by putting a large (100nF) capacitor in parallel with the diode, to make a low-pass filter to remove signals above a few Hz, but that wasn’t necessary for the nFET body diode (perhaps it had enough internal capacitance to do the filtering). I could reduce the capacitor to 100pF, with 60Hz interference coming in, though not being too bad, but reducing to 10pF gave me noise again rather than the pulse signal.

I was hoping not to need that extra capacitor, because the design is already more complicated than I would like for this stage of the course, and figuring out what capacitor to use is difficult—trial and error is easier than rational design here!

I tried tracking down the big, short (less than 250µs) spikes that were corrupting the signal. The first thing I tried cleaned up the problem entirely: disconnecting the power supply from the laptop so that the USB power was coming from the laptop battery rather than the power supply . That this worked actually surprised me, since the 3.3V supply and the 1.65V Vref both had beefy bypass capacitors.

I don’t know whether the noise problems are in the microcontroller (which is providing the regulated 3.3V from the noisy USB 5V) or are coupled into the analog circuit some other way. Putting a 10µF capacitor from the USB5V to GND did not help when the power supply was connected, so perhaps the problem is radiated from the power-supply cable rather than conducted through the USB cable.

I’ve noticed problems before with noise from the laptop power supply causing problems in my analog circuits (the 90kHz interference in my ultrasound experiments), and I’ve see much bigger problems with some of the cheap Windows laptops students use. The bottom line, I guess, is that  I have to tell students to run PteroDAQ from battery power, not switching-supply power, even if the power supply seems more than adequately bypassed.

2016 August 13

Transimpedance pulse monitor does need low-pass

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 18:16
Tags: , , ,

In More thoughts on log-transimpedance for pulse monitor lab, I wondered

I’m wondering now whether I can have students do a log-pulse monitor without bandpass filtering—just high-pass to get rid of the DC signal from overall illumination.  Given the new position of the lab in the course, as the second amplifier lab, I don’t really want to get too tricky with RC filtering.  The “gotcha” that was a problem before is that I had to remove short glitches in the very first stage, to avoid the bandpass filter lengthening them into things that looked like pulses—I don’t want students to have to do that sort of debugging on their second amplifier lab. If I can eliminate the hardware bandpass filters, and just have them use software ones, then the lab becomes more feasible.

I was also concerned that the Schottky 1N5817 diode I had tested did not have provide gain at low currents—the low threshold voltage for Schottky diodes is a disadvantage in this application. So this morning I wired up a log-transimpedance amplifier followed by a couple of op amps as inverting amplifiers.  I first tried a combined gain of 408 (which I had used before with an IR emitter as the transimpedance diode), then upped the gain to 4453. I used high-pass filters to block DC, but no low-pass filters.

The circuit was not functional without adding at least one low-pass filter (a 680nF capacitor in parallel with the diode), because the 60Hz interference saturated the amplifiers, and the smaller pulse signal was completely buried.

With the capacitor, the circuit worked fine in moderately high light, but the signal got weak in low light (due to the transimpedance amplifier having a max gain of about 35kΩ—the asymptotic equivalent resistance of the diode as current goes to 0).  With just the single capacitor for filtering, the 60Hz noise was larger than the pulse signal, but a digital filter could still recover the signal:

Notch filtering does a great job of removing the 60Hz noise from this signal sampled at 360Hz.

Notch filtering does a great job of removing the 60Hz noise from this signal sampled at 360Hz.

So it looks like I do have to have students do low-pass filtering for the pulse monitor. Can I fit that into the second amplifier lab, along with the log transimpedance, or will it all get too complicated?

2016 August 12

More thoughts on log-transimpedance for pulse monitor lab

I’ve been having some more thoughts on having students do a log-transimpedance amplifier for the optical pulse monitor lab (see Pulse monitor with log-transimpedance amplifier). Previously I’ve looked at V-vs-I curves for base-emitter junctions and for the IR emitter—the silicon transistors gave me about 60mV per decade of current, and the IR emitter gave me about 105mV/decade.

I’ve been thinking of having students do the V-vs-I fitting for a simple diode. I don’t have any signal diodes at home at the moment, so I tried testing a 1N5817-TP Schottky diode (about 16¢ in 100s). I used the same setup that I used for testing power nFETs, so I could go up to a high current, but did not have good resolution at low voltages and currents.

The Schottky diode has about 63.6mV/decade, up to around 100mA.

The Schottky diode has about 63.6mV/decade, up to around 100mA.

The Schottky diode has a very similar slope to the emitter-base junctions I’ve tested in the past, but I’d really have to test down to much lower currents—we’re interested in the range 10pA to 500µA, which is buried in noise in these measurements.

I can get down to 1µA fairly easily, by eliminating the voltage dividers and just using unity-gain buffers to get low-impedance values to drive the analog-to-digital converters. I tried with four different sense resistors (470Ω, 15kΩ, 560kΩ, and 5.6MΩ) and got very consistent results. The noise levels are much lower, because the larger sense resistor and lack of voltage divider makes for much larger voltages being measured for the current-sense channel.  I also used the differential ADC channel for measuring the voltage across the sense resistor, which should remove a little noise compared to taking separate measurements and subtracting them.

I have more confidence in the 60.2mV/decade and 0.37V offset from these measurements than the high-current measurements I did for the first plot. At low currents, the diode behaves more like a 33kΩ resistor than like a logarithmic element.

I have more confidence in the 60.2mV/decade and 0.37V offset from these measurements than the high-current measurements I did for the first plot.
At low currents, the diode behaves more like a 33kΩ resistor than like a logarithmic element.

The 60.2mV/decade fit seems pretty good from 10µA to 10mA, and the noisier high-current measurements suggest that it is good to 100mA.  The sensitivity is less below 10µA and more above 10mA, behaving almost like a fixed 33kΩ resistor at low currents.

I can get a pretty good fit over a wide range with a three-parameter model of the equivalent resistance as a function of current: a resistor in parallel with a device that has a power-law fit for resistance as a function of current:

There is no theoretical justification for this model, but it seems to match the data better than the standard voltage-as-logarithm-of-current model, at least at low currents.

There is no theoretical justification for this model, but it seems to match the data better than the standard voltage-as-logarithm-of-current model, at least at low currents.

At low currents, the Schottky diode acts like a 35kΩ resistor, but at high currents, the voltage seems to be 0.409 I. This model seems to fit to better than 10% over 7 decades, which is not too bad for a 3-parameter model!

I’m wondering now whether I can have students do a log-pulse monitor without bandpass filtering—just high-pass to get rid of the DC signal from overall illumination.  Given the new position of the lab in the course, as the second amplifier lab, I don’t really want to get too tricky with RC filtering.  The “gotcha” that was a problem before is that I had to remove short glitches in the very first stage, to avoid the bandpass filter lengthening them into things that looked like pulses—I don’t want students to have to do that sort of debugging on their second amplifier lab. If I can eliminate the hardware bandpass filters, and just have them use software ones, then the lab becomes more feasible.

2016 August 5

Digilent Analog Discovery 2 USB Oscilloscope

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

I have recently learned about a new USB oscilloscope, Digilent’s Analog Discovery 2, which seems to be a step up from the BitScope BS10 USB oscilloscope that I currently own. Digilent’s offering has differential inputs, 14-bit ADC (instead of 8), 100MS/s (instead of 40MS/s), and much nicer-looking user interfaces (no more black background!).  It costs a little more ($279 vs. $245, both costing more to get BNC connectors for higher-speed oscilloscope probes), but Digilent has an academic program that reduces the cost to only $179, so that even with an extra $20 for the BNC adapter and $20 for scope probes, the price is still lower than the BitScope.

I’m considering getting the Analog Discovery 2 scope (if I qualify for the academic discount), but I’ll probably wait until I replace my laptop.  The free Waveforms 2015 software runs on a wide range of Windows versions, but only 10.9 or newer on Mac OS.  (It also runs under some versions of Linux).  I’m still running Mac OS 10.6.8 on my laptop, and I don’t want to “upgrade” to a newer OS on the old hardware—I’m planning to replace the laptop this year, but I’m waiting to see whether Apple comes out with a usable MacBook Pro in 2016, or whether they’ve gone all in for connector-less laptops, in which case I’ll probably have to switch to a cheaper, but clunkier Linux laptop.

One of the things I like about Digilent’s marketing is that they have a very thorough reference manual online, which goes through the design of the hardware, explaining the schematics and some of the design choices for what chips they used. The online reference manual for Waveforms 2015 seems decent, but not as thorough as the hardware manual.

I’m curious whether any of my readers have tried the Digilent USB oscilloscopes.

2016 August 3

Possible new lab order

Filed under: Circuits course — gasstationwithoutpumps @ 12:09
Tags: ,

I’ve been thinking about how to rearrange the labs (and the textbook) for a more sensible 2-quarter sequence. I need to have the basics done before October, since that is when I have to tell the lab staff what tools and parts to order for the winter quarter class.

Currently, the first half of the course is mainly voltage dividers and device characterization, and the second half is mainly amplifiers, but I’m thinking of changing the split so that all the audio stuff (microphone, loudspeaker, preamp, class-D amplifier) are in the second half, moving some of the other amplifiers (pressure sensor instrumentation amp and optical pulse monitor) to the first half.

There are 20 95-minute lab sessions each quarter, which is about the same total time as the 20 3-hour sessions of the old design (splitting a 3-hour session into two sessions adds some setup and teardown overhead, so two 95-minute session is no more than one 3-hour session, and may actually give students less time).

Here is the tentative new lab order:

1 T get parts, one person solders headers, other identifies and sorts parts
2 Th partners swap roles.
3 T Thermistor resistance measurement (ohmmeter) ice water
4 Th Thermistor resistance measurement (ohmmeter) hot water
5 T Thermistor voltage measurement (calibration check & recording)
REPORT (recording thermometer design)
6 Th function generator, oscilloscope, and PteroDAQ for time-varying signals. This is a tools lab, and I’m not sure exactly what form it will take.
7 T Sampling and aliasing (fixed sampling freq, downsample, record 0.1, 0.2, 0.4, 0.45, 0.5, 0.55, 0.6, 0.8, 0.9, 1.0, 1.1, 1.45, 1.6, 2.1 times sampling freq)
8 Th Sampling and aliasing continued (fixed input frequency, adjusting sampling frequency)
REPORT (sampling and aliasing)
9 T hysteresis threshold measurements using PteroDAQ & slow function generator, using 2 methods:

  • plotting Out-vs-in (with lines)and
  • Trigger on rising, trigger on falling to get thresholds.

Maybe add noise generator + power-supply → PteroDAQ digital inputs with and without hysteresis, but inputs on Teensy LC and Teensy 3.1/3.2 already have 0.06*Vdd = 200mV of hysteresis—maybe 74HC14N vs 74HC04, using PteroDAQ to look at digital output?

10 Th hysteresis oscillator on breadboard, view waveform on oscilloscope
11 T solder hysteresis oscillators & show PteroDAQ recording of freq vs. time for touch sensor
REPORT (hysteresis and relaxation oscillator)
12 Th Pressure sensor and instrumentation amp (low gain)
13 T Pressure sensor and inst amp + 2nd-stage op amp
14 Th Recording blood pressure measurements
15 T Drilling holes and recording breath pressure
REPORT (pressure sensor and instrumentation amp)
16 Th LED I-vs-V, phototransistor I-vs-V (dark), phototransistor I-vs-V (room light).
Question: how to make dark be dark enough?
Should we do phototransistor I-vs-V for room light through fingers?
17 T first-stage transimpedance, set gain to avoid saturation with DC.
Should I introduce log-transimpedance amplifier? Better design, but probably too much for first op-amp lab.
18 Th first-stage transimpedance, measure AC signal
19 T add high-pass & second-stage
20 Th low-pass in transimpedance to reduce 60Hz interference? 3-stage amplifier?
REPORT (optical pulse monitor)
quarter break
21 T get new parts + Microphone I-vs-V DC characterization
22 Th Microphone I-vs-V DC characterization
23 T Loudspeaker impedance
24 Th Loudspeaker impedance
REPORT (audio transducers)
25 T Mic preamp first stage
26 Th Mic preamp second stage
27 T Mic preamp soldering
28 Th Mic preamp soldering
REPORT (Mic preamp)
29 T nFET + pFET Id-vs-Vgs, Ron-vs-Vgs ??
Doing this right for power FETs is harder than I initially thought, so we’ll probably have to skip it, unless I come up with some clever way to make it easy.
30 Th Class D power amp
31 T Class D power amp
32 Th Class D power amp
REPORT (Class-D power amp)
33 T Electrode impedance (stainless steel)
34 Th Electrode impedance (stainless steel)
35 T Electroplating Ag/Agcl
36 Th Electrode impedance (silver)
REPORT (electrode impedance)
37 T EKG
38 Th EKG
39 T EKG
40 Th EKG
REPORT (EKG)

I’m thinking that reports will be due either Friday (for labs that end on a Tuesday) or Monday (for labs that end on a Thursday), with the intent of grading the labs on the next weekend and returning them on the following Monday.  There are still 10 lab reports due, but they are now spread over two quarters, so only biweekly, rather than weekly.

I’d like hearing from people (particularly students who’ve taken the course) about the order for the labs, the time allotted here for each lab, and ideas for things to add or remove. If no one has any better ideas, I’ll start rearranging the chapters of the book this week.

Next Page »

Create a free website or blog at WordPress.com.

%d bloggers like this: