# Gas station without pumps

## 2016 December 30

### Ultrasonic rangefinder with Analog Discovery 2

In Loudspeaker impedance with Analog Discovery 2, I looked at the impedance of  various loudspeakers including an ultrasonic transducer. Today I looked at shaping pulse bursts for driving an ultrasonic transmitter to get shorter received pulses with an ultrasonic receiver.  I’ve done this before using custom programs on a Teensy 3.1 board (see Ultrasonic rangefinders arrived), but I wanted to see what I could do using just the waveform generator on the Analog Discovery 2.

I measured the magnitude of the impedance of the transmitter (using either a 120kΩ resistor or a 1nF capacitor as a known impedance), then looked at the transmitter+receiver characteristics for frequencies around the resonances.  I’ve marked the peak received resonances on the impedance plot.

The impedance is approx 2.2nF, with 3 apparent resonances.

The primary resonance is around 40kHz, and is the frequency that the transmitter is designed to operate at.

There is a secondary resonance around 54kHz, though it is considerably weaker than the 40kHz resonance.

The third resonance, around 330kHz does not provide a very strong signal for the receiver.

I tried two tests using the 40.445kHz resonance. In one, I used the simple waveform generator to produce a 40445Hz square wave, then used an 8ms wait and a 148.3µs run time, to produce bursts of 6 square waves. I set the idle output to the offset (0v) and used a 5V amplitude.

In the other test, I used the same wait and run times, but used the “custom” waveform to set up a signal that inverted the last 3 of the 6 periods (so that the half periods were `+-+-+--+-+-+`. This was fairly easy to set up by generating the 6 periods, then altering them by multiplying by a single period of a square wave. I could have created much more complicated bursts, but this pattern was enough to see the capabilities of the scope.

By triggering the scope on the signal sent to the transmitter (using channel 1), I could average 1000 sweeps to get a very low-noise view of the signal. (I can trigger on the waveform generator itself, freeing up one of the scope channels, but then I can’t average—I think that the averaging relies on interpolating get precise timing of the trigger.)  For plotting, I subtracted off the DC bias (fitted before time 0), as 60Hz interference caused a moderate offset to the signal even after averaging.

The bursts start out the same, but the simple 6-cycle burst results in the received waveform growing for 14 or 15 cycles, while the 3+,3- burst grows for 6–7 cycles and decays very quickly.

I tried some longer and shorter bursts, with the expected result that longer bursts resulted in stronger signals with a longer received burst width. Doing 8 cycles followed by 8 cancelling cycles seemed to produce a reasonable length burst with a fairly strong signal, but I did not explore variants much.

I still think it might be possible to use the phase information to get higher resolution than the approx 7.9mm wavelength, but identifying which pulse of the return waveform is which remains a problem, particularly if there is a complicated reflecting surface that superimposes several differently delayed pulses.

## 2016 December 28

### Headphone impedance with Analog Discovery 2

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 22:41
Tags: , , ,

In Loudspeaker impedance with Analog Discovery 2, I described measuring the impedance of loudspeakers with the network analyzer function of the Analog Discovery 2. In this post, I looked at some new Panasonic headphones that I got myself for Christmas (Panasonic RP-HJE120-PPK In-Ear Headphone, the best-seller on Amazon and the same model my son has, though in a different color).

I have figured out how to use the Waveforms 2015 software a little better now, so I can compute the magnitude of impedance as an extra column in the output (using the “Custom One” optional calculated channel).  This cuts down slightly on the missing metadata from the data files, though I really wish that they would do a dump of the instrument settings as comments at the beginning of the file.

The headphones had essentially the same curves whether in the ear or not in the ear, so I am just plotting the in-ear electrical characteristics.

The headphones are fairly well fit by a simple model: a resistor in series with an inductor.

Zooming into the audio region shows surprisingly little variation in the impedance over the whole audio range. There is a small resonance peak around 2.6kHz, but it is small and broad, nothing like the resonance peaks of loudspeakers.

I had some problems with repeatability of measurements, with curves jumping 0.5Ω up or down, but preserving their shape. I think that the problem is with poor contacts in the breadboard I was using, as I had the same problems earlier characterizing nFETs. The resonance peak around 2.6kHz corresponds roughly with the peak of information content in speech, so slight enhancement there is probably perceived as improved audio quality over a completely flat spectrum. But the enhancement here is tiny, so it may just be the result of flattening the spectrum as much as feasible.

The noise in the measurements probably reflects the small signal levels—I had an 18Ω resistor in series with the 16Ω headphones, and an amplitude of only 25mV across the pair, which gives me only 8.3mV RMS at the headphones.  That means that only 4.2µW of power is being used to generate the sound.  Panasonic claims a sensitivity of 96dB/mW, so 4.2µW should be about 72dB SPL (remember that dB is $10 \log_{10}$ of a power ratio, and $10 \log_{10}$ of an amplitude ratio). The 72dB seems about right for the loudness.  The headphones can supposedly handle 200mW, which would be 119dB—easily loud enough to cause permanent hearing loss.  Perhaps I should have students test their preamplifiers with earbud headphones instead of loudspeakers—the 24mA limit would give 9mW, which would be quite loud in a headphone.

The R+L model does not fit at high frequencies all that well, and the phase relationships are not what one would expect of a pure R+L model:

The phase only gets to 60°, while a true inductor in series with a resistor would have reached 90° and done so somewhat sooner.

Overall, I’m impressed at how flat the impedance is over the audio range. I don’t know how good the headphones are acoustically (especially as my hearing seems to be really down in the 4kHz–8kHz range—signals seem louder to me at 9kHz than at 5kHz), but I’ve no complaints about them so far.

## 2016 December 27

### FET I-vs-V with Analog Discovery 2 again

In FET I-vs-V with Analog Discovery 2, I plotted Id vs. Vgs curves for an nFET:

The Ids-vs-Vgs curves do not superimpose as nicely as curves I’ve measured with PteroDAQ. I don’t yet understand why not.

Yesterday, I played with sweeping the power supply (Power waveform generator).  In this post, I used that capability to plot Id vs Vds curves for different gate voltages (Vgs) of a different nFET (since the AOI518 is an obsolete part).  The setup is the same as for the previous test—the function generator is connected to the gate, the power supply to the drain load resistor in series with the nFET whose source is connected to ground, and the two oscilloscope channels monitor the voltage across the load resistor and across the nFET.  The difference is that I use the power-waveform option to put a 1Hz triangle wave on the power supply, but put just a DC offset (AC amplitude 0V) on the function generator output, so that the gate voltage is constant as the drain voltage is adjusted.

The saturation regions are well plotted up to Vgs=2.7V. I averaged 10 or 20 scans for each of these curves, to reduce quantization noise for small voltages or small currents.

I got quite different results when I removed and replaced the nFET from the breadboard—the breadboard contacts seem to have a variation of about ±0.05Ω in resistance, which is much larger than the on-resistance of the nFET when fully on. I took measurements with a wire between the source and drain to estimate the wiring resistance, but wiggling the wire produced very different results.

In the next graph, I tried subtracting off the wiring resistance to get the on-resistance, but I’m really quite dubious about the measurements smaller than 0.5Ω, because of the unrepeatability of the bread board contact resistance.

The numbers here look good (close to the spec sheet), but repeating the measurements could result in ±0.1Ω, which makes the Ron measurements for fully on transistors rather useless.

By using a smaller power resistor, I could probably get saturation currents for slightly higher gate voltages, up to the current limit of the power supplies in the Analog Discovery 2, but better on-resistance measurements would require a better jig for making low-resistance contacts to the FET.

By using a much larger resistor, I could measure low currents more accurately, which would give me a better idea of the leakage currents—I don’t really believe the measurements for Vgs=2.1V, because the current appears to decrease with increasing Vds, which is probably an artifact of measuring a small difference in voltage with a large common-mode signal.

I tried using larger resistors to measure the saturation currents, but the results varied a lot depending on what size load resistor is used. I believe that the difference is due to temperature changes from self-heating. If I sweep out to larger Vds voltages (using a smaller load resistor, hence smaller IR drop across it), but about the same saturation current, I’m dissipating more power in the transistor, so making it warmer. This appears to increase the saturation current. Reducing the range of the voltage with the same load resistor drops the curve down, just as increasing the load resistor does. I suspect that proper measurement requires a jig that holds the transistor at a nearly constant temperature, as well has having very low contact resistance.

The saturation current seems to vary by about ±10% as I change load resistors. The effect is most likely thermal—note that using a smaller voltage sweep for Vgs=2.3V and Rload=51Ω resulted in almost the same curve as Rload=270Ω, because the power dissipated was about the same.

Note that the thermal explanation also works for explaining why the superposition does not work well for the Id vs Vgs plots—at lower load resistances, more power is dissipated in the transistor, and it gets warmer, shifting the current curve upward.

## 2016 December 26

### Power waveform generator

Filed under: Data acquisition — gasstationwithoutpumps @ 21:53
Tags: ,

I was playing around a little more today with my Analog Discovery 2 USB oscilloscope, and found that one could set up the power supplies to be high-power waveform generators by setting configuration 6 in the device manager.  The power supplies are not great function generators, of course, as they are switching power supplies, but I can see some use cases for this functionality.

The power supplies are nominally limited to 700mA, so I wondered whether they had the same sort of sharp clipping that the function generator has (see FET I-vs-V with Analog Discovery 2).  I tested the power waveform generator with several different loads:

With no load, the power supply waveform generator has trouble with small voltages (no resistance to drain the capacitance) and has fairly high noise, but is nicely linear. At high load (1.8Ω) the voltage is substantially less than specified.

We can get a clearer idea of the behavior by looking at the difference between the power waveform generator and the normal waveform generator:

At low voltages, the regulator’s output capacitor is not discharged fast enough without a load resistor. The regulator also does a better job of keeping the noise down with higher load.

The noise is periodic with a frequency of about 1.024kHz, which is much too low a frequency for a switching regulator—it is actually from the sampling frequency for the waveform generator generating a 1Hz triangle wave (210 samples in wavetable). The usual waveform generator has four times as high a sampling frequency, so the error is mostly just quantization error from the power waveform generator, though a single step from the power waveform generator takes about 250µs to settle, so the 1Hz maximum frequency for the power waveform channels seems reasonable. With a 10Ω load, the settling time is reduced to about 50µs and the noise on each step is about 500µV RMS (not counting the quantization error).

With the 1.8Ω load, I let the current get as high as 927mA (well above the 700mA specification), and there is no sign of clipping. We can more reasonably model the power waveform generator as having an internal resistance. For the 1.8Ω and 10Ω loads, I plotted the equivalent internal resistance as a function of voltage (for the larger voltages):

The internal resistance is approximately 100mΩ—180mΩ, with the larger values at higher voltages. There is a clear anomaly at half the full-scale voltage (2.5V for 10Ω and 0.9V for 1.8Ω).

I believe that the power waveforms will be useful for characterizing transistors, especially for sweeping a range of Vds voltages that require a substantial current.

## 2016 December 25

### Coin cell batteries are pressure sensitive

Filed under: Data acquisition — gasstationwithoutpumps @ 18:03
Tags: , , ,

I found out from Zohar that one could squeeze more power out of almost dead coin cells, literally—squeezing CR1225 lithium/manganese-dioxide (Li/MnO2) batteries when they are nearly dead appears to revive the batteries. So I decided to test this with my oscilloscope.  First, I made a test jig for holding batteries that I could apply pressure to:

The contacts are made with 22-gauge copper wire. I can squeeze the battery by pressing down on it with an aluminum rod.

I still have to work out a way to provide a measurable force to the battery (probably attaching a tray to a short length of aluminum rod, so that I can put known weights on the tray), but I’ve been doing some testing with “low force” (just enough to make contact) and “high force” (about 70N).

I provided a 100Hz triangle wave from 0.4 V to 3.4 V to the gate of the nFET, to produce a variable load on the battery, hoping to trace out a nice load line.

I tested three CR1225 batteries, each of which had been used a fair amount. The most dramatic effect was from the deadest of the batteries:

I-vs-V plot for battery 2 with low force

Battery 2 I-vs-V with high force

The plots above are directly from the Analog Discovery 2 oscilloscope, using the XY plot and a “math” channel that scales Channel 2 by the 200Ω sense resistor to get current. I also exported the data and plotted it with gnuplot, so that I could hand-fit the internal resistance:

The battery has an internal resistance of 500Ω, but squeezing it hard brings the resistance down to about 140Ω.

A new Energizer CR1225 battery should have an internal resistance of 30Ω, increasing to about 50Ω when the battery is “dead” (from the datasheet). This battery is clearly well beyond the point that Energizer would consider it dead, though it is still capable of delivering almost 3.5mW (2.5mA@1.4V). Squeezing the battery hard lets it deliver 12.3mW (7.5mA@1.64V). Actually, those are only instantaneous power levels. The voltage drops quickly to a lower level, where it holds steady for a while, so the sustained power is more like 11.1mW (7.4mA@1.5V). The 200Ω load is a pretty good match to the internal resistance of the battery here, so this is about as much power as we can squeeze out of the dead battery.

I tried two other batteries that were not quite as dead. Battery 3 had 190Ω internal resistance dropping to 84Ω when squeezed, and Battery 5 had 220Ω dropping to 65Ω—all of these would have been considered dead batteries by Energizer (they weren’t Energizer batteries, but a no-name brand from China):

Battery 3 was a bit better than battery 2, getting up to 7mA without squeezing.

Battery 5 was the best battery tested, at least at high force, delivering 24mW (10.8mA@2.2V) to a 200Ω resistor.

I’m pretty sure that the resistance differences I’m seeing are due to squeezing the battery, and not changes in the battery-wire contact resistance, but it would be good to devise a way to squeeze the battery without squeezing the contacts.

Things still to do:

• Modify the test jig to provide measured forces squeezing the battery.
• Modify the test jig so that the contact force and area is independent of the amount of squeezing.
• Test some new coin cells, to see if squeezing to reduce internal resistance is just a phenomenon of nearly dead batteries or applies to all lithium/manganese-dioxide cells.  A new battery should be able to deliver 11mA@2.6V (34mW) to a 200Ω load.

It would also be good to have a theory about why increasing the pressure reversibly decreases the internal resistance.  TO come up with such a theory, though, I’d need to have a better understanding of the mechanical and chemical properties of the coin cells: what is the chemical reaction that increases the internal resistance? What moves when pressure is applied to the coin cell?  So far, the only guess I have is a change to the bulk resistivity of the electrolyte, with squeezing reducing the distance between the electrodes.  But the coin cell is not getting skinnier by a factor of 3, so I don’t think that the electrodes are getting that much closer together.

Last, it would be good to have a better understanding of the hysteresis in the I-vs-V plot.  Why does the voltage drop then hold steady at constant current, and why does the voltage recover when the current is no longer drawn?

Update 31 Dec 2016:  I tried testing a couple of brand new coin cells. They had an internal resistance of about 15Ω and did not seem particularly pressure sensitive. I’d need a more careful setup to measure the small changes in internal resistance and be sure I wasn’t just seeing a change in the contact resistance.

« Previous PageNext Page »

Create a free website or blog at WordPress.com.