0% found this document useful (0 votes)
7 views7 pages

Lcf Meter

Uploaded by

abdul salam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views7 pages

Lcf Meter

Uploaded by

abdul salam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

LCMeter

V1.2 2009/01/24
By Hal Foster
[email protected]

Introduction
This project came about for two reasons: First, because I needed a LC meter,
and second, because I wanted to learn AVR assembler. Originally, I planned on
using the circuit (or one of the variations) “Surprisingly Accurate LC Meter” that
originally appeared in the April 2004 issue of Amateur Radio and write my own
firmware. I bread boarded the circuit and found that, while it did work, it didn’t
have the range or scope that I wanted. So, after playing around with several
ideas, I settled on the following design.

Overview
Frequency: 0  ≈20 MHz, 10mv  +-5 v at 10 Hz resolution

Inductance: 1 nh  ≈20 h, auto ranging

Capacitance: ≈10pf  20,000+ µF, auto ranging

Accuracy: 1% or better, depending on reference caps used.

Revisions
1.1 Initial release
1.2 Minor changes in program to accommodate major modifications to
Math library.

Calibration
Inductance: Short test leads together and press “zero” switch

Capacitance: Leave test leads open and press “zero” switch

Notes: Calibration values are stored in EPROM; recalibration is


recommended anytime test leads are changed to offset any
changes in parasitic capacitance/inductance. When
measuring values in the pf or nh range, calibration is
recommended to offset changes due to the tempco of the
components used.

Circuit

I designed this project to be installed in a breadboard I had built and to meet


my particular needs, using the parts that I had on hand. As such, there are parts
of the design that could certainly be done differently <grin>. All in all, though, it
is a pretty simple and straightforward design.

Inductance – Here I used a Schmitt trigger inverter (IC4 - 74HC14) to drive


a LC resonant circuit formed from C6 and C7 with either the DUT (Device Under
Test) or the reference inductor. C6 and C7 (along with C1 for capacitance
measurement) are the only precision components needed. I used some 1%s that I
had on hand, although they can be bought from Digikey, Mouser etc. for very
little. L1 is in series with one leg of the input and provides both the reference and
proper scaling for measuring low values of inductance. Both legs of this oscillator
are switched to the inputs by K1. This signal is buffered and shaped by a couple
more gates of IC4 and then fed to the NC input of analog switch IC7A. This
switch selects between feeding this signal or the frequency counter output to the
“T0” input if the AVR. The AVR counts the pulses over a period of 1 second to
directly measure the frequency of the oscillator corresponding to the function:

Solving for L:

1
L= 2
C (2 π ƒ )^
gives us the value of the inductor.

When calibrating, the test leads are shorted and the inductance of L1 as well as
the parasitic inductance of both the circuit and the test leads are measured and
stored. This is then subtracted from later measurements.

Capacitance – Capacitance is measured by applying one of three fixed


current sources to the DUT and measuring the time it takes for the voltage across
the DUT to cross between two voltage levels ( Δvt). This time is scaled against
the time for the reference capacitor C1 and displayed - the range is automatically
selected to give the best resolution. The DUT is discharged via Q12 and R15 and
the cycle is repeated.
When calibrating, the test leads are kept open and first the parasitic
capacitance is measured. Then, the reference capacitor C1 is measured. Both
these values are saved in EPROM for later use.

Frequency – The signal input is coupled via C8 to the input circuitry. R23 is
used to adjust the 0-volt offset and R20 along with D1 & D2 provide input
overvoltage protection. IC6 buffers the input signal and amplifies it 2X before it
is fed to the input of comparator IC3. The signal is then buffered and shaped by 2
stages of IC4 before being sent to IC2 which is configured to divide by 10. It is
then sent to the NO input of IC7.

The only calibration required is to short the inputs together and adjust for 0v
at pin 6 of IC6.

Aside: Since the circuit has three current sources that provide (relatively)
long current pulses to the DUT, I could make them provide *short* pulses and
thereby have an approximation of the circuit found elsewhere on the web used to
measure ESR. In fact, I was originally going to do this; I decided against it for
several reasons. First, the response of a capacitor to a voltage pulse:

ESR
V
T
The initial peak is due to the inductance of the capacitor along with that of the
test leads and internal circuitry. The point marked as ESR corresponds the
capacitor’s actual ESR (along, of course, with the resistance of the test leads etc.)
The circuits I could find all operated by feeding the voltage developed across the
DUT into one leg of a comparator; starting a ramp generator and feeding that
into the other – then waiting for a missing output pulse from the comparator and
timing the interval. If the comparator was enabled before the pulse was
generated, then what wound up getting measured was not the capacitor’s ESR,
but the circuit’s cumulative inductance – as was the case for the published source
code; The point you actually want to measure is the one marked ESR; this
appears, on average, 2us after the start of the initial pulse. I would assume
(hope) that the commercially sold units would take this into account. Anyway,
once you know what it going on it is easy enough to work around – the problem
with adding it to this circuit, though, is the other stuff that is already there;
specifically, the inductance circuitry and the various relays, etc needed to switch
between them. A capacitor’s ESR is frequently in the low milliohm range – and a
relay’s contacts can easily vary that much between operations. So, to accurately
measure a capacitors ESR you really need a direct, carefully laid-out connection –
not easy to do here without resorting to probably-not-working kludges. So, so
long to measuring ESR ;-)
Software
Not too much to say about the firmware other than what is in the (not that
well) commented source code. As I said above, I had to learn AVR assembler to
do this project, and that learning curve shows, I’m afraid. All of the routines in
the include files are designed primarily for ease of use. All registers are restored
after calling and I’ve tried to be as consistent as I can in their parameters. That
being said, though, they really do make things easier as long as you don’t mind
the extra space (especially some of the macros) they take – all of which can be
optimized out to fit a specific situation.

Known Issues/Possible Improvements


The only issues that I’m aware of are in the capacitance measurement. When
the test leads are open, the circuit will continuously cycle through each range; if a
really big honkin’ (technical term) capacitor is attached while it is in the 5ua
range, it will appear to lock up (actually not, just gonna take a long time). This
doesn’t happen very often and the fix would screw up very tight timing, so just
disconnect the cap and try again.

Sometimes you have to press a mode/zero button for a while before it registers
– not really a problem, but something that could be tweaked.

Not an issue per se, but you may wonder: I’m powering the LCD backlight
from the negative leg of the +-5v supply instead of the positive (not that it really
matters, anyway…). The reason applies to the end use for me: part of an existing
breadboard I built. It has internal supplies of +-12v and +-5v – and I already
have another LCD backlight being run off the +5 leg, so I put this one on the -5
leg to balance.

The frequency counter was really thrown in as an afterthought; if all you deal
with are logic levels, it could be simplified a good bit. If you are interested in
analog signal levels, it could be improved and/or expanded – if nothing else, use
a bootstrapped input to increase impedence.

There is not a lot of wiggle room if you are interested in changing components;
the HC TTL really does need to be high speed – don’t replace with LS. The
LM6171 could be replaced with a slower part (and the 74HC90 eliminated) if you
are only interested in <1-2 Mhz (Although the LM6171/6172 parts are really nice
– usually just plug and play, no fiddling required).

The resistors used in the current sources – especially the 50ma – really should
be 1% metal film; not for precision but for thermal stability. It’s no big deal if you
use 5% carbon comps, though – just calibrate more often.
1
IN 1
PWR 1
FIN
+5V R4 R2

GND

NO
GND
R23 68R 10R
500K C8

K2
-5V R22 R21 +5V
1 3

2N3906
.0027

2N3904
Q3
2N3906
Q5 Q4

COM
820K 820K

2
R3
R20
10R
K4 10K R8 R6 +5V
COM NO D2 D1

GND
8.2k 1K

C1
BAT46 BAT46

1uF 1%
4
13
2N3906

K1 K1

2N3904
Q8
2N3906
Q7 Q6

6 8 11 9 R7
1K

GND
L1 R12 R11
15uH C12 C9 820k 47k
6.8uF .1uF
.1uF 6.8uF C10 C11
2N3906

680R
R26

C6
2N3904
Q11
2N3906
Q9 Q10

13
R10

.01uF
R9
2.2K

2
3
47k
-5V R25 R24 +5V
4 7
R15

1k
R5
R13
2.2K

10R 10R
C13

IC6
6

12
TIP101
10R Q12
GND

680R
R27
LM6171
GND
C14

C7
11

.01uF
1k

3
2

GND
C15

R14
5
C16

C30

10
IC3
C17

9
-5V
C19

1 2 3 4
C26

MAX903CPA
C18
C20

C24

8
GND
7
6
3
2
1
14
C31

C35

IC2
22uF .1uF .1uF 1000uF 22uF
C32

CKB
CKA

R9(2)
R9(1)
R0(2)
R0(1)

74HC90
QB
QA

QD
QC
C34
C25

8
9

11
12
C33
C23

+5V +5V
C27

470R 2.2K 470R


5
C21

GND

R18 R17 R16


C28
C22
.1uF .1uF .1uF .1uF .1uF .1uF .1uF .1uF .1uF 10uF 2200uF 22uF 47uF
+

C3
4 8

1uF
IC5P

C29
22uF .1uF 22uF 22uF .1uF

7 14

C2
GND VCC

1uF
470R
IC4P

-5V

2
3
6
5

7 4
V-

R29 +5V
3V+GND

2
1
8

VL 5
470R
D

S1
S2

R30 10 5
1
7

GND VCC
IC5A
IC5B
GND

LM393N
LM393N
DG419DJN
IC7A

6 1
+5V GND 8
6

10K VDD
IC2P IC3P

4
VEE
R32
K1

IC1 1 16
1 PC6(/RESET/PCINT14) PC0(ADC0/PCINT8) 23
PC1(ADC1/PCINT9) 24
PC2(ADC2/PCINT10) 25
PC3(ADC3/PCINT11) 26 C2 C1
2N3904
Q2

PC4(ADC4/SDA/PCINT12) 27
K2

1K
R1

PC5(ADC5/SCL/PCINT13) 28
C4

9 PB6(XTAL1/TOSC1/PCINT6)
22pF

10 PB7(XTAL2/TOSC2/PCINT7)
2
Q1

PD0(RXD/PCINT16)
PD1(TXD/PCINT17) 3
7 VCC PD2(INT0/PCINT18) 4 C2 C1
C5

PD3(INT1/OC2B/PCINT19) 5
22pF
K4

PD4(T0/XCK/PCINT20) 6
20 AVCC PD5(T1/OC0B/PCINT21) 11
21 AREF PD6(AIN0/OC0A/PCINT22) 12
+5V PD7(AIN1/PCINT23) 13
GND

PB0(ICP1/CLKO/PCINT0) 14
PB1(OC1A/PCINT1) 15
22 AGND PB2(SS/OC1B/PCINT2) 16 R19
PB3(MOSI/OC2A/PCINT3) 17 10K
8 GND PB4(MISO/PCINT4) 18
PB5(SCK/PCINT5) 19
+5V
R31
220R

MEGA48/88/168-PU

R28
GND

-5V 3R
6
5
4
3
2
1
1
2
4
3
2
1
4
3
2
1
5
4
3
2
1

1
LED
SV1

ICP
ZERO
IS

BL
L
L
+

F
F

C
C
IN
INPUT R10

+
47k
R11
2N3906
Q9 1 2 3 47k C25
K2
C3210uF
C1

2.2K
.1uF

R13
820k

3 2 1 Q10
3 2 1 Q11
R12R7

2N3906
2N3904
1K C21
2N3906 R6
1uF 1% Q7 1 2 3 1K 22uF
K4
C31

.1uF
2.2K

2N3904
3 2 1 Q6
3 2 1 Q8
R9
8.2k
K1 R8R3

1K
2N3906
2N3904

R1
10R C22

Q2 1 2 3
2N3906 R2
1
Q5 2 3
10R 47uF

10R
R15
.1uF L1
15uH
C6
IC4C16
3 2 1 Q4

.01uF 68R
3 2 1 Q3

C7
1k
R5

Q12
TIP101

R14
R4
2N3906

1k
2N3904

74HC14
.01uF
C29
C3
C2
1uF
1uF

470R
.1uF C28 R18
R30
470R
IC5

22uF
LM393N R17
470R
2.2K R16
470R
R29
C13

.1uF

IC2
IC1
IC7

DG419DJN
74HC90

.1uF
.1uF
.1uF
C33
C14
C27
22uF

.1uF 22pF
C18
Q1
C17
.1uF

C26 C4
22pF
MEGA48/88/168-PU

C5
MAX903CPA
IC3
C20 C19

.1uF .1uF

C15

.1uF
ZERO
1

680R 10K
680R R27
R32 1
C30 C11
22uF.1uF

R26
820K 6.8uF
LM6171 ICP
R22 C10 .1uF 6 ICP
IC6R23

R20
10K

4 1
500K

6.8uF C12 IS
INP SEL
.0027
D2

C9
+

LCD 1
R21
C8 FIN
D1
BAT46

BAT46

R19
4

5 LCD
10R
R25

820K
C24
10R
R24
220R
R31

-5
C35
22uF

1000uF

G
LED

10K
1

PWR

3R
C34

+5
22uF

R28
+

BL
LED BL
2200uF
C23

You might also like