meworkstelugu
Published © CC BY

Making ohm meter using Arduino and 16*2 LCD

Arduino based ohm metre will help to know unknown resistor values

IntermediateProtip2,598
Making ohm meter using Arduino and 16*2 LCD

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
RGB LCD Shield Kit, 16x2 Character Display
RGB LCD Shield Kit, 16x2 Character Display
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Solderless Breadboard Full Size
Solderless Breadboard Full Size
×1

Story

Read more

Schematics

ARDUINO OHM METER CIRCUIT DIAGRAM :

Code

ARDUINO OHM METER

C/C++
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int analogPin = A0;
int raw = 0;
int Vin = 5;
float Vout = 0;
float R1 = 950; // value of 1k resistor
float R2 = 0;
float buffer = 0;

void setup(){
    lcd.begin();
    lcd.setCursor(0, 0);
    lcd.print("Resistance Meter");
}

void loop(){
  raw = analogRead(analogPin);
   if(raw==0){lcd.setCursor(0, 1);
   
    lcd.print("      Open      ");}
  if(raw){
    buffer = raw * Vin;
    Vout = (buffer)/1023.0;
    buffer = (Vin/Vout) - 1;
    R2 = R1 * buffer;
    lcd.setCursor(3, 1);
    if(R2>999.99){
    lcd.print(R2/950);
    lcd.print(" K Ohm  ");
    }else{
    lcd.setCursor(3, 1);
    lcd.print(R2);
    lcd.print(" Ohm   ");
      }
    delay(1000);
  }
}

Credits

meworkstelugu

meworkstelugu

2 projects • 0 followers

Comments