Project showcase
Simple Capacitance Meter

Simple Capacitance Meter © GPL3+

Easy DIY method to test capacitors.

  • 3,640 views
  • 3 comments
  • 24 respects

Components and supplies

Apps and online services

About this project

The Project

This tool is used to test capacitors. It is really easy to make, as only additional hardware needed (besides the capacitor that will be tested) is 2x220ohm resistors. The basic scheme is this:

Shield

I also made a shield that makes things easier, but it is heavily improvised and is not a recommended way to make one.

Connections

I will not provide explanation on how to make this one, as its made very poorly. Here I used 222ohm 3W resistors because they have more rigid legs then 1/4W resistors do, they are used to connect to the Arduino pins, do not do this, rather use a male header with extra long pins. I added a button to only momentarily measure capacitance, there is no need for it to be done constantly, even when the capacitor is not inserted. (Full schematic posted below)

The data is fed to the computer over serial terminal:

Here we can also add a LCD display and a battery, put it in a case and make it portable. This project was done because most cheaper multimeters do not have this feature implemented, so this is a cheap and simple solution to the problem.

Code

Arduino codeC/C++
#define analogPin      A1 //Our pin for measuring
#define chargePin      3 //Pin for charging the cap
#define dischargePin   7 //Pin for discharging the cap
#define button 5 //Our button read pin
#define resistorValue  220.0F //Our charge resistor value. The f is there to tell the compiler it's a float

unsigned long startTime; //Used for
unsigned long elapsedTime; //measuring cap charge time
float microFarads; //Here we store the meausred value
float nanoFarads; //If it's small we convert it to nF

void setup(){
  pinMode(chargePin, OUTPUT);/*
  This sets the internal impendence of the chargePin to low. What this means
  is that the current will come to less resistance when passing trough the
  pin, wich will enable us to source(charge the cap) or sink(discharge the 
  cap) with current up to 40mA. If we set the pinMode to input, we enable
  high impendence mode and the current will be bearly able to pass trough 
  the pin, we use it to "open" the ciruit (alltough the current will still
  flow trough the pins, the equivalent wouldnt be an open circut, reather
  a very big value resistor).
  */
  digitalWrite(chargePin, LOW); //In LOW state it doesnt discharge the cap
  pinMode(button, INPUT_PULLUP); /*We use INPUT_PULLUP when we have a button connected to the
  pin, but without a external pullup resistor. We must have a either pull-up or pull-down
  resistor to keep the pins from "floating", a state where pins will catch surrounding ele-
  ctromagnetic fields, or get parasitic capactinance from sorrounding pins. MCU's have allready
  built in pull up resostors we only need to connect the switch between the pin and ground.
  */
  Serial.begin(9600); //Start the serial communication
}

void loop(){
  if(!digitalRead(button)){ //When we press the button
  digitalWrite(chargePin, HIGH); //This charges the capacitor
  startTime = millis(); //The time when the cap starts to charge
  while(analogRead(analogPin) < 648); //Do dothing until the cap reached 63% charge
  elapsedTime= millis() - startTime; // Calculate the time needed to charge the cap
  microFarads = ((float)elapsedTime / resistorValue) * 1000; //This is the formula for measuring capactiance
  if (microFarads > 1){ //If the value is in uF
    Serial.print((long)microFarads); //Print the stored value
    Serial.println(" microFarads");
  }
  else{ //If smaller, we convert it to mF
    nanoFarads = microFarads * 1000.0;
    Serial.print((long)nanoFarads);
    Serial.println(" nanoFarads");
  }
  digitalWrite(chargePin, LOW);//We do not charge the cap anymore
  pinMode(dischargePin, OUTPUT); //Now we use 
  digitalWrite(dischargePin, LOW); //this pin for discharging
  while(analogRead(analogPin) > 0); //Do nothing until the cap is discharged
  pinMode(dischargePin, INPUT); //This "blocks" the discharge pin, as it is no longer needed
 delay(150); //Delay so there is enough time to lift the finger from the button
 }
}

Schematics

Schematic
Capmet clgy3jvcyn
Breadboard schematic
Capmet bb tx0ueaoxx2
Schematic
For fritzing
capmet_AVYoPct8Gw.fzz

Comments

Similar projects you might like

Simple Programmable Robotic Arm

Project showcase by Ryan Chan

  • 49,015 views
  • 63 comments
  • 145 respects

Snap Circuits® - Snapino Capacitance Meter

Project showcase by Daniel Porrey

  • 1,043 views
  • 2 comments
  • 5 respects

Simple Arduino Digital Clock Without RTC

Project in progress by Annlee Fores

  • 98,431 views
  • 24 comments
  • 88 respects

Arduino Simple "Camera Slider" Electronics

Project tutorial by Ian Cumming

  • 6,273 views
  • 3 comments
  • 17 respects

Simple Arduino Optical Chopper

Project tutorial by Brendan Sweeny

  • 2,043 views
  • 0 comments
  • 4 respects
Add projectSign up / Login