News

New Products

Industry News

Articles

Product Reviews

Tech Articles

Tutorials

Interviews

Case Studies

Digi-Key Store

Cables and Wires

LED/Optoelectronics

Connectors and Interconnect

Discrete

Electromechanical

Integrated Circuits (ICs)

Embedded Computers

Enclosures, Hardware and Office

Isolators

RF and Wireless

Power and Circuit Protection

Programmers

Passives

Sensors and Transducers

Semiconductors

Test Products

Tools

Projects

555 Timer Circuits

Op-amp Circuits

Audio Circuits

Power Supply Circuits

All Electronic Circuits

Arduino Projects

Raspberry Pi Projects

MSP430 Projects

STM32 Projects

ESP8266 Projects

PIC Projects

AVR Projects

8051 Projects

ESP32 Projects

NodeMCU Projects

IoT Projects

PCB Projects

Arduino ESP8266 Projects

All Microcontroller Projects

Forum

Contact

Editorial

Advertise

About Us

More

Partner Events and Conferences

EE Calculators

Login

Register

LC Meter using Arduino: Measuring Inductance and Frequency

Arduino

BySaddam
Sep 05, 2018

5

LC Meter Using Arduino: Measuring Inductance and Frequency

All embedded lovers are familiar with multimeter which a great tool to measure voltage, current, resistance etc. A multimeter can measure them easily. But sometimes we need to measure inductance and capacitance which is not possible with a normal multimeter. There are some special multimeters that can measure inductance and capacitance but they are costly. We already built Frequency Meter, Capacitance Meter and Resistance meter using Arduino. So today we are going to make an Inductance LC Meter using Arduino. In this project, we will show the inductance and capacitance values along with the frequency over 16x2 LCD display. A push button is given in the circuit, to switch between capacitance and inductance display.

Components Required

Arduino Uno

741 opamp IC

3v battery

100-ohm resistor

Capacitors

Inductors

1n4007 diode

10k resistor

10k pot

Power supply

Push button

Breadboard or PCB

Connecting wires

Calculating Frequency and Inductance

In this project we are going to measure inductance and capacitance by using an LC circuit in parallel. This circuit is a like a ring or bell which start resonating at certain frequency. Whenever we apply a pulse, this LC circuit will start resonating and this resonance frequency is in form of analog (sinusoidal wave) so we need to convert it in squire wave. To do this, we apply this analog resonance frequency to opamp (741 in our case) that will convert it in squire wave (frequency) at 50% of the duty cycle. Now we measure the frequency by using Arduino and by using some mathematical calculation we can find the inductance or capacitance. We have used the given LC circuit frequency response formula.

f=1/(2*time)

where time is output of pulseIn() function

now we have LC circuit Frequency:

f=1/2*Pi* square root of (LC)

we can solve it to get inductance:

f2 = 1/ (4Pi2LC)
L= 1/ (4Pi2 f2C)
L = 1/(4* Pi * Pi * f * f * C)

As we already mentioned that our wave is sinusoidal wave so it has the same time period in both positive and negative amplitude. Its means the comparator will convert it into square wave having a 50% duty cycle. So that we can measure it by using pulseIn() function of Arduino. This function will give us a time period which can be easily converted into a frequency by inverting the time period. As pulseIn function measure only one pulse, so now to get correct frequency we have to multiply it by to 2. Now we have a frequency which can be converted into inductance by using the above formula.

Note: while measuring inductance (L1), capacitor (C1) value should be 0.1uF and while measuring capacitance (C1), inductor (L1) value should be 10mH.

Circuit Diagram and Explanation

In this LC Meter circuit diagram, we have used Arduino to control the project operation. In this, we have used an LC circuit. This LC circuit consists of an Inductor and a capacitor. To convert sinusoidal resonance frequency to digital or square wave we have used operational amplifier namely 741. Here we need to apply negative supply to op-amp to get accurate output frequency. So we have used a 3v battery connected in reverse polarity, means 741 negative pin is connected to battery negative terminal and positive pin of the battery is connected to the ground of the remaining circuit. For more clarification see the circuit diagram below.

Here we have a push button to change the mode of operation whether we are measuring inductance or capacitance. A 16x2 LCD is used to show inductance or capacitance with the frequency of LC circuit. A 10k pot is used for controlling the brightness of the LCD. Circuit is powered with the help of Arduino 5v supply and we can power the Arduino by 5v using USB or 12v adaptor.

Measuring Frequency and Capacitance

Measuring Frequency and Inductance

Programming Explanation

The programming part of this LC Meter project is very easy. Complete Arduino code is given at the end of this article.

First we have to include library for LCD and declare some pins and macros.

#include<LiquidCrystal.h>
LiquidCrystal lcd(A5, A4, A3, A2, A1, A0);

#define serial

#define charge 3
#define freqIn 2
#define mode 10

#define Delay 15

double frequency, capacitance, inductance;

typedef struct
{
int flag: 1;
}Flag;

Flag Bit;

After it, in setup function we have initialized LCD and Serial communication to show measured values over the LCD and serial monitor.

void setup()
{
#ifdef serial
Serial.begin(9600);
#endif
lcd.begin(16, 2);
pinMode(freqIn, INPUT);
pinMode(charge, OUTPUT);
pinMode(mode, INPUT_PULLUP);
lcd.print(" LC Meter Using ");
lcd.setCursor(0, 1);
lcd.print(" Arduino ");
delay(2000);
lcd.clear();
lcd.print("Circuit Digest");
delay(2000);
}

Then in loop function, apply a pulse of a fixed time period to LC circuit that will charge the LC circuit. After removing pulse LC circuit starts resonating. Then we read its square wave conversion, coming from op-amp, by using pulseIn() function and convert that by multiplying by 2. Here we have taken some samples of this too. That’s how frequency is calculated:

void loop()
{
for(int i=0;i<Delay;i++)
{
digitalWrite(charge, HIGH);
delayMicroseconds(100);
digitalWrite(charge, LOW);
delayMicroseconds(50);
double Pulse = pulseIn(freqIn, HIGH, 10000);
if (Pulse > 0.1)
frequency+= 1.E6 / (2 * Pulse);
delay(20);
}
frequency/=Delay;
#ifdef serial
Serial.print("frequency:");
Serial.print( frequency );
Serial.print(" Hz ");
#endif

lcd.setCursor(0, 0);
lcd.print("freq:");
lcd.print( frequency );
lcd.print(" Hz ");

After getting frequency value, we have converted them into inductance by using given piece of code

capacitance = 0.1E-6;
inductance = (1. / (capacitance * frequency * frequency * 4.*3.14159 * 3.14159)) * 1.E6;
#ifdef serial
Serial.print("Ind:");
if(inductance>=1000)
{
Serial.print( inductance/1000 );
Serial.println(" mH");
}
else
{
Serial.print( inductance );
Serial.println(" uH");
}
#endif

lcd.setCursor(0, 1);
lcd.print("Ind:");
if(inductance>=1000)
{
lcd.print( inductance/1000 );
lcd.print(" mH ");
}
else
{
lcd.print( inductance );
lcd.print(" uH ");
}
}

And by using given code we calculated capacitance.

if (Bit.flag)
{
inductance = 1.E-3;
capacitance = ((1. / (inductance * frequency * frequency * 4.*3.14159 * 3.14159)) * 1.E9);
if((int)capacitance < 0)
capacitance=0;
#ifdef serial
Serial.print("Capacitance:");
Serial.print( capacitance,6);
Serial.println(" uF ");
#endif
lcd.setCursor(0, 1);
lcd.print("Cap: ");
if(capacitance > 47)
{
lcd.print( (capacitance/1000));
lcd.print(" uF ");
}
else
{
lcd.print(capacitance);
lcd.print(" nF ");
}
}

So this is how we calculated frequency, capacitance and Inductance using Arduino and displayed it on 16x2 LCD.

Code

#include<LiquidCrystal.h>

LiquidCrystal lcd(A5, A4, A3, A2, A1, A0);

#define serial

#define charge 3

#define freqIn 2

#define mode 10

#define Delay 15

double frequency, capacitance, inductance;

typedef struct

{

int flag: 1;

}Flag;

Flag Bit;

void setup()

{

#ifdef serial

Serial.begin(9600);

#endif

lcd.begin(16, 2);

pinMode(freqIn, INPUT);

pinMode(charge, OUTPUT);

pinMode(mode, INPUT_PULLUP);

lcd.print(" LC Meter Using ");

lcd.setCursor(0, 1);

lcd.print("     Arduino    ");

delay(2000);

lcd.clear();

lcd.print("Circuit Digest");

delay(2000);

}

void loop()

{

for(int i=0;i<Delay;i++)

{

digitalWrite(charge, HIGH);

delayMicroseconds(100);

digitalWrite(charge, LOW);

delayMicroseconds(50);

double Pulse = pulseIn(freqIn, HIGH, 10000);

if (Pulse > 0.1)

frequency+= 1.E6 / (2 * Pulse);

delay(20);

}

frequency/=Delay;

#ifdef serial

Serial.print("frequency:");

Serial.print( frequency );

Serial.print(" Hz     ");

#endif

lcd.setCursor(0, 0);

lcd.print("freq:");

lcd.print( frequency );

lcd.print(" Hz      ");

if (Bit.flag)

{

inductance = 1.E-3;

capacitance = ((1. / (inductance * frequency * frequency * 4.*3.14159 * 3.14159)) * 1.E9);

if((int)capacitance < 0)

capacitance=0;

#ifdef serial

Serial.print("Capacitance:");

Serial.print( capacitance,6);

Serial.println(" uF   ");

#endif

lcd.setCursor(0, 1);

lcd.print("Cap: ");

if(capacitance > 47)

{

lcd.print( (capacitance/1000));

lcd.print(" uF                 ");

}

else

{

lcd.print(capacitance);

lcd.print(" nF                 ");

}

}

else

{

capacitance = 0.1E-6;

inductance = (1. / (capacitance * frequency * frequency * 4.*3.14159 * 3.14159)) * 1.E6;

#ifdef serial

Serial.print("Ind:");

if(inductance>=1000)

{

Serial.print( inductance/1000 );

Serial.println(" mH");

}

else

{

Serial.print( inductance );

Serial.println(" uH");

}

#endif

lcd.setCursor(0, 1);

lcd.print("Ind:");

if(inductance>=1000)

{

lcd.print( inductance/1000 );

lcd.print(" mH            ");

}

else

{

lcd.print( inductance );

lcd.print(" uH              ");

}

}

if (digitalRead(mode) == LOW)

{

Bit.flag = !Bit.flag;

delay(1000);

while (digitalRead(mode) == LOW);

}

delay(50);

}

Video

TAGS

arduino

Test and Measurement

inductance

IC LM741

Get Our Weekly Newsletter!

Subscribe below to receive most popular news, articles and DIY projects from Circuit Digest

Email Address *

Name

Country

United States of America
Aaland Islands
Afghanistan
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antarctica
Antigua And Barbuda
Argentina
Armenia
Aruba
Australia
Austria
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire, Saint Eustatius and Saba
Bosnia and Herzegovina
Botswana
Bouvet Island
Brazil
British Indian Ocean Territory
Brunei Darussalam
Bulgaria
Burkina Faso
Burundi
Cambodia
Cameroon
Canada
Cape Verde
Cayman Islands
Central African Republic
Chad
Chile
China
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo
Cook Islands
Costa Rica
Cote D'Ivoire
Croatia
Cuba
Curacao
Cyprus
Czech Republic
Democratic Republic of the Congo
Denmark
Djibouti
Dominica
Dominican Republic
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Ethiopia
Falkland Islands
Faroe Islands
Fiji
Finland
France
French Guiana
French Polynesia
French Southern Territories
Gabon
Gambia
Georgia
Germany
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Heard and Mc Donald Islands
Honduras
Hong Kong
Hungary
Iceland
India
Indonesia
Iran
Iraq
Ireland
Isle of Man
Israel
Italy
Jamaica
Japan
Jersey (Channel Islands)
Jordan
Kazakhstan
Kenya
Kiribati
Kuwait
Kyrgyzstan
Lao People's Democratic Republic
Latvia
Lebanon
Lesotho
Liberia
Libya
Liechtenstein
Lithuania
Luxembourg
Macau
Macedonia
Madagascar
Malawi
Malaysia
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Mexico
Micronesia, Federated States of
Moldova, Republic of
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
Netherlands
Netherlands Antilles
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Korea
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestine
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn
Poland
Portugal
Puerto Rico
Qatar
Republic of Kosovo
Reunion
Romania
Russia
Rwanda
Saint Kitts and Nevis
Saint Lucia
Saint Martin
Saint Vincent and the Grenadines
Samoa (Independent)
San Marino
Sao Tome and Principe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Singapore
Sint Maarten
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Georgia and the South Sandwich Islands
South Korea
South Sudan
Spain
Sri Lanka
St. Helena
St. Pierre and Miquelon
Sudan
Suriname
Svalbard and Jan Mayen Islands
Swaziland
Sweden
Switzerland
Syria
Taiwan
Tajikistan
Tanzania
Thailand
Timor-Leste
Togo
Tokelau
Tonga
Trinidad and Tobago
Tunisia
Turkey
Turkmenistan
Turks & Caicos Islands
Turks and Caicos Islands
Tuvalu
Uganda
Ukraine
United Arab Emirates
United Kingdom
Uruguay
USA Minor Outlying Islands
Uzbekistan
Vanuatu
Vatican City State (Holy See)
Venezuela
Vietnam
Virgin Islands (British)
Virgin Islands (U.S.)
Wallis and Futuna Islands
Western Sahara
Yemen
Zambia
Zimbabwe

Related Content

Measuring CO2 Concentration in Air using Arduino and MQ-135 Sensor

Controlling a WS2812B RGB LED Matrix with Android App using Arduino and Blynk

Build a Simple Arduino RC Boat that can be Controlled Wirelessly using 433 MHz RF Modules

Interfacing Gravity Infrared CO2 Sensor with Arduino to Measure Carbon Dioxide in PPM

Automatic Surface Disinfecting Robot using Ultraviolet Lights

Air Quality Analyzer using Arduino and Nova PM Sensor SDS011 to Measure PM2.5 and PM10

Touch Sensitive Color Changing Plants using Arduino and RGB LEDs

Li-Fi based Text Communication between Two Arduino

Previous post

Interfacing Bluetooth HC-05 with STM32F103C8 Blue Pill: Controlling LED

Next post

RFID Interfacing with PIC Microcontroller

Comments

Nafiu Nawar
Jan 14, 2019

Log in or register to post comments

why do I only get 0 Hz frequency and inf mH inductance or inf microF capacitance?

Yordan
May 12, 2019

Log in or register to post comments

I am receiving just the same as above :

frequency:0.00 Hz     Capacitance:inf uF

or

frequency:0.00 Hz     inductance : inf mH

dissregarding what i do - it's never changes. Did someone actually succeed to make this works ?!

Yordan
May 12, 2019

Log in or register to post comments

Seems like this circuit actually never worked, and the project itself is a troll project.

Please prove me wrong.

yobb99
Nov 03, 2019

Log in or register to post comments

Project works for me.  It is quite sensible for C1 and L1 components, that LC resonant circuit should oscillate to enable Arduino  making masurements.

Useus
Mar 29, 2020

Log in or register to post comments

Hi, can i use lm339 instead lm741?

Log in or register to post Comment

CR01005 Series Thick-Film Chip Resistor

The CR01005 chip resistor features a three-layer termination process with a nickel barrier

SRP0310 / SRP0315/SRP0410 / SRP0510 / SRP0610 Series Shielded Power Inductors

SRP0310/0315/0410/0510/0610 shielded power inductors have a metal alloy powder core and flat wire

TBU-RS Dual Channel TBU® High-Speed Protector Series

The TBU-RS055-300-WH is an integrated dual-channel TBU overcurrent and TVS overvoltage protector

AEC-Q200 Compliant Thick Film Chip Resistors - Model CRxxxxA Series

The model CRxxxxA AEC-Q200 compliant chip resistor series is available in eight different footprints

AVHT Series High-Temperature Varistors

AVHT high-temperature varistors offer great circuit-board layout flexibility for designers

Model SF-0603HIA-M/SF-1206HIA-M Series SMD Fuse Families

The Model SF-0603HIA-M/SF-1206HIA-M series utilize Bourns' popular multilayer ceramic design

SRP4018FA Series Power Inductors

SRP4018FA shielded power inductors are designed to meet high current density requirements

Chip LAN Transformer Module - Model SM41126EL Series

The SM41126EL Chip LAN 10/100 Base-T transformer module is ideal for use in LAN interfaces

News

Articles

Projects

Low Profile Automotive Grade Proximity Sensors with High Resolution to Prevent False Triggers in Consumer and Industrial Applications

Robust and Reliable Wi-Fi/Bluetooth/BLE Combo Chip with Next Generation WPA3 Security Standard for Smart IoT Applications

TrustAnchor100 CryptoAutomotive Security IC with Pre-Programmed Security Features for Reducing Cost and Time to Market

Compact Quad-Output SIMO Power Management IC with High Power Density for Portable Wearables, IoT Sensor Nodes, and Health Monitors

Automotive GaN FET with Integrated Driver, Protection and Active Power Management can Reduce Board Space and Improve Power Density in Automotive Applications

Important Drone Regulations That Every Drone Enthusiasts Should Be Aware of Before the First Flight

Murali Srinivasa, CEO of Lion Circuits on how their PCB Fabrications Services are set to Improve the Electronics Manufacturing Eco-system in India

ESSPOWERING the World With Energy Storage Technology

How does Successive Approximation (SAR) ADC Work and Where is it best used?

IR Decoder for Multi-Speed AC Motor Control

Measuring CO2 Concentration in Air using Arduino and MQ-135 Sensor

Designing a High Power, High Efficiency Boost Converter using TL494

Controlling a WS2812B RGB LED Matrix with Android App using Arduino and Blynk

DIY ESP32 Based Audio Player

IoT Based AC Fan Speed Control using Smart Phone with NodeMCU and Google Firebase

Connect with us on social media and stay updated with latest news, articles and projects!

Categories

Embedded Electronics

Power Electronics

Analog Electronics

Internet of Things

Audio Electronics

Electric Vehicles

Events

Popular

Robotics

555 Circuits

Arduino Projects

Raspberry Pi Projects

Electronics News

Electronics Forum

Calculators

Newsletter

Sign Up for Latest News

E-mail *

Copyright © 2020 Circuit Digest. All rights reserved.

Privacy Policy |Cookie Policy |Terms of Use |Contact Us |Advertise

News

New Products

Industry News

Articles

Product Reviews

Tech Articles

Tutorials

Interviews

Case Studies

Digi-Key Store

Cables and Wires

LED/Optoelectronics

Connectors and Interconnect

Discrete

Electromechanical

Integrated Circuits (ICs)

Embedded Computers

Enclosures, Hardware and Office

Isolators

RF and Wireless

Power and Circuit Protection

Programmers

Passives

Sensors and Transducers

Semiconductors

Test Products

Tools

Projects

555 Timer Circuits

Op-amp Circuits

Audio Circuits

Power Supply Circuits

All Electronic Circuits

Arduino Projects

Raspberry Pi Projects

MSP430 Projects

STM32 Projects

ESP8266 Projects

PIC Projects

AVR Projects

8051 Projects

ESP32 Projects

NodeMCU Projects

IoT Projects

PCB Projects

Arduino ESP8266 Projects

All Microcontroller Projects

Forum

Contact

Editorial

Advertise

About Us

More

Partner Events and Conferences

EE Calculators

<none>

Login

Register

Continue to Site >>

Sumo