Arduino-based Inductance Meter

_MG_1131
Incuctance meter in action. It displays the resonance frequency together with the inductance

I’ve just finished a little Arduino project. It’s a shield for the Arduino Uno that lets you measure inductance. This is a functionality that I found missing in just about any digital multi meter. Yes, there are specialized LCR meters that let you measure inductance but they typically won’t measure voltages or currents. So I had to build my inductance meter myself.

_MG_1146
Close-up of the circuit with the display removed

The basic design is really simple. It a colpitts oscillator (http://en.wikipedia.org/wiki/Colpitts_oscillator) with the coil missing. You use the test leads to connect it to a coil which will make it resonate. The Arduino then measures the frequency at which the oscillator is resonating and calculates the inductance. The capacitors are part of the shield so the capacity is known.

_MG_1132
With the test leads open, the oscillator can’t resonate. The current calibration/zero-offset is displayed in stead

There is 1uH of inductance included on the schield which is placed in series with the coil to be measured. This serves two purposes: The oscillator can resonate when you short-circuit the test leads. When you then press the push button on the shield, the software will use the current measurement as new calibration. It also puts an upper limit on the resonance frequency. This ensures that the software the rest of the circuit can keep up with the oscillator.

_MG_1139
Pressing this blue button zeroes the meter

As can be seen from the schematic, the oscillator uses two 1nF capacitors in series. Together with the 1uH inductance, this limits the frequency to about 7.1MHz. In practice, it oscillates at around 5.4MHz when the test leads are short-circuited.

_MG_1137
The Arduino shield from below

The oscillator output is followed by a comparator turning the sine wave of the oscillator into a square wave. I’ve used an inexpensive but fast Microchip MCP6561R. It has a maximum propagation delay of 80ns which allows it to keep up at the maximum frequency.

_MG_1142
Viewed from straight above

But of course, 5.4MHz is way too fast for the Arduino to keep up. The Arduino runs at 16MHz and will need at least a few dozend instructions to process each pulse from the shield. My solution was to add a 74HC590 8-bit binary counter dividing the frequency by 256. That gives a theoretical maximum frequency of 7.2MHz / 256 = 27.7kHz. That’s something the Arduino can deal with.

_MG_1145
The entire shield with the display removed

For obvious reasons, there is also a display included on the shield. And then there’s that pushbutton which is debounced in hardware by running it through an RC low-pass filter and a Schmitt-triggered buffer. The button is used to zero the meter, i.e. the current measurement is used as the new zero-offset.

_MG_1151
Even very small inductance values can be measured

All related files can be downloaded as a .zip file: LMeterShield. This includes the Arduino source code (aka sketch) as well as the Eagle files and PDFs of both the layout and the schematic.

Now there’s also a stand-alone version: https://soldernerd.com/2015/01/14/stand-alone-inductance-meter/

13 thoughts on “Arduino-based Inductance Meter”

  1. Awesome, I’ve wanted to design something similar for a long time but I couldn’t find a simple way to measure inductance (though to be honest I didn’t look very hard). I might want to port your work to the MSP430 or something, have you released everything under an open source license? Also, is it on Github (or similar)? I’ve just downloaded the zip to look at it. Awesome work man!

    1. @Aurelius:
      I haven’t really specified any specific license but yes, you can use all of the information and files for your own projects, commercial or not. It’s not currently on Github but I might upload them there when I get time.

      I’ll probably build a second version with an on-board PIC microcontroller, most likely a PIC16F1932. It’ll then be a stand-alone solution that can be mounted in a small case, just like a multimeter. The Arduino is quite an overkill just to measure a frequency and write to a display…

  2. Nicely done, and thank you for the .pdf’s of the schematic and layout. So many people just toss out the Eagle files and walk away, as if everyone on the planet is locked-in to Eagle.

    A couple of questions:

    Why didn’t you add a switch and a bit more code to allow measurment of capacitance as well?

    How low in Inductance can you measure both theoretically and in testing?

    Thanks & Regards, David

    1. @David:
      Thank you and welcome. I personally like working with Eagle but I don’t think it’s the right format to just have a quick look at someone else’s design. That’s why I tend to include PDFs as well.

      Q1: Multimeters can typically measure capacitance quite well. I have 3 DMMs and they all can measure capacitance so I don’t have a need for another capacitance meter. That’s the short answer. The design is simplified quite a bit by limiting myself to inductance. I’m using a colpitt’s oscillator and they use 2 caps in series. So they don’t lend themselfs that well to capacity measurements. But if that’s your ambition, there’s another projects that might be of interest to you:
      http://www.ekushebangla.com/Lc_Meterdescription.html. I’ve looked at that design but then decided to do my own thing.

      Q2: I’m counting the number of cycles over about a quarter of a second and the arduino’s oscillator is crystal-based so the resolution and accuracy of the frequency measurement is very high. I’ve calibrated the arduino’s clock frequency in software by defining CPU_FREQUENCY as 15992430.43 instead of 16000000.0. Now the frequency I read with my oscilloscope exactly (and I mean down to a single Hz) matches the scope no matter the inductance I’m measuring. The main problem are the test leads. They have quite a bit of inductance themselves. You can zero that by pressing that button but their inductance easily varies by maybe plus/minus 100nH depending on how you hold them. If you’re careful to calibrate them in the same position as you measure you can measure very small inductances such as the 300-something nH you see on the last photo. It’s just 12 turns of a wire. If I just let it sit on the bench like on the photo, then the measured inductance doesn’t fluctuate by more than 1nH.

  3. Hi, i’d like to give this nice design a try, but I’m a newbie and I don’t have surface mount skills/possibilities right now, so I thought about experimenting with some through hole and dip package equivalents. I think MCP6541 comparator might work but as I said I’m a newbie and I’m not 100% sure. Could you confirm that for me please, or maybe recommend a better one? Also as I understand it’s impossible to find a 5Ghz through hole transistor so I think i will leave that surface mount, perhaps I can handle 3 pins, but for the sake of consistence, maybe you know a trough hole one that might work? Thanks a lot!

  4. This is a wonderful project. Thank you!
    Is the schmitt trigger buffer chip necessary for the project? I think the gpios of arduino already have the schmitt trigger property.

    1. Hi Zhe. I think you’re referring to the comparator for the zero-crossing detector? Yes, the arduino does have a built in comparator. For me, the reasons to using a comparator on the board were the following: Atmel doesn’t specify its comparator very precisely (propagation delay, hysteris etc) and more importantly, I can’t look at the arduino’s comparator output on a scope. I can only guess what it’s doing. So using an extra comparator gives me a lot of visibility what is actually going on.

  5. Hi,
    it is an interesting and perfect project. I know similar projects from Kerry D. Wong, or at ReiBot.org.
    I have downloaded the program and at the test board, attached LCD display.
    The program was OK, but there was nothing on the display. After an amendment:
    #include
    /*#define LCD_RS 12
    #define LCD_RW 11
    #define LCD_EN 10
    #define LCD_D7 2
    #define LCD_D6 3
    #define LCD_D5 4
    #define LCD_D4 5*/
    #define LCD_RS 12
    #define LCD_RW 11
    #define LCD_EN 10
    #define LCD_D7 6
    #define LCD_D6 7
    #define LCD_D5 8
    #define LCD_D4 9

    LiquidCrystal lcd(LCD_RS, LCD_RW, LCD_EN, LCD_D4, LCD_D5, LCD_D6, LCD_D7);
    //LiquidCrystal lcd(LCD_RS, LCD_EN, LCD_D4, LCD_D5, LCD_D6, LCD_D7);
    at the display there was the following:
    Not resonating
    Calib: 1,86 μH
    I have several questions. Will the project work with the mentioned amendment?
    Why the pin 5 is not connected at GND on the LCD display?
    Can I put instead of 74HC590 A MC74VHC1GT50 any equivalent?

    Thanks,
    Ed.

  6. Wow, this is a very well designed project. The write up is clear and the schematics are perfect. Excellent work!!!!

    I am starting this project today but modifying it to us a 4-line LCD that I have, model J204A.

    Again, excellent work.

    Thanks

    1. Hi Jim

      Thanks a lot. The modification you have in mind should easily be possible. You’ll need a whole lot more pins on the micro but there are plenty of unused ones on the PIC16F1936.

      lukas

Leave a Reply

Your email address will not be published. Required fields are marked *