# Gas station without pumps

## 2017 February 18

### Digilent’s OpenScope

Filed under: Uncategorized — gasstationwithoutpumps @ 10:08
Tags: , , , ,

Digilent, which makes the excellent Analog Discovery 2 USB oscilloscope, which I have praised in several previous post, is running a Kickstarter campaign for a lower-cost oscilloscope: OpenScope: Instrumentation for Everyone by Digilent — Kickstarter.

I’m a little confused about this design, though, as is it is a much lower-quality instrument without a much lower price tag (they’re looking at \$100 instead of the \$180 or \$280 price of the Analog Discovery 2, so it is cheaper, but the specs are much, much worse). The OpenScope looks like a hobbyist attempt at an oscilloscope, unlike the very professional work of the Analog Discovery 2—it is a real step backwards for Digilent.

Hardware Limitations:

• only a 2MHz bandwidth and 6.25MHz sampling rate (much lower than the 30MHz bandwidth and 100MHz sampling of the Analog Discovery 2)
• 2 analog channels with shared ground (instead of differential channels)
• 12-bit resolution (instead of 14-bit)
• 1 function generator with 1MHz bandwidth and 10MHz sampling (instead of 2 channels 14MHz bandwidth, 100MHz sampling)
• ±4V programmable power supply up to 50mA (instead of ±5V up to 700mA)
• no case (you have to 3D print one, or buy one separately)

On the plus side, it looks like they’ll be basing their interface on the Waveforms software that they use for their real USB oscilloscope, which is a decent user interface (unlike many other USB oscilloscopes).  They’ll be doing it all in web browsers though, which makes cross-platform compatibility easier, at the expense of really messy programming and possibly difficulty in handling files well.  The capabilities they list for the software are much more limited than Waveforms 2015, so this may be a somewhat crippled interface.

I would certainly recommend to students and educators that the \$180 for the Analog Discovery 2 is a much, much better investment than the rather limited capabilities of the OpenScope.  For a hobbyist who can’t get the academic discount, \$280 for the Analog Discovery 2 is probably still a better deal than \$100 for the OpenScope. The Analog Discovery 2 and a laptop can replace most of an electronics bench for audio and low-frequency RF work, but the OpenScope is much less capable.

The only hobbyist advantage I can see for the OpenScope (other than the slightly lower price) is that they are opening up the software and firmware, so that hobbyists can hack it.  The hardware is so much more limited, though, that this is not as enticing as it might be.

Some people might be attracted by the WiFi capability, but since power has to be supplied by either USB or a wall wart, I don’t see this as being a huge win.  I suppose there are some battery-powered applications for which not being tethered could make a difference (an oscilloscope built into a mobile robot, for example).

Going from a high-quality professional USB scope to a merely adequate hobbyist scope for not much less money makes no sense to me. It would have made more sense to me if they had come out with OpenScope 5 years ago, and later developed the Analog Discovery 2 as a greatly improved upgrade.

## 2017 February 6

### Hysteresis oscillator is voltage-dependent

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 20:42
Tags: , , ,

Today in class I did a demo where I tested the dependence of the frequency of my relaxation oscillator board on the power supply voltage.

The demo I did in class had to be debugged on the fly (it turns out that if you configure the power supplies of the Analog Discovery 2 to be low-speed waveform channels, then you can’t set them with the “Supplies” tool, but there is no warning that you can’t when you do the setting), but otherwise went well.

One surprising result (i.e., something else that hadn’t happened when I tested the demo at home on Sunday) was that the frequency appeared to go up instead of down when I touched the capacitive touch sensor.  This I managed to quickly debug by changing my sampling rate to 600Hz, and observing that the 60Hz frequency modulation was extreme at the podium, taking the oscillation frequency from 0Hz to 3MHz on each cycle.  Grounding myself against the laptop removed this interference and produced the smooth expected signal.

Anyway, when I got home I was much too tired to grade the lab reports turned in today (I’ve got a cold that is wiping me out), so after a nap and dinner, I decided to make a clean plot of frequency vs. power-supply voltage for my relaxation oscillator.  I stuck the board into a breadboard, with no touch sensor, so that the capacitance would be fairly stable and not too much 60Hz interference would be picked up.  I powered the board from the Analog Discovery 2 power supply, sweeping the voltage from 0V to 5V (triangle wave, 50mHz, for a 20-second period).

I used the Teensy LC board with PteroDAQ to record both the frequency of the output and the voltage of the power supply.  To protect the Teensy board inputs, I used a 74AC04 inverter with 3.3V power to buffer the output of the hysteresis board, and I used a voltage divider made of two 180kΩ resistors to divide the power-supply voltage in half.

When I recorded a few cycles of the triangle waveform, using 1/60-second counting times for the frequency measurements, I got a clean plot:

At low voltages, the oscillator doesn’t oscillate. The frequency then goes up with voltage, but peaks around 4.2V, then drops again at higher voltages.

I expected the loss of oscillation at low voltage, but I did not expect the oscillator to be so sensitive to power-supply voltage, and I certainly did not expect it to be non-monotone.  I need to heed my class motto (“Try it and see!”) more often.

Sampling at a higher frequency reveals that the hysteresis oscillator is far from holding a steady frequency:

Using 1/600 second counting intervals for the frequency counter reveals substantial modulation of the frequency.

This plot of frequency vs. time shows the pattern of frequency modulation, which varies substantially as the voltage changes, but seems to be repeatable for a given voltage. (One period of the triangle wave is shown.)

Zooming in on a region where the frequency modulation is large, we can see that there are components of both 60Hz and 120Hz.

I could reduce the 60Hz interference a lot by using a larger C and smaller R for the RC time constant. That would make the touch sensor less sensitive (since the change in capacitance due to touching would be the same, but would be a much smaller fraction of the total capacitance). The sensor is currently excessively sensitive, though, so this might be a good idea anyway.

## 2017 January 2

### LM2903 open-collector comparator characterization

Filed under: Circuits course — gasstationwithoutpumps @ 18:02
Tags: , , , ,

In Last power-amp lecture, I posted an I-vs-V plot for the LM2903 comparator’s open-collector output, which I had made sometime in 2013, I think:

There are two regions of operation for the open-collector output of the LM2903. In the saturation region, the current goes up slowly with voltage (as about V^0.15, while in the “linear” region, it goes up as about V^1.5). The transition occurs when VOL is about 0.25 V, so we are almost always in the saturation region.

I decided to redo the plot using the Analog Discovery~2, as I now include the open-collector curve in the textbook (in an optional section, since we no longer use open-collector comparators). I used a 12V wall-wart and both the function generator and oscilloscope functions. I used the “custom channel” and XY plot features to get the I-vs-V plot on the screen (though I saved the data and replotted with gnuplot, to superimpose different runs). I also averaged 10 sweeps to reduce noise.

R1 was 56Ω for testing high voltages and currents, and R1 was 2.2kΩ for testing low voltages and low currents.

The triangle-wave generator and the nFET makes a variable load for the comparator, from slightly more than R1 up to about 1MΩ.

Even up to 11V, the LM2903 collector stays below the 20mA maximum current, but I’d want to make sure that there was some current-limiting resistor for any power-supply voltage above 12V.

The results with the Analog Discovery 2 are much cleaner than my old results, which were most likely done with an Arduino, which has a very low resolution ADC.

## 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.

Next Page »

Create a free website or blog at WordPress.com.