• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Hire Me | Contact | Calculators-online
You are here: Home / Arduino Projects / Digital Capacitance Meter Circuit Using Arduino

Digital Capacitance Meter Circuit Using Arduino

Last Updated on June 8, 2026 by Swagatam 4 Comments

In this post I will show how to construct a digital capacitance meter circuit using Arduino which can measure capacitance of capacitors ranging from 1 microfarad to 4000 microfarad with reasonable accuracy.

Introduction

We measure value of the capacitors when the values written on the capacitor’s body is not legible, or to find the value of the ageing capacitor in our circuit which need to be replaced soon or later and there are several other reasons to measure the capacitance.

To find the capacitance we can easily measure using a digital multimeter, but not all multimeters have capacitance measuring feature and only the expensive multimeters have this functionality.

So here is a circuit which can be constructed and used with ease.

We are focusing on capacitors with larger value from 1 microfarad to 4000 microfarad which are prone to lose its capacitance due to ageing especially electrolytic capacitors, which consist of liquid electrolyte.

Before we go into circuit details, let’s see how we can measure capacitance with Arduino.

Most Arduino capacitance meter relies on RC time constant property. So what is RC time constant?

The time constant of RC circuit can be defined as time taken for the capacitor to reach 63.2 % of the full charge. Zero volt is 0 % charge and 100% is capacitor’s full voltage charge.

The product of value of resistor in ohm and value of capacitor in farad gives Time constant.

T = R x C

T is the Time constant

By rearranging the above equation we get:

C = T/R

C is the unknown capacitance value.

T is the time constant of RC circuit which is 63.2 % of full charge capacitor.

R is a known resistance.

The Arduino can sense the voltage via analog pin and the known resistor value can be entered in the program manually.

By applying the equation C = T/R in the program we can find the unknown capacitance value.

By now you would have an idea how we can find the value of unknown capacitance.

In this post I have proposed two kinds of capacitance meter, one with LCD display and another using serial monitor.

If you are frequent user of this capacitance meter it is better go with LCD display design and if you are not frequent user better go with serial monitor design because it save you some bucks on LCD display.

Now let’s move on to circuit diagram.

Serial Monitor based capacitance meter:

As you can see the circuit is very simple just a couple of resistors are needed to find the unknown capacitance.The 1K ohm is the known resistor value and the 220 ohm resistor utilized for discharging the capacitor while measurement process takes place.

The Arduino sense the rising and decreasing voltage on pin A0 which is connected between 1K ohm and 220 ohm resistors.Please take care of the polarity if you are using polarized capacitors such as electrolytic.

Program Code

//-----------------Program developed by R.Girish (Optimized)------------------//
const int analogPin = A0;
const int chargePin = 7;
const int dischargePin = 6;
float resistorValue = 1000.0; // Fixed missing semicolon and added .0 for float

unsigned long startTime;
unsigned long elapsedTime;
float microFarads;

void setup()
{
  Serial.begin(9600);
  pinMode(chargePin, OUTPUT);
  digitalWrite(chargePin, LOW);
  
  Serial.println("Capacitance Meter Initialized.");
}

void loop()
{
  // 1. Ensure capacitor is completely discharged first
  pinMode(dischargePin, OUTPUT);
  digitalWrite(dischargePin, LOW);
  while(analogRead(analogPin) > 0) {
    // Wait until voltage drops to 0
  }
  pinMode(dischargePin, INPUT); // Set to high-impedance state

  // 2. Start charging
  digitalWrite(chargePin, HIGH);
  startTime = micros(); // Switched to micros() for high accuracy

  // 3. Wait until capacitor reaches 63.2% of 5V (ADC value 648)
  // Added a 3-second safety timeout to prevent permanent freezing
  while((analogRead(analogPin) < 648) && (micros() - startTime < 3000000)) {
    // Block until charged or timeout reached
  }
  
  elapsedTime = micros() - startTime;

  // 4. Calculate capacitance
  // Convert microseconds to seconds, then to microFarads:
  // Farads = seconds / R -> microFarads = (micros / 1,000,000) / R * 1,000,000
  // The 1,000,000 cancel out completely!
  microFarads = (float)elapsedTime / resistorValue;

  // 5. Display output
  if (elapsedTime < 2900000 && microFarads > 0.1)
  {
    Serial.print("Value = ");
    Serial.print(microFarads, 2); // Print with 2 decimal places
    Serial.println(" microFarads");
    
    Serial.print("Elapsed Time = ");
    Serial.print(elapsedTime / 1000.0); // Show in mS
    Serial.println(" mS");
    Serial.println("--------------------------------");
    delay(1000); // Wait before the next reading
  }
  else
  {
    Serial.println("Please insert or check Cap connection...");
    delay(1000);
  }

  // 6. Turn off charging pin
  digitalWrite(chargePin, LOW);
}
//-----------------Program developed by R.Girish------------------//

Upload the above code to Arduino with completed hardware setup, initially don’t connect the capacitor. Open the serial monitor; it says “Please connect capacitor”.

Now connect a capacitor, its capacitance will be displayed as illustrated below.

It also shows the time taken to reach 63.2% of the capacitor’s full charge voltage, which is shown as elapsed time.

Digital Capacitance Meter Using Arduino

Circuit diagram for LCD based capacitance meter:

The above schematic is connection between LCD display and Arduino. The 10K potentiometer is provided for adjusting the contrast of the display. Rest of the connections are self-explanatory.

The above circuit is exactly same as serial monitor based design; you just need to connect LCD display.

Program for LCD based capacitance meter:

//-----------------Program developed by R.Girish (Optimized with LCD)------------------//
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int analogPin = A0;
const int chargePin = 7;
const int dischargePin = 6;
float resistorValue = 1000.0; // Known resistor value in Ohms

unsigned long startTime;
unsigned long elapsedTime;
float microFarads;
bool lastStateConnected = true; // Tracks state changes to prevent LCD flickering

void setup()
{
  Serial.begin(9600);
  lcd.begin(16, 2);
  
  pinMode(chargePin, OUTPUT);
  digitalWrite(chargePin, LOW);
  
  lcd.print("  CAPACITANCE");
  lcd.setCursor(0, 1);
  lcd.print("     METER");
  delay(2000);
  lcd.clear();
}

void loop()
{
  // 1. Discharge the capacitor completely first
  pinMode(dischargePin, OUTPUT);
  digitalWrite(dischargePin, LOW);
  while(analogRead(analogPin) > 0) {
    // Wait until voltage drops to 0V
  }
  pinMode(dischargePin, INPUT); // Put discharge pin in high-impedance mode

  // 2. Start charging phase
  digitalWrite(chargePin, HIGH);
  startTime = micros(); // Switched to micros() for high accuracy

  // 3. Wait for 63.2% charge (ADC value 648) with a 2-second timeout guard
  while((analogRead(analogPin) < 648) && (micros() - startTime < 2000000)) {
    // Block until charged or timeout reached
  }
  
  elapsedTime = micros() - startTime;
  digitalWrite(chargePin, LOW); // Stop charging

  // 4. Calculate capacitance 
  // (micros / 1,000,000) / R * 1,000,000 simplified out:
  microFarads = (float)elapsedTime / resistorValue;

  // 5. Intelligent LCD Output (No flickering)
  if (elapsedTime < 1900000 && microFarads > 0.1)
  {
    lcd.setCursor(0, 0);
    lcd.print("Value = ");
    lcd.print(microFarads, 1); // Prints with 1 decimal place precision
    lcd.print(" uF    ");      // Extra spaces clear out old characters
    
    lcd.setCursor(0, 1);
    lcd.print("Time  = ");
    lcd.print(elapsedTime / 1000.0, 1);
    lcd.print(" mS    ");
    
    lastStateConnected = true;
    delay(500); // Hold reading on screen for a moment
  }
  else
  {
    // Only redraw the screen if it wasn't already showing the error
    if (lastStateConnected) {
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Please connect");
      lcd.setCursor(0, 1);
      lcd.print("capacitor !!!");
      lastStateConnected = false;
    }
    delay(200); 
  }
}
//-----------------Program developed by R.Girish------------------//

With the completed hardware setup upload the above code. Initially don’t connect the capacitor. The display shows “Please connect capacitor!!!” now you connect the capacitor. The display will show the capacitor’s value and elapsed time taken to reach 63.2% of full charge capacitor.

Author’s Prototype:

You'll also like:

  • pindetailsArduino LCD KeyPad Shield (SKU: DFR0009) Datasheet
  • arduino photoIntroduction to EEPROM in Arduino
  • amplifier power meter circuit 1Make this Amplifier Power Meter Circuit
  • music light4 Simple VU Meter Circuits Explained

Filed Under: Arduino Projects, Meters and Testers Tagged With: Arduino, Capacitance, Digital, Meter

About Swagatam

I am an electronics engineer and doing practical hands-on work from more than 15 years now. Building real circuits, testing them and also making PCB layouts by myself. I really love doing all these things like inventing something new, designing electronics and also helping other people like hobby guys who want to make their own cool circuits at home.

And that is the main reason why I started this website homemade-circuits.com, to share different types of circuit ideas..

If you are having any kind of doubt or question related to circuits then just write down your question in the comment box below, I am like always checking, so I guarantee I will reply you for sure!



Previous Post: « Arduino Tachometer Circuit for Precise Readings
Next Post: How to Control Servo Motor Using Joystick »

Reader Interactions

Comments

Madina Shanu says:
August 17, 2017 at 9:13 am

to u and yr family.
Sr i want to glow up 7000 to 8000 leds with 220 v ac and want them just blinking.
Kindly guide and help me giving a appropriate ckt.

Thanks and best regards in advance

Reply
Swagatam says:
August 17, 2017 at 2:52 pm

Madina, you can use the designs shown in the following link and connect LEDs in series and parallel at the points where the word load is specified..each series string should have 93 LEDs in series with a 1K/2 watt resistor

https://www.homemade-circuits.com/2013/07/simple-triac-timer-circuit.html

Reply
Shahan Shah Gsm says:
August 16, 2017 at 6:45 am

Hello sir can u send .net a circuit .of wifi in which range is 3 km

Reply
Swagatam says:
August 17, 2017 at 2:11 am

if it's possible we'll try to update it

Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

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

Primary Sidebar



My Youtube Channel

Circuit Simulator

circuit simulator image



Subscribe to get New Circuits in your Email



Categories

  • Arduino Projects (95)
  • Audio and Amplifier Projects (134)
  • Automation Projects (18)
  • Automobile Electronics (103)
  • Battery Charger Circuits (88)
  • Datasheets and Components (109)
  • Electronics Theory (148)
  • Energy from Magnets (27)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (20)
  • Health related Projects (27)
  • Home Electrical Circuits (13)
  • Indicator Circuits (16)
  • Inverter Circuits (100)
  • Lamps and Lights (162)
  • Meters and Testers (72)
  • Mini Projects (28)
  • Motor Controller (69)
  • Oscillator Circuits (28)
  • Pets and Pests (15)
  • Power Supply Circuits (91)
  • Remote Control Circuits (50)
  • Renewable Energy (12)
  • Security and Alarm (65)
  • Sensors and Detectors (107)
  • SMPS and Converters (45)
  • Solar Controller Circuits (60)
  • Temperature Controllers (43)
  • Timer and Delay Relay (50)
  • Voltage Control and Protection (44)
  • Water Controller (37)
  • Wireless Circuits (31)



Other Links

  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

People also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |



Recent Comments

  • Swagatam on Make this Solar Powered Fence Charger Circuit
  • Nitesh on Make this Solar Powered Fence Charger Circuit
  • Swagatam on High Voltage, High Current DC Regulator Circuit
  • Francis Adamu on High Voltage, High Current DC Regulator Circuit
  • Swagatam on Control a Relay ON OFF Using SIM Card, Mobile Phone, and Arduino

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Stack Exchange
  • Linkedin

© 2026 · Swagatam Innovations