hIOTron
Created May 12, 2020 © GPL3+

Arduino Capacitance Meter

We have a cost-effective capacitance meter to measure capacitance using Arduino.

Arduino Capacitance Meter

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
555 timer IC
×1
IC 74HC14 Schmitt trigger gate
×1
Resistor 1k ohm
Resistor 1k ohm
×2
Resistor 10k ohm
Resistor 10k ohm
×1
Capacitor 100 nF
Capacitor 100 nF
×1
Capacitor 1000 µF
Capacitor 1000 µF
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Run a program

Arduino
#include <LiquidCrystal.h>

LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

int32_t Htime;                    
int32_t Ltime;
float Ttime;
float frequency;
float capacitance;

void setup()
{
    pinMode(8,INPUT);            //pin 8 as signal input
    lcd.begin(16, 2);
    lcd.setCursor(0,0);
    lcd.print("capacitance =");
}
void loop()
{
    for (int i=0;i<5;i++)        //measure time duration five times
    {
        Ltime=(pulseIn(8,HIGH)+Ltime)/2;        //get average for each cycle
        Htime=(pulseIn(8,LOW)+Htime)/2;
    }

    Ttime = Htime+Ltime;
    frequency=1000000/Ttime;
    
    capacitance = (1.44*1000000000)/(20800*frequency);   //calculating the Capacitance in nF
    lcd.setCursor(0,1);
    lcd.print(capacitance);
    lcd.print(" nF   ");
    delay(500);
}

Credits

hIOTron

hIOTron

78 projects • 2 followers
hIOTron is an internet of things based company that offers an IoT Platform, products, IoT Solutions, and IoT Training.

Comments