Simple MCU based LC meter - Page 1
Forum section: electronics / projects

author: void_error
author_rank: Frequent Contributor
timestamp: October 01, 2014, 11:08:15 am
content: After digging for an inductance meter design on the internet and running mostly into the same design using an the inductor under test as part of an oscillator and not liking the idea of using another inductor (not really a precision component) in series with the inductor to be measuresured I decided to design one (read 'I had an idea').It's based on the principle explained nicely herehttp://www.electronics-tutorials.ws/inductor/lr-circuits.html- basic stuff.The idea is to have an RL circuit and measure the time between when the supply voltage is applied to the inductor to when the voltage across the inductor reaches half the supply voltage which is exactly L/R*ln(2) or L/R*0.693. Why did I choose half the supply voltage? Because then I can also measure capacitors without any modifications and the MCU can detect whether the end voltage is above or below half the supply voltage.What the MCU (a PIC with an integrated comparator) will have to do is:apply a pulse to the d.u.t. (most likely via a P-channel MOSFET) and determine whether it's an inductor or capacitorset the comparator interrupt accordinglyapply another pulse to the d.u.t. and start a timerstop the timer when the comparator interrupt occurscalculate the inductance or capacitance value and display it on a character LCDThe inductive kickback will be one thing I'll have to deal with, applying a voltage several volts below ground to the comparator will fry it. Usually a diode would solve that problem but also shifting the inductor's terminal connected to ground to a higher voltage (like 1V) will prevent negative pulses on the comparator's input.Let me know what you think.

author: dannyf
author_rank: Super Contributor
timestamp: October 01, 2014, 11:16:59 am
content: You probably want to do some basic math to see how fast the timing has to be for it to work - it is mostly out of the realm of possibilities for most mcus.If you insist on using a pic, choose one with a programmable current source - ctmu. Also, don't let it go to 1/2Vcc - too high and non-linear at that point.I would encourage you to think of other means, like using logic gates to convert the time into duty cycle -> filtered voltage.

author: void_error
author_rank: Frequent Contributor
timestamp: October 01, 2014, 11:37:13 am
content: Quote from: dannyf on October 01, 2014, 11:16:59 amWith a 16MHz clock and a 1:1 prescaler for Timer1 it'll increment every 250ns.A lower value of R will translate into a longer time to get to 1/2Vdd. Current consumption is not of any concern here as I don't want it to be battery powered.Quote from: dannyf on October 01, 2014, 11:16:59 amI only have a PIC programmer at my disposal.Quote from: dannyf on October 01, 2014, 11:16:59 amI actually experimented with that a while back, found a circuit using schmitt trigger logic inverters and a filtered output connected to a DVM. However, I didn't like the nonlinearity. It might be the same case here. I'll have to do some simulations and replace the last inverter gate with a comparator.

author: DmitryL
author_rank: Regular Contributor
timestamp: October 01, 2014, 04:38:06 pm
content: Quote from: void_error on October 01, 2014, 11:08:15 am... Speaking about precision... My LCF-meter, based on AADE design, quite happily measures inductance from 1uH to about 1H (maybe more) and capacintance from 1pF to about 10uF with quite good precision and linearity. It has probes compensation (did you thing of it, by the way ?).Can you achieve similar dynamic range with your design ?If you read the AADE article, you will probably notice, that their design doesn't require _precise_ components, they just need to be stable. Everything else you achieve with proper calibration. On the orher hand, it is quite difficult to provide long-term inductor stability with ferrite core; almost everything affects it, including Earth magnetic field, tempearture, and wires with current near it. It is ok, if I recalibrate my LCF meter every 5 minutes, otherwise it drifts slightly.

author: German_EE
author_rank: Super Contributor
timestamp: October 01, 2014, 08:38:46 pm
content: The AADE meter is very good and you might be reinventing the wheel here, far easier just to buy one of their kits.

author: void_error
author_rank: Frequent Contributor
timestamp: October 01, 2014, 09:16:28 pm
content: Quote from: DmitryL on October 01, 2014, 04:38:06 pmThis is pretty much what I found and want to avoid. The frequency is not fixed, it depends on the value of the measured inductor. Most of the inductors I'm going to measure will have ferrite or powdered iron cores which will have different permeabilities at different frequencies therefore different inductances.Quote from: German_EE on October 01, 2014, 08:38:46 pmI'd buy one if I had $100 lying around, but I don't.

author: microbug
author_rank: Frequent Contributor
timestamp: October 01, 2014, 09:33:59 pm
content: Quote from: void_error on October 01, 2014, 09:16:28 pmThe point is that, with the BOM and the PCB as well as an enclosure / display / UI, the cost will probably be at least that much.

author: void_error
author_rank: Frequent Contributor
timestamp: October 01, 2014, 09:41:28 pm
content: Quote from: microbug on October 01, 2014, 09:33:59 pmNot really. The enclosure and the LCD display will be the most expensive. The PCB will be dirt cheap as I've got the all the required stuff to make it at home and for a simple circuit like this a single layer one will do. It'll all be probably under $30.$100 is without shipping, which will be another $20-30. Totally not worth it.

author: dannyf
author_rank: Super Contributor
timestamp: October 01, 2014, 10:09:13 pm
content: QuoteUnless you can create true Dirac stimuli (you cannot) or a sine wave at your specific frequency, you will find the same problem.

author: void_error
author_rank: Frequent Contributor
timestamp: October 02, 2014, 08:06:26 am
content: Quote from: dannyf on October 01, 2014, 10:09:13 pmI think I can get around the requirement of zero rise time by shifting the measurement window to the right. Theoretically it won't affect the measurement since time is proportional to inductance. With a rise time of zero (impossible) the window would be between Vdd and Vdd/2 (5V & 2.5V). I can shift that right and set the window comparator accordingly so I get a 1? pulse length. Some math is in order.Generating a 100kHz sine wave isn't that difficult, measuring the AC voltage across the inductor probably will be if a peak detector is used. Any ideas on this?EDIT: Here's a simulation. 1us rise time. 500mA through the inductor... not practical.

author: void_error
author_rank: Frequent Contributor
timestamp: October 05, 2014, 09:50:48 am
content: Looks like I'm going with the 'classical' LC oscillator and frequency measurement circuithttp://electronics-diy.com/lc_meter.php.However I'm going to make a few modifications to keep the oscillator frequency range between 50kHz and 250kHz which implies switching in different capacitance values.How can I do this in the simplest way?