# Gas station without pumps

## 2017 December 16

### Laser cutting electrode holders

Filed under: Circuits course — gasstationwithoutpumps @ 17:30
Tags: , ,

Because my applied electronics lab will have labs of 50 students (25 stations), I’ve needed to make a number of new setups. The lab will be taught in a space that is not normally a lab, so I’ll need to wheel in the equipment and set it up before the lab sessions and pack it all back up and wheel it out every Tuesday and Thursday.  Luckily, the lab is not very expensive—equipping all 25 stations, including storage tubs and the cart, cost lest than \$10,000.  That is less than the cost of one station in the lab that we used in the past.

Some of the setups for the lab require me to build some equipment (pressure sensor breakout boards, stainless steel electrodes, electrode holders for silver wire electrodes, … ).  I made the stainless steel electrodes over the summer, and this week I made new electrode holders.

The electrode holders are laser cut from acrylic sheet.  Earlier this quarter I tried cutting them from 3mm acrylic from the hardware store, but that did not turn out well.  The lines that were supposed to be etched only partway through the pieces ended up cutting all the way through, even though I was using the laser cutter on its lowest setting and highest speed.

This week I used some 5.3mm thick acrylic sheet.  I cut at 8mm/s at the highest setting, and made the marking lines at 180mm/s at 20–25% power (the lowest setting).

A holder as it came from the laser cutter, with the protective paper still covering the acrylic.

The same holder with protective paper removed.

The holder with 6″ silver wire mounted so that alligator clips can attach to the wires at the top, while the bottom is immersed in salt water.

The marking worked fine, and the first few holders I cut were fine, but several of them did not get cut all the way through, which I did not notice until I had removed the acrylic from the laser cutter (so I couldn’t just cut the lines again).  I ended up having to snap several of the partially cut holders from the waste material.

One of the failed cuts—the ear broke off when I tried snapping the holder from the waste material around it.

I made enough spares that the two for which the ears broke off can be discarded, but I will have to use my rifflers to smooth some of the edges and open up notches on a few of the holders.

## 2016 December 16

### Two-electrode vs. four-electrode impedance spectroscopy

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

Four electrodes with 1cm spacing.

Today I decided to revisit the water-conductivity experiments for the course, now that I have an easy way to do proper impedance spectroscopy (including phase information as well as magnitude), using the network analyzer function of the Analog Discovery 2 USB oscilloscope. I wanted to look at 4-electrode measurements, as well as the 2-electrode measurements we’ve done in the past.

First, I made myself a 4-electrode device, by cutting some ⅛” stainless-steel welding rod (316L rod for TIG welding) into 15cm pieces, drilling 4 ⅛” holes in a scrap of cutting-board plastic, and driving the rods through the holes with a hammer.

I then immersed the short end in tap water (using a mason jar, so that the long end stuck out the top) and used alligator clips to attach wires from the electrodes to a breadboard.

I connected the function generator through a series 1kΩ resistor to one of the end electrodes and ground to the other end electrode.  Channel one of the oscilloscope measured the voltage across the 1kΩ resistor (hence the current in milliamps).

Channel two of the oscilloscope was connected to either the two end electrodes (making a 2-electrode measurement similar to what we’ve done for years in the class), or to the two middle electrodes, for a 4-electrode measurement.  The idea of a 4-electrode measurement is that there is an electric field established in the bulk material by the outer electrodes, and the middle electrodes can measure that field without interference from surface effects that occur on the electrodes that are providing the current.

I used the network analyzer function to sweep from 2Hz to 10MHz.  I exported the data so that I could plot it as impedance (rather than as just the dB ratio of the two measured voltages).  For the 2-electrode measurement, we are measuring the impedance of the water and electrodes (voltage across the electrodes divided by the current through them), but for the middle electrodes, we’re looking at the voltage across the middle electrodes, divided by the current through the end electrodes.

The voltage across the middle electrodes is nearly a constant, up to about 1MHz, where wiring inductance starts to matter. The surface chemistry interferes with measurement of bulk properties at low frequencies for the 2-electrode measurement.

The plot of the phase shows even better why 4-electrode measurement is useful:

The capacitive nature of the two-electrode system is seen at low frequencies, but the 4-electrode system has a resistive, nearly 0° phase shift (up to the point where the inductance of the wiring to the reference impedance starts to matter).

I don’t think I’ll switch to 4-electrode measurements this year (if for no other reason than that I’d have to make a dozen new electrode sets), but I’ll keep it in mind for next year.

## 2015 May 3

### Ag/AgCl electrode lab went ok

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

Like on Tuesday, on Thursday I spent a long time in the lab, from about 9 a.m. to after 6 p.m., because it takes a fair amount of time to set up and clean up when we are dealing with liquids (in this case, salt water) in the electronics lab.  The lab itself went fairly smoothly and the students all seemed to be collecting good data.

As I feared, we ran out of one of the 4 stock solutions: 3l per concentration for 28 students was not enough, unless students shared by transferring solutions from one group to another.  Next year I’ll have to get 200ml/student made up, or change the way the lab is run so that students have 6 sets of cups already pre-poured, and just grab a cup that they haven’t already used.  I worry a bit about careless students not cleaning and drying their electrodes between uses, though and contaminating a low-salt solution with salty electrodes.

I had one surprise this year.  We changed which brand of EKG electrodes we ordered (from Vermed to some foam-backed electrode with no brand name—not a substitution I remember approving, but I probably would have if asked).  It turns out that the new electrodes do not seem to be silver/silver-chloride.  Instead of resistance around 10Ω as the Vermed electrodes have, the new ones are in the 10MΩ range.  They must be using some polarizable electrodes instead of non-polarizable Ag/AgCl.  I hope that they work ok for the EKG lab at the end of the quarter (10MΩ should be ok, as the instrumentation amps and op amps have input impedances of 1GΩ and 10TΩ respectively, so a mere 10MΩ resistance should be negligible).

I am going to have to rework a big chunk of the book this summer, though, as the measurements ran into trouble with the input impedance of the voltmeters not being too large to matter, as we usually assume.  The AC voltmeters claim to have 1MΩ  || 100pF, which is great at low frequency but at 1MHz, that’s only 1.6kΩ.  The 1MΩ is tightly specified, but I believe that the 100pF is only an upper bound: there may be considerable variation in the capacitance from meter to meter.

The students who were attempting to measure the impedance of the new foam-backed EKG electrodes were probably actually measuring the impedance of the voltmeter.  Several of the measurements of the stainless-steel electrodes were also marred by the input impedance of the voltmeters.  On Tuesday afternoon, if I have any spare time in the lab, I’ll try measuring the input impedance of the voltmeters myself, to see what it looks like.  The test setup will be a simple one: two voltmeters in series, driven by a function generator.  I’ll shunt one of the voltmeters with a smallish resistor (say around 500Ω) and plot the ratio of the two voltages as a function of frequency (I’ll need a moderately high voltage from the function generator to make sure that the voltmeter on the shunt has enough voltage).  The voltage ratio should follow a simple pattern: $\frac{V_{meter1}}{V_{shunt}}=\left| \frac{Z_{meter1}}{R_{shunt} || Z_{meter2}} \right|$.  I can model the meters as a 1MΩ resistor in parallel with an unknown capacitor and fit the parameters (trying both meters having the same capacitance, and having different capacitances).  I can even do another set of measurements swapping which meter I shunt.

I think that a lot of the weird data we saw in Tuesday’s lab came from using large shunt resistors, so that the voltmeter impedance became more important (smaller) than the shunt resistor.

I’m considering also putting in the book a derivation of how to compensate for the meter impedance (if it is known).  I think that I’ll move the electrode lab later next year, closer to the EKG lab, so that we can go more directly from the microphone lab and the loudspeaker lab into the audio amplifier lab, and so that the electrode characterization is more immediately motivated.

In Friday’s lecture, I talked briefly about the possibility that the problems we were seeing with model fitting were that we had neglected the voltmeter input impedance, but I did not work out the details, because I had to introduce them to op amps and negative-feedback amplifier configurations.

I like to use a generic negative-feedback configuration, which includes inverting and non-inverting amplifiers as special cases, as well as the single-power-supply variants:

Generic negative-feedback amplifier design using op amps.

On Friday we got through the derivation of the various gain formulas, based on letting the open-loop gain go to infinity, but I’ll have to refresh that on Monday and introduce the unity-gain buffer: especially the unity-gain buffer as a voltage source for a reference voltage between the power supply rails.

## 2015 April 29

### More model fitting in lecture

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

Today’s lecture was all about fitting models for the electrode data. I started by showing them how one could hand-sketch Bode plots, at least for RC and RL circuits.  We did a hand plot and a gnuplot plot for the $R_{s} + (R_{p} || Z_{c}(C))$ model with arbitrary values, showing the initial horizontal $R_{s} + R_{p}$, the final horizontal $R_{s}$, and the diagonal at $\frac{1}{2\pi f C}$.

In class I went through trying to do fits to data collected for stainless-steel electrodes, and showing how to debug various problems (it was all live-action plotting—I did not script my actions).  The biggest problems were getting very bad fits (in one case from taking the log of the function but not the log of the data, in another case from having bad initial values) and singular matrices (mainly from having variables in the function that didn’t affect the fit, though in some cases from trying to fit complex models to real data without taking absolute value of the complex model).

It turns out that the standard R+(R||Z_C) model is very hard to fit to the data we collected for the stainless steel electrodes.  The oxide coatings don’t leak much current, so we had no low-frequency plateau for estimating the parallel resistance from.  I suggested making the parallel resistance infinite and using a simple R+Z_C serial connection.  That can model the data well at high frequencies, where the change in |Z| is fairly small, but at low frequencies the model is poor.

I came up with a different model on the spur of the moment (not one I had ever tried before on electrode data): $R + \frac{1}{j \omega^\alpha D}$ with a capacitor-like element having a smaller slope that the normal 1/f slope of a capacitor (about 0.6).  This turned out to fit the data quite well.  I don’t have a convincing physical explanation for the exponent α, but I suspect it has to do with diffusion times for ions near the surface of the electrode and depletion regions in the electrolyte.

In the new model, the R term probably corresponds to the bulk properties of the electrolyte solution and the $\frac{1}{j \omega^\alpha D}$ term to the surface chemistry at the electrode, so 1/R should be proportional to the concentration of the NaCl, I think.  I wonder whether students will get that result in their fits.  I’m thinking that I should rewrite some of the book to incorporate this model.

I ended by trying to model some of the data collected by students that did not work well—they had a huge inductance uptick at high frequency (fitting nicely to something like a 3mH inductance).  I’ve no idea how they got that data, as I saw their setup and they couldn’t have had more than a few µH of stray inductance.  Other students had small upticks at the high frequencies that were almost certainly stray inductance, since moving the voltmeter leads to connect directly to the electrodes eliminated the uptick, which did not happen with the students whose data I tried modeling.  I showed students how to model the uptick with an additional inductor, but I really don’t know what went wrong with the student data—I didn’t see any problems with their setup or recording, so I can only assume we all missed something.

Some of the students at least are getting the idea that modeling is not forcing your data to fit the theory in the book, but looking for regularities in the data.

## 2015 April 28

### First half of electrode lab a bit long

Filed under: Circuits course — gasstationwithoutpumps @ 20:47
Tags: , , , ,

Monday’s lecture went fairly well—I used my post  Comments for class after grading as lecture notes, and pretty much covered everything, though not necessarily in the order presented there.

Today I spent a long time in the lab, from about 9 a.m. to after 6 p.m., because it takes a fair amount of time to set up and clean up when we are dealing with liquids (in this case, salt water) in the electronics lab.  I have to make sure that everything is in secondary containment tubs, so that nothing gets spilled.  (It irks me that the EE faculty don’t bother enforcing the clearly posted “no food or drink” rule on their students, and I’ve had to chide several EE students coming into the lab with cups of coffee and open bowls of food—I often see drink containers in the room trash.  I spend hours making sure that my students don’t spill anything, but the EE students routinely spill their drinks (judging from the mess on the never-cleaned floor.)

I did two demos today: one planned, one unplanned.  The planned demo was of vernier calipers, which the students used to measure their stainless steel electrodes.  The unplanned demo was of what happens if you pass a large current through a salt solution.  I considered that grade-school chemistry (I’m sure I was in grade school when I took two carbon rods from inside batteries and passed a current through them, measuring the amount of H2 and O2 that bubbled off—I even looked at the difference between AC and DC (initially by using Al foil on a turntable to do the switching, but 33rpm (0.55 Hz) was still too high a frequency to get any electrolysis, and I had to switch to a DPDT switch and a watch to manually get something like 0.1Hz to get small amounts of electrolysis. OK, I admit that was a science-fair project (6th grade? 7th?) to measure the amount of electrolysis as a function of frequency, but electrolysis was not a strange subject for middle school students.

No one in the morning class had any idea what would happen if you passed a current through a salt solution, and I couldn’t even get guesses.  In the afternoon class, I badgered the students a bit more and finally got someone to realize that H2 would bubble out, and (after a bit more badgering) got them to predict which electrode this would happen on. With 6V and a 1A limit, I got vigorous bubbling (about 0.6A current drawn), and the other electrode produced a yellowish color in the solution (probably an iron oxide).

Note: all but one or two of these students have taken at least a year of college chemistry that included a full quarter on electrochemistry, but they had never seen a demo of the H2 reaction, despite it’s being the standard reaction of defining half-cell potentials. (Most of them had seen the reaction before, since it happens in gel electrophoresis boxes all the time and nearly all of them have done gel electrophoresis in biochem labs, but not one of them put 2 and 2 together and realized what was going on.)

What prompted the electrolysis demo was students asking why the readings kept changing on their ohmmeters when they tried to measure DC resistance. I tried through socratic questioning to get them to realize that the ohmmeters work by measuring the voltage across the device under test while passing a known current through, and that passing a DC current through an electrode will result in chemistry on the surface of the electrode, changing the electrode properties. I got some groups as far as realizing that there was a current, but no one seemed to realize that having a current meant there must be redox reactions taking place on the surfaces of the electrodes, changing the surface properties.

Did I already mention that almost all of these students have had a quarter of electrochemistry? I wonder what (if anything) is taught in that class! I’ve never taken it, so I’m relying entirely on what I learned in grade school and high-school—I would have thought that a college-level class would have more than what I recall from a high-school sophomore class in the 60s.

The rest of the lab went fairly smoothly, but a number of students saw a change in the behavior of their electrodes at high frequencies. This was unexpected (I’d not see the effect in my versions of the experiments), so I spent some time debugging the problem. I’m pretty sure that the problem was long wires—the students were getting a series inductance added to their electrodes. About 1.5µH would be enough in some cases to cause the observed phenomenon, though in other cases a much larger inductance would seem indicated. For one student, I suggested hooking up a voltmeter right at the electrodes rather than at the other ends of the wires to the electrodes—the saw a 2-fold reduction in voltage at 1MHz, which pretty much cancelled their apparent increase in impedance. We’ll discuss the problem in class tomorrow, and I’ll suggest modeling the electrodes not with just the standard R+(R||C) model but with L+R+(R||C), with the extra L corresponding to the long wires in their test setup.

We used up about half the salt solutions a colleague had made for me, and we’ll use up the other half on Thursday. It seems we need at least 110ml/student, so next year I’ll probably want to get 150ml/student or even 200ml/student, so that we don’t run out. Today we characterized stainless steel electrodes (which are highly polarizable) and on Thursday we’ll characterize Ag/AgCl electrodes (which are non-polarizable). So I’ll have another long day in the lab on Thursday.

Next Page »