Mirko Pavleski
Published © GPL3+

DIY Simple Autorange Capacitance Meter (10pF-10000microF)

Inexpensive, precision, autorange capacitance meter with a large range.

BeginnerFull instructions provided27,628
DIY Simple Autorange Capacitance Meter (10pF-10000microF)

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Resistor 1M ohm
Resistor 1M ohm
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Schematic

Code

Arduino code

C/C++
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);// RS,E,D4,D5,D6,D7
void setup(){
  lcd.begin(16, 2);// LCD 16X2
  pinMode(A0,INPUT);
}
unsigned long time0,time1,time2; 
float c,null0;
byte kn,mk,i;

void loop(){ 
  lcd.setCursor(15,0); 
  lcd.print("*");
  if(mk==0){
    pinMode(8,OUTPUT);
    pinMode(7,INPUT);
    digitalWrite(8,HIGH);
  }

  if(mk==1){
    pinMode(7,OUTPUT);
    pinMode(8,INPUT);
    digitalWrite(7,HIGH);
  }

  time0=micros();
  while(analogRead(A0)<644){
    time2=micros()-time0;
    if(time2>=1000000 && mk==0){
      mk=1;
      time0=100000000;
      break;
    }
  }

  time1=micros()-time0; 

  while(analogRead(A0)>0){ 
    pinMode(7,OUTPUT); 
    pinMode(8,OUTPUT); 
    digitalWrite(7,LOW); 
    digitalWrite(8,LOW);
  }

  if(mk==1&&time1<1000){
    mk=0;
  }

  lcd.setCursor(1,0);
  c=time1;
  c=c/1000-null0;
  c=abs(c);

  if(time1>=10000000){
    lcd.setCursor(1,0);
    lcd.print(" TEST uF   "); 
  }
  else{
    lcd.print(c); 

    if(mk==0){
      lcd.print(" nF       ");
    }
    if(mk==1){
      lcd.print(" uF       ");
    }
  }
  if(i==0){
    i++;
    null0=c+0.02;
  }
  delay(100);
}

Credits

Mirko Pavleski

Mirko Pavleski

143 projects • 1248 followers

Comments