Simple Arduino Capacitance Meter
Description:This is a device to measure the capacitance.It is constructed using the arduino bord.It just consist of a fixed resistor and a capacitor whose value is to be measured.Its practical measuring range is limited to 200nF to 300uF due to various reasons.
Principle of working:
Its principle is very simple.The capacitor shown in the figure is is fully charged and then allow to discharge through the resistor of fixed resistance.The discharging equation is given by

Construction:
The pin 1 is connected to digital pin 7(d7),of the arduino.And the pin 2 is connected to the analog pin A0 (a0)in arduino.First we need to charge the capacitor fully.So configure d7 as output and give a high voltage,configure a0 as output and give a high voltage.Give a delay time to charge the capacitor fully.After the delay make d7 low and configure a0 as analog input.The capacitor will immediately start discharging and the reading will be measuring in a0.Start the inbuilt timer to calculate the running time.After the capacitor voltage decrease to certain value say 2v, stop the timer and calculate the time.At first time we should be knowing the capacitor value.Using this data the
Cunknown=(Time taken for unknown X known capacitance) /(Time taken for the known capacitor);
Use the lcd to display the output.For very smaller value of capacitors the dischage time will be in nanoseconds.So we are ending up with more error.By choosing the resistance of higher value the range can be increased.
arduino code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
TCCR1B=0x00; //stop timer
TCCR1A = 0x00; //normal timer mode
TCNT1=0x00;//initial value of the timer
pinMode(7,OUTPUT);
digitalWrite(7,HIGH);
pinMode(0,OUTPUT);
analogWrite(0,255);
delay(3000);//charging the capacitor
digitalWrite(7,LOW);//start discharging
pinMode(0,INPUT);
TCCR1B = 0xC3;//start timer
int x;
while(1)//wait in the loop until cap discharge to 2.5 volts.
{
x=analogRead(0);
if(x<=410)break;
}
TCCR1B=0x00; //stop timer
long k;
k=TCNT1;//final value in the timer
double c;
c=(10000*k/2348);// for 10000 nF it took k=2348.
lcd.begin(16, 2);//start timer (clock prescaler /64)
if (c<1000) {lcd.print(c); lcd.print(" nanoF");}
else {lcd.print(c/1000.0); lcd.print(" microF");}
}
void loop()
{
}
Implementation In LabView
If u have any suggestion in improving this please feel free to comment.
Have fun....
Team members:
Dheeraj kumar C.
Kumar bharath
Darshan ramakant.