Author Topic: Simple MCU based LC meter  (Read 6237 times)

0 Members and 1 Guest are viewing this topic.

Offline void_errorTopic starter

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: ro
  • I can transistor...
Simple MCU based LC meter
« on: October 01, 2014, 11:08:15 am »
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'  :-/O).

It's based on the principle explained nicely here http://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 capacitor
  • set the comparator interrupt accordingly
  • apply another pulse to the d.u.t. and start a timer
  • stop the timer when the comparator interrupt occurs
  • calculate the inductance or capacitance value and display it on a character LCD

The 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.  :)
Trust me, I'm NOT an engineer.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Simple MCU based LC meter
« Reply #1 on: October 01, 2014, 11:16:59 am »
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline void_errorTopic starter

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: ro
  • I can transistor...
Re: Simple MCU based LC meter
« Reply #2 on: October 01, 2014, 11:37:13 am »
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.
With 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.

If you insist on using a pic
I only have a PIC programmer at my disposal.

I would encourage you  to think of other means, like using logic gates to convert the time into duty cycle -> filtered voltage.
I 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.
Trust me, I'm NOT an engineer.
 

Offline DmitryL

  • Regular Contributor
  • *
  • Posts: 242
  • Country: gb
Re: Simple MCU based LC meter
« Reply #3 on: October 01, 2014, 04:38:06 pm »
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'  :-/O).
now what you think.  :)

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




 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: Simple MCU based LC meter
« Reply #4 on: October 01, 2014, 08:38:46 pm »
The AADE meter is very good and you might be reinventing the wheel here, far easier just to buy one of their kits.
Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline void_errorTopic starter

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: ro
  • I can transistor...
Re: Simple MCU based LC meter
« Reply #5 on: October 01, 2014, 09:16:28 pm »
... 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.
This 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.

The AADE meter is very good and you might be reinventing the wheel here, far easier just to buy one of their kits.
I'd buy one if I had $100 lying around, but I don't.
Trust me, I'm NOT an engineer.
 

Offline microbug

  • Frequent Contributor
  • **
  • Posts: 563
  • Country: gb
  • Electronics Enthusiast
Re: Simple MCU based LC meter
« Reply #6 on: October 01, 2014, 09:33:59 pm »
... 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.
This 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.

The AADE meter is very good and you might be reinventing the wheel here, far easier just to buy one of their kits.
I'd buy one if I had $100 lying around, but I don't.

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

Offline void_errorTopic starter

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: ro
  • I can transistor...
Re: Simple MCU based LC meter
« Reply #7 on: October 01, 2014, 09:41:28 pm »
The 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.

Not 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.
Trust me, I'm NOT an engineer.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Simple MCU based LC meter
« Reply #8 on: October 01, 2014, 10:09:13 pm »
Quote
which will have different permeabilities at different frequencies therefore different inductances.

Unless you can create true Dirac stimuli (you cannot) or a sine wave at your specific frequency, you will find the same problem.

================================
https://dannyelectronics.wordpress.com/
 

Offline void_errorTopic starter

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: ro
  • I can transistor...
Re: Simple MCU based LC meter
« Reply #9 on: October 02, 2014, 08:06:26 am »
Unless you can create true Dirac stimuli (you cannot) or a sine wave at your specific frequency, you will find the same problem.

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



« Last Edit: October 02, 2014, 09:19:38 am by void_error »
Trust me, I'm NOT an engineer.
 

Offline void_errorTopic starter

  • Frequent Contributor
  • **
  • Posts: 673
  • Country: ro
  • I can transistor...
Re: Simple MCU based LC meter
« Reply #10 on: October 05, 2014, 09:50:48 am »
Looks like I'm going with the 'classical' LC oscillator and frequency measurement circuit http://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?

Trust me, I'm NOT an engineer.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf