inductance tester

arduino project 














code


#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,16,2); //change as your i2c address, here mine is 0x27


double pulse, frequency, capacitance, inductance;

void setup(){

lcd.init();

lcd.backlight();

pinMode(11, INPUT);

pinMode(13, OUTPUT);

}

void loop(){

digitalWrite(13, HIGH);

delay(5);

digitalWrite(13,LOW);

delayMicroseconds(100);

pulse = pulseIn(11,HIGH,5000);

if(pulse > 0.1){

capacitance = 1.E-6;

frequency = 1.E6/(2*pulse);

inductance = 1./(capacitance*frequency*frequency*4.*3.14159*3.14159);

inductance *= 1E6;

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Inductance!");

lcd.setCursor(0,1);

lcd.print(inductance);

lcd.setCursor(14,1);

lcd.print("uH!");

delay(10);

}

}




Previous Post Next Post

نموذج الاتصال