Monthly Archives: January 2014

Measuring mH inductors with the VNWA

A friend of a friend is apparently about to build a system where he uses the DC supply wires between boards also for some kind of communication. To do this, he intends to put inductors in series with the supply lines so that the powered circuitry does not load the signals.

I got hold of two inductors that are candidates to be used for this purpose and decided to measure them using my VNWA and the simple test fixture. By lowering the audio (IF) sampling rate of the VNWA, it is possible to measure down to 1 kHz and below, which is of interest for these kinds of large-value inductors. I set the sampling frequency to 900 Hz, the measurement time per data point to 100 ms and the frequency range to 1 kHz to 10 MHz. I used the S11 measurement so that I could use the built-in inductance plotting feature.

The first inductor is marked (color coded) 1000 µH. It has a DC resistance of 5.7 ohms measured using an ohm meter. Below is a plot of some curves for this component.

Curves for 1 mH inductor
Curves for 1 mH inductor

The impedance (blue curve) goes up from low frequencies (as expected) and reaches 1000 ohms at about 200 kHz. It then stays above 1 kohm at least up to 10 MHz.

The inductance varies a little with frequency between 850 µH and 930 µH for frequencies between 1 kHz and 500 kHz.

The inductor is (parallel resonant) at around 1.4 MHz where it has a maximum impedance of nearly 30 kohms (a very uncertain value due to the S11 method’s inappropriateness of measuring impedances that are much larger or smaller than 50 ohms, the series S21-method should be used instead to get a more precise number).

The ESR (equivalent series resistance) is plotted in black. It goes up from 8.1 ohms at 1 kHz (remember it was 5.7 ohms at DC). This increase with frequency might be due both to skin effect and losses in the core.

This inductor has an impedance of above 500 ohms for frequencies between 100 kHz and at least 10 MHz, so if the communication is done in this frequency range, the loading through the inductor should be pretty low.

One caveat is that the inductance (and impedance) might go down when DC current is run through the inductor. This, as well as the simple IR drop across it is something to look out for in the application.

It might be possible to add a DC-blocks and a current source (that has to have high impedance over the frequency range of interest) to the test fixture to test the effect of a DC bias.

The second inductor is marked 10 mH and its curves are shown below. Note that some of the scales have been changed by a factor of 10. At DC, this inductor has a resistance of 60 ohms.

Curves for 10 mH inductor
Curves for 10 mH inductor

This inductor might be suitable if very little current will be pulled through it (due to IR drop and saturation of the core), but it does of course provide higher impedance for lower frequencies. Above resonance, which happens around 500 kHz, the impedance comes back down again, so that it is 5 kohms around 3 MHz and 1.5 kohms at 10 MHz.

Vector Network Analyzer – a Christmas Present to Myself

I bought myself a somewhat unusual Christmas present a few weeks ago, namely a vector network analyzer, VNA. All VNAs I had previously used were huge and very expensive instruments, but it turns out that there is an interesting alternative out there on the market. Tom Baier, a radio amateur with the call sign DG8SAQ has created a really neat product he calls the “VNWA 3E“. It is a VNA in a small box powered via USB and controlled by a PC.

VNWA 3E
The network analyzer VNWA 3E

(I do not know why everybody insist on using the abbreviation VNWA instead of VNA for this particular VNA, but it seems like VNWA has become the accepted name for this device, so I will use it when referring to this product and not VNAs in general.)

Technical description

The VNWA design itself is very clever as it covers a relatively large frequency range while still being orders of magnitude cheaper than traditional VNAs. It achieves this through a minimalistic design and a combination of using harmonic overtones of the frequency synthesizers, overclocking the synthesizers outside of their specified frequency range and also using mixers outside of their specified operating range. The main downside of this approach seems to be that the dynamic range suffers for frequencies above 500 MHz. Also, the maximum output power is really low at -17 dBm at 1 MHz and less for higher frequencies. This however is usually not a major problem.

AD9859 10-bit DDS (direct digital synthesis) chips are used for both the RF and the LO oscillators. These are specified for clock frequencies of up to 400 MHz, so normally they could only be used to generate signals up to a bit below 200 MHz. But it turns out they always seem to work fine when overclocked up to 720 MHz, and by utilizing harmonics, much higher frequencies can be probed than one would originally expect.

An IF of between 1 kHz and 12 kHz is used and it is sampled by an audio ADC. There does not seem to be any explicit IF filter in the design and one can in particular not select between different IF bandwidths as is possible on most other VNAs. It is however possible to select the measurement time at each frequency point.

The VNWA 3E can measure both S11 and S21 (reflected and through) S-parameters at the same time since it contains an expansion board with an extra audio ADC. To measure S22 and S12 (reflection from output and reverse transmission) the connections to the device under test (DUT) have to be manually swapped.

Below is a partial block diagram of an earlier version of the VNWA where a PC soundcard was used as the sampler of the IF and reference signals.

VNWA block diagram
Old VNWA block diagram

Due to the shortcuts taken in the design of the VNWA, there are thus some shortcomings and a few features missing that one would find in a traditional VNA, but there are also many useful features provided in the software that I have not seen in other VNAs. Considering the price, I think the instrument is a bargain if you want to make measurements in the 200 Hz to 1.3 GHz range and can live with a dynamic range of about 50 dB above 500 MHz.

Whistling inductor

When I received the VNWA, I was first struck by its small size. I had expected it to be small, but not so small. It is only 10.4 cm wide. The installation went fine, but there was an audible whistling noise coming from the device. It sounded like noise I had previously heard from some DC/DC-converters. I contacted SDR-kits where I bought the VNWA and was told that the noise problem could be solved by putting a drop of glue on top of the inductor of a DC/DC converter.

I took the unit apart (which is very simple to do) and put some hot melt glue on the suspect inductor, glueing it to the side wall. On top of that I put some Tack-It. This largely eliminated the noise, although I can still hear it if I listen close to the device. Looking at the circuitry around the inductor, it is apparent that a MAX632 is used as a step-up converter and this chip seems both expensive and outdated. It switches at 45 kHz and the regulation is done by skipping cycles, rather than by adjusting the duty cycle. This probably leads to the ripple current having lots of frequency content in the audible spectrum, which the inductor converts to sound. A more modern step-up-regulator would probably both reduce the cost and get rid of the noise. Below is a photo showing the inductor covered in glue and Tack-It.

Glued inductor
The opened VNWA with the glued inductor at the top left.

Some tests

To try out my new toy, I did a couple of measurements.  First I tested three different attenuators.

1 dB att
Plot of 1 dB attenuator (VAT-1W2 from Minicircuits)
6 dB attenuator plot
Plot of 6 dB attenuator (VAT-6W2 from Minicircuits)
20 dB attenuator plot
Plot of 20 dB attenuator (VAT-20+ from Minicircuits)

All of these three attenuators are specified to have about 0.2 dB excess loss at 1 GHz. This is approximately what the VNWA shows for the 1 and 6 dB attenuators, but it looks more like 0.4 dB extra loss for the 20 dB attenuator. Also, the S21 (transmission) curve looks a little jagged above 500 MHz, which is probably the decreased sensitivity and accuracy in this frequency range showing up.

Next I tried a 90 MHz low-pass filter. Comparing this to the datasheet, it seems like the filter has less loss at 90 MHz than what is typical. The 3 dB frequency is actually 95.8 MHz.  VSWR in the pass band is also better than typical (< 1.42 whereas the DS says < 1.7). The stopband attenuation should be greater than 70 dB between 230 and 400 MHz, and this is also shown by the VNWA. The datasheet gives no data above 400 MHz and I do not trust the VNWA to say much about attenuations larger than 50 dB above 500 MHz.

90 MHz low-pass filter
Plot of 90 MHz low-pass filter (SLP-90 from Minicircuits)

Component measurements

One of the great things with a VNA is that it can be used to measure component parameters over a range of frequencies. It can therefore be used to measure e.g. inductance and capacitance. The VNWA actually has a built-in LCR-meter function measuring at a single (but selectable) frequency, but I prefer to do a sweep and see how the measured value changes with frequency. In that way it becomes obvious if the component that is tested behaves in the expected manner (like a capacitor keeping its capacitance over a range of frequencies).

There are different ways to use a VNA to measure impedance. Basically, one can base the measurements on reflected waves (S11) or transmitted waves (S21). The S11 method has the advantage that only one cable is needed, while the S21 method requires two cables, but has advantages in terms of easier calibration and more precise results when the impedance is very high or very low compared to the system impedance of 50 ohms. When doing S21 impedance measurements, the unknown impedance can either be placed in series with the signal path (good for high impedances) or shunting the signal to ground (good for low impedances).

The VNWA software has built-in support to convert S11-data to capacitance and inductance but does not seem to have direct support for the S21 methods of component measurements. A great feature though is that it is possible to define custom formulas that do the conversion from S-parameters to e.g. capacitance or inductance, so the results of S21-based component measurements can be easily plotted.

I tested a few different components using an educational test fixture I bought together with the VNA and seemed to get good results. Below is a picture of the VNWA with the test fixture in front.

VNWA with test fixture
VNWA with test fixture
Closeup of the test fixture
Closeup of the test fixture

Clearly, the fixture is not designed to have low parasitics at high frequencies, but it should be useful up to at least a few MHz.

First I tested two inductors, one that I found in a DC/DC converter I discussed in a previous blog post and a random toroid I had in the junk bin.

I connected the inductor from the signal to ground, shunting the transmitted signal. Six different curves are plotted simultaneously:

  • S21 is plotted both as magnitude and in a Smith chart,
  • the inductance calculated from the S21-parameter,
  • the magnitude of the shunting impedance (unfortunately it is not possible to use a logarithmic Y-axis when plotting, unless you plot dB),
  • S11 in a Smith chart and
  • the phase of the shunting impedance.

The reference levels and values can be seen at the right side of the plot while the per-division values can be seen on the left.

The calculated inductance drops slowly over the frequency range from 10 kHz (165 µH) via 100 kHz (160 µH) to 400 kHz before it approaches resonance at 4.7 MHz. The phase of the shunting impedance is close to 90 degrees up to 2-3 MHz. The inductance seems to be around 160 µH based on this test.

Plot of inductor from DC/DC converter
Plot of inductor from DC/DC converter

The toroid gave the below plot. The inductance is dropping from 10 kHz (114 µH) to 1 MHz (108 µH) where the phase is 70 degrees, indicating quite a bit of loss. This inductor has much more loss at higher frequencies than the previous one and is perhaps intended as a choke rather than as a low-loss inductor for e.g. a DC/DC converter.

Plot of random toroid inductor
Plot of a random toroid inductor

I also had a few low-tolerance capacitors and it seemed like a good idea to check what readings the VNWA would give when presented with these.

The first one is marked 246 pF 0.5%, so it should have a capacitance between 244.8 and 247.2 pF. I have plotted not only the capacitance calculated using my S21-based formula, but also the built-in S11-based formula. Both formulas give realistic values at the flat portion of the graphs with 247.7 pF for S21 and 248.2 pF for S11 at 1 MHz. A little smoothing would have been appropriate to get better readings at lower frequencies, although neither measurement method is suitable for measuring 246 pF below 100 kHz. Putting the capacitor in series would have given better LF-results for the S21 approach.

Capacitor plot
Plot of 246 pF +/- 0.5% capacitor

The second capacitor is marked 942 pF +/- 0.3% (thus 939.2 to 944.8 pF). A handheld component tester measured this as 944 pF. The S21 approach gives values within the tolerance range for both 100 kHz and 1 MHz, whereas the S11 approach is a little more variable.

Capacitor plot
Plot of 942 pF +/- 0.3% capacitor

The next capacitor is marked 10 nF +/- 0.5% (thus 9.95 to 10.05 nF). S21 gives values within this range for both 100 kHz and 500 kHz.

Capacitor plot
Plot of 10 nF +/- 0.5% capacitor

So in all, it seems like the VNWA is pretty useful to measure capacitances and inductances like these. The tolerance is probably better than 1% if the calibration and the measurements are made carefully.

A great Christmas present!

Electronics for the Lapse Pi Motorised Time-Lapse Rail

A friend of mine is building a Lapse Pi motorised time-lapse rail and she asked me if I could make the required electronics. A time-lapse rail allows you to take time-lapse sequences during which the camera moves a short distance between each shot for artistic effect.

The electronics is not particularly complicated. A DC/DC converter is needed to convert the battery voltage of 12 V to 5 V for supplying the Raspberry Pi and then a few transistors are required to control the motor and the camera shutter.

DC/DC converter

The most complicated part is the DC/DC converter. Since I was only about to build one unit, I decided to try to minimize work, possibly at the expense of a non-optimal design in other respects, but still with decent power conversion efficiency. A linear regulator was out of the question as the efficiency in going from 12 V to 5 V is at most 5/12 = 42 %, so a more complicated switching DC/DC converter was clearly required.

I decided to buy a cheap car cigarette lighter to USB adapter which does the job of converting a voltage in the range of 12 to 24 V to 5 V to do the job. Good since it did not require any design work on my behalf. Or so I thought.

Cigarette lighter to USB adapter
Cigarette lighter to USB adapter

What I should have done is to check the power requirements of the Raspberry Pi. I somehow had assumed it could be driven by the current nominally available in a single USB port (500 mA), but it turns out that it needs 700 mA according to the schematics and 500 to 1000 mA according to this FAQ. The car-to-USB adapter I had bought unfortunately turned out to be designed with very little margin (not too surprising for a cheap consumer product). It started making an alarming whistling noise when the current exceeded 500 mA and for lower input voltages (like 8 V), the output voltage started dropping even at 400 mA. Ooops. Below is a plot of the output voltage vs output current for three different input voltages.

Output voltage plot
Output voltage vs output current for a few different input voltages.

So, what to do? I took the converter apart to see if it were possible to modify it to make it more powerful. Inside I found a small PCB, see photo below.

Innards of 12 V to USB adapter
Innards of 12 V to USB adapter

The circuitry is based on an MC34063A, which is a rather old and simple DC/DC-converter chip made by e.g. Texas Instruments and ON Semiconductor. The way it was connected in the product was almost exactly like the step-down (buck) converter schematics given in figure 11 of the datasheet. The chip itself has a switch transistor that is able to handle 1.5 A, so this is not what limits the output current. Unfortunately, the transistor is an NPN darlington, so it has a fairly high voltage drop resulting in low efficiency, especially for low input voltages, so heating could be a problem for high output currents.

The component that primarily limits the available output current is however the inductor. It is relatively small and unlabeled (the black cylindrical component right above the text R5 in the picture above). I desoldered it and measured the inductance which turned out to be around 160 µH. This is smaller than the recommended value of 220 µH in figure 11 of the datasheet. I did not have any simple way of measuring how the inductance changed as a result of increased current, but it is very likely that the inductance starts to drop off significantly as the current reaches 500+ mA (there is a ripple current on top of the average output current that the inductor has to handle).

Replacing the inductor with a bigger one with smaller ESR (equivalent series resistance) and suitable for maybe 1.5 to 2 A and perhaps with a somewhat higher inductance seemed like a good modification to the circuit. But the NPN darlington also looked like it was in need of some improvement. Figure 12 of the datasheet shows how an external PNP transistor can be connected to boost the output current. An advantage is that the transistor can saturate and thus have a very small voltage drop (maybe 0.1 to 0.3 V or so) when it is on, which is good for efficiency. Power PNPs are however not know for their high current gains, so efficiency suffers due to all the wasted base current that is needed to reliably saturate the transistor.

It seemed like a modern PMOS transistor would be a better choice as it can have a very low on-resistance and not require any base (gate) current to keep it on. The switching losses should be relatively small since the switching frequency is so low for the MC34063A (well below 100 kHz).

At first my intention was to make the modifications on the original PCB, but with a new and much larger inductor and especially a lot of reconnections required to accommodate the external PMOS transistor, I realized that it was actually more practical to desolder the MC34063A and a few other components and put the modified circuitry on a stripboard.

PCB-remains
The remains of the original DC/DC converter board with the useful components removed. Original inductor (L1) at lower right.

I bought a new inductor (220 µH, 1.9 A) and used a PMOS power transistor I had at hand. The PMOS was actually half of an NMOS/PMOS pair in an SO8 package (an IRF7343) so I had to solder wires to some pins to adapt it to the stripboard.

I did also replace the electrolytic capacitors at the input and output (47 µF and 330 µF) with ones having higher capacitance (100 µF and 470 µF) and lower ESR. The resulting schematics and the physical board can be seen below.

Schematics of DC/DC converter
Schematics of DC/DC converter
DC/DC converter built on stripboard
DC/DC converter built on stripboard

I measured the output voltage and efficiency to see if the new design was any better than the original one. It turns out that it was. Below are graphs illustrating this.

Output voltage plot
Output voltage vs output current for a few different input voltages. The new design works fine up to at least 1.2 A.
Efficiency plot
Efficiency vs output current for a few different input voltages for the original and new DC/DC converter designs. The efficiency of the new design is well over 80% for currents between 400 and 1000 mA, whereas the original design never reached 80% efficiency and was unable to supply more than 600 mA.

So the new design is a great step forward both in terms of output current capability and efficiency. In terms of size and cost of components it is far from optimal, but those were not important design parameters. If a smaller and more cost effective design is desired, a more modern switcher with higher switching frequency and a custom board layout could be used.

Motor drive

The motor used is a simple 12 V DC-motor with a gearbox bringing the speed down to 15 RPM. To move the dolly a small distance, the motor is simply turned on for a short period of time (150 ms was used by David Hunt, the man behind the Lapse Pi). For the Raspberry Pi to be able to control the DC motor, we need a transistor that is able to handle the current of the motor. David Hunt used an NPN, but I decided to use an NMOS from the junk bin. Many different transistor models could be used. The main requirements are a low enough threshold voltage for the limited I/O voltages of the Raspberry Pi to turn it on and sufficient drain current capability. I happened to have an old P60N03LDG and this one works fine, although its 60 A maximum current is extreme overkill. The threshold voltage is 2.5 V maximum and the R Pi should have no trouble supplying a voltage higher than this on its 3.3 V I/O lines.

I added a series gate resistor to limit the gate charge/discharge current and a pull-down resistor to make sure the transistor is off if not actively driven. A flywheel diode is also mandatory to take care of the current from the collapsing magnetic field when the motor is switched off. A schematic is shown below.

Schematics of motor drive transistor
Schematics of motor drive (a much wimpier transistor can be used).

Camera shutter control

For the shutter release, David Hunt suggests a single transistor that controls the shutter via a remote release cable. That might work for Canon cameras, but here we are dealing with Nikon and in my experience (based on a D300), you first have to ground the focus wire, wait for perhaps 300 ms and then ground the shutter wire. Therefore I used two GPIO pins on the Raspberry Pi, each controlling one signal from the camera. I used the same kind of 2.5 mm stereo jack that fits my existing remote release cable and for transistors I used BS108 NMOS transistors with a threshold voltage of at most 1.5 V. The schematics is shown below.

Schematics of focus and shutter control.
Schematics of focus and shutter control

Raspberry Pi connector

I use the GPIO connector of the Raspberry Pi to both connect to the GPIO signals and to power the board. This eliminates the need for two separate connectors at the R Pi end of the cable. A minor disadvantage of not powering it through the micro USB connector is that the fuse on the R Pi is out of the circuit. A secondary side fuse could be added to the DC/DC converter board, but I think I will stick with just having a fuse on the primary side of the DC/DC.

Below is a photo of the whole thing, including the GPIO connector. The motor connects to the small green screw terminal (partly hidden on top center of the board) and the shutter release cable connects to the black stereo jack at the top left. The green power indicator LED can be removed to save some precious battery power.

The finished board with all the electronics.
The finished board with all the electronics.