Inductance meter: Difference between revisions
No edit summary |
No edit summary |
||
Line 11: | Line 11: | ||
==Specs== | ==Specs== | ||
The L-meter presented here has a lower limit of ~1 µH and an upper limit of ~ | The L-meter presented here has a lower limit of ~1 µH and an upper limit of ~1 MH (Mega Henry). | ||
Some sources (e.g. [http://electronics-diy.com/lc_meter.php]) claim lower limits as low as 10 nH, but I personally do not see how this can be achieved with the current solution. For more details see section "Theory and Schematic". | Some sources (e.g. [http://electronics-diy.com/lc_meter.php]) claim lower limits as low as 10 nH, but I personally do not see how this can be achieved with the current solution. For more details see section "Theory and Schematic". | ||
Line 18: | Line 18: | ||
[[File:ChestotomerShema.png|400px|thumb|right|L-meter schematic]] | [[File:ChestotomerShema.png|400px|thumb|right|L-meter schematic]] | ||
The working principle of the schematic is as follows: | The working principle of the schematic is as follows: | ||
# A tank circuit consisting of the capacitor C3 and the unknown coil will | # A tank circuit consisting of the capacitor C3 and the unknown coil (L<sub>x</sub>) will oscillate at a resonance frequency: | ||
<math>f = \frac{1}{2\pi\sqrt{LC}}</math> | |||
The schematic here is designed to work as a frequency counter, counting the frequency of oscillation of the aforementioned tank cirquit L<sub>x</sub>C3. Then if we know the value of C3 we can make the MCU measure the frequency, calculate L<sub>x</sub> and display it on the LCD: | |||
<math>L = (\frac{1}{2\pi f \sqrt{C}})^2</math> | |||
# Without L<sub>x</sub> connected, LM311 works as a free running multivibrator with a frequency on pin 7 ~1 Hz. When some L<sub>x</sub> is connected, pin 7 on LM311 starts oscillating with the frequency of the tank cirquit. The bigger L<sub>x</sub> the lower the frequency. Thus the upper limit of measurement will be limited by the frequency of the free running multivibrator (~1 Hz) and is therefore ~1 MH. | |||
# The rectangular pulses generated by LM311 will then be picked by the MCU, the frequency and inductance calculated and the inductance displayed on the LCD. | |||
In theory if the main oscillator frequency is 4 MHz (Tosc 0.25 μs), one cycle will be 4 x Tosc = 1 μs. An external clock signal going directly into the counter (pin T0CKI), without prescaler, should be high for longer than 2 x Tosc + 20 = 520 ns and low for at least the same time. This gives a total period of 1040 ns. Thus, the maximum input frequeny is 1/1040 ns = 961.5 KHz. If the prescaler is applied, according to the specs of PIC 16F88 the external clock input must be high/low for more than 10 ns. Consequently, the maximum countable frequency on pin T0CKI is 50 MHz. This would give a minimum measurable inductance ~10 nH. Why are we getting only 1 µH then? All boils down to the quality of the pulses LM311 in this configuration can give. The rising edge of these pulses has a relatively poor time constant, which results in a relatively slow saturation. Therefore, if the frequency is high enough the pulse will start falling before the rising edge has reached saturation, thus creating a train of jigsaw shaped pulses with an amplitude decreasing with the increase of the frequency, rather than rectangular ones. And for frequencies higher than what L<sub>x</sub> < 33 µH the pulse becomes so bad that the MCU cannot correctly interpret it. How can one go from 33 µH down to 1 µH for the minimum inductance measurement then? In the prototype I built the critical L<sub>x</sub> is 33 µH. Below this inductance the counter begins to generate more or less random numbers. But if one doesn't know that these are random numbers one might take them for real. Here L1 enters the picture. Whenever an unknown inductor is measured, it will be connected in series with L1 (added to it). Thus one will always measure at least 33 µH and will never get into the region of instability due to bad pulse shape. One adds to the code in the MCU an offset of -33 µH so that if one shortcircuits the L<sub>x</sub> input one will measure 0 µH. Now when one measures a 1 µH coil, the display will show 1 µH. | |||
If one wants to measure smaller inductances one needs to redesign the multivibrator part. | |||
==Layouts== | ==Layouts== |
Revision as of 14:32, 2 October 2013
Objective
A traditional multimeter accessible to the hobbyist can measure all essential electric properties, including capacitance. The only property that still remains difficult to measure without extra investments (which can become rather essential) is inductance. Solenoids/coils are a significant part of any analogue circuit and, as opposed to all other discrete components, are often homemade. There are formulae helping to calculate parameters like number of windings, cross-section of the core etc, but one critically needs to verify the inductance of the final product. This article describes how one can build a rather accurate L-meter at home for probably less than $10. Here you will find the schematic, PCB layout, micro-controller source code; basically all you need to DIY.
Description
The L-meter presented here is based on a rather popular solution using the LM311 comparator (see e.g. [1]). It is stripped from the capacitance measuring capability due to micro-controller (MCU) source code size limitation. This limitation is dictated by the compiler I have used: MikroC PRO for PIC, ver. 6.0.0. The free license of the compiler allows up to 2k of program words (2066 to be exact, and the present code is 2065 program words).
Other solutions omitting the LM311 and using built-in the MCU comparators can also be found (see e.g. [2]).
The MCU used in this project is PIC 16F88. Obviously, the code given below is also for this MCU.
Specs
The L-meter presented here has a lower limit of ~1 µH and an upper limit of ~1 MH (Mega Henry).
Some sources (e.g. [3]) claim lower limits as low as 10 nH, but I personally do not see how this can be achieved with the current solution. For more details see section "Theory and Schematic".
Theory and Schematic
The working principle of the schematic is as follows:
- A tank circuit consisting of the capacitor C3 and the unknown coil (Lx) will oscillate at a resonance frequency:
[math]\displaystyle{ f = \frac{1}{2\pi\sqrt{LC}} }[/math]
The schematic here is designed to work as a frequency counter, counting the frequency of oscillation of the aforementioned tank cirquit LxC3. Then if we know the value of C3 we can make the MCU measure the frequency, calculate Lx and display it on the LCD:
[math]\displaystyle{ L = (\frac{1}{2\pi f \sqrt{C}})^2 }[/math]
- Without Lx connected, LM311 works as a free running multivibrator with a frequency on pin 7 ~1 Hz. When some Lx is connected, pin 7 on LM311 starts oscillating with the frequency of the tank cirquit. The bigger Lx the lower the frequency. Thus the upper limit of measurement will be limited by the frequency of the free running multivibrator (~1 Hz) and is therefore ~1 MH.
- The rectangular pulses generated by LM311 will then be picked by the MCU, the frequency and inductance calculated and the inductance displayed on the LCD.
In theory if the main oscillator frequency is 4 MHz (Tosc 0.25 μs), one cycle will be 4 x Tosc = 1 μs. An external clock signal going directly into the counter (pin T0CKI), without prescaler, should be high for longer than 2 x Tosc + 20 = 520 ns and low for at least the same time. This gives a total period of 1040 ns. Thus, the maximum input frequeny is 1/1040 ns = 961.5 KHz. If the prescaler is applied, according to the specs of PIC 16F88 the external clock input must be high/low for more than 10 ns. Consequently, the maximum countable frequency on pin T0CKI is 50 MHz. This would give a minimum measurable inductance ~10 nH. Why are we getting only 1 µH then? All boils down to the quality of the pulses LM311 in this configuration can give. The rising edge of these pulses has a relatively poor time constant, which results in a relatively slow saturation. Therefore, if the frequency is high enough the pulse will start falling before the rising edge has reached saturation, thus creating a train of jigsaw shaped pulses with an amplitude decreasing with the increase of the frequency, rather than rectangular ones. And for frequencies higher than what Lx < 33 µH the pulse becomes so bad that the MCU cannot correctly interpret it. How can one go from 33 µH down to 1 µH for the minimum inductance measurement then? In the prototype I built the critical Lx is 33 µH. Below this inductance the counter begins to generate more or less random numbers. But if one doesn't know that these are random numbers one might take them for real. Here L1 enters the picture. Whenever an unknown inductor is measured, it will be connected in series with L1 (added to it). Thus one will always measure at least 33 µH and will never get into the region of instability due to bad pulse shape. One adds to the code in the MCU an offset of -33 µH so that if one shortcircuits the Lx input one will measure 0 µH. Now when one measures a 1 µH coil, the display will show 1 µH. If one wants to measure smaller inductances one needs to redesign the multivibrator part.