hIOTron
Created January 14, 2020 © GPL3+

Arduino Ohm Meter

The main principle behind this is the voltage divider network. The value of the unknown resistance is displayed on the 16*2 LCD display.

Arduino Ohm Meter

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
16*2 LCD display
×1
Multi-Turn Precision Potentiometer- 1k ohms (25 Turn)
Multi-Turn Precision Potentiometer- 1k ohms (25 Turn)
×1
Breadboard (generic)
Breadboard (generic)
×1
Resistor 100 ohm
Resistor 100 ohm
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Story

Read more

Code

Run a program

Arduino
#include<LiquidCrystal.h>

LiquidCrystal lcd(2,3,4,5,6,7);   //rs,e,d4,d5,d6,d7

int Vin=5;        //voltage at 5V pin of arduino
float Vout=0;     //voltage at A0 pin of arduino
float R1=3300;    //value of known resistance
float R2=0;       //value of unknown resistance
int a2d_data=0;    
float buffer=0;            

void setup() 
{
 lcd.begin(16,2);
}

void loop()
{
  a2d_data=analogRead(A0);
  if(a2d_data)
  {
    buffer=a2d_data*Vin;
    Vout=(buffer)/1024.0;
    buffer=Vout/(Vin-Vout); 
    R2=R1*buffer;

    lcd.setCursor(4,0);
    lcd.print("ohm meter");

    lcd.setCursor(0,1);
    lcd.print("R (ohm) = ");
    lcd.print(R2);
    
    delay(1000);
  }
}

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