Tunahan Fıtlamak
Published

Making Resistance Meter with Arduino(How to Practice Ohm Me)

How to make a resistance meter with Arduino. Make your own ohm meter

IntermediateFull instructions provided2 hours1,979
Making Resistance Meter with Arduino(How to Practice Ohm Me)

Things used in this project

Story

Read more

Schematics

Proje şeması

Şema Fritzing programı ile hazırlanmıştır.

Proje şeması

Gerilim bölücü şeması

Code

Arduino kodu

C/C++
int sayi; 
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display;  

int giris = A0;//A0 giriş olarak tanımladık

void setup()   
  {       
  pinMode(giris,INPUT);//analog girişi tanımlıyoruz 
         
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  Wire.begin();
    delay(3000);
    display.display();
    display.clearDisplay();
  }

 const unsigned char PROGMEM direnc []  =  {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xC0, 0x03, 0xFE, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
0xFF, 0x00, 0x01, 0x44, 0x3F, 0xFC, 0x02, 0x80, 0x01, 0xC4, 0x31, 0x8C, 0x02, 0x80, 0x01, 0xC4,
0x31, 0x8C, 0x03, 0x80, 0x3F, 0x44, 0x31, 0x8C, 0x03, 0xFC, 0x61, 0x44, 0x31, 0x8C, 0x02, 0x86,
0x61, 0xC4, 0x31, 0x8C, 0x02, 0x86, 0x61, 0xBB, 0xFF, 0xFF, 0xFF, 0x06, 0x60, 0x7F, 0xC0, 0x07,
0xFE, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x06,  
};

 const unsigned char PROGMEM ohm []  =  {
0x00, 0x3C, 0x00, 0x00, 0xFF, 0x00, 0x01, 0xFF, 0x80, 0x01, 0xE7, 0x80, 0x03, 0xC1, 0xC0, 0x03,
0x81, 0xC0, 0x87, 0x00, 0xE0, 0x87, 0x00, 0xE1, 0xC7, 0x00, 0xE3, 0xF7, 0x00, 0xE7, 0xFF, 0x00,
0xFF, 0x7F, 0x00, 0xFE, 
};
void loop() {  


  int okunan = analogRead(giris);//okunan analog değerini onunan değişkenine atıyoruz
  
  if(okunan == 0)
  {
    display.drawRoundRect(24, -1,77,9,4,WHITE);//drawRoundRect ( uint16_t x0 , uint16_t y0 , uint16_t w , uint16_t h , uint16_t yarıçap , uint16_t renk ); 
    //kod kafalar altındaki çizgi oluşumu
    display.setTextColor(WHITE);
    display.setTextSize(1);//yazı boyutu 1 
    display.setCursor(30,0);
    display.println("KOD KAFALAR");

      display.drawBitmap(37, 9, direnc,48,12,WHITE); //direnç simgesini gösteriyoruz 37 x başlangıç 9 y başlangıç 48 resim genişlik 12 resim yükseklik 
    
    display.setCursor(20,23);
    display.println("DIRENC TAKINIZ");
     display.display();
     display.clearDisplay();
     delay(100);
     return; //okunan değer sıfır olduğu sürece burada kalıyor
  }

  float R1 = 9980.0;//sabit direnç değerimiz 10 K
  float VT = 5.0;//vın değerimiz 5 v
  float V1 = okunan * VT / 1023; //vout değerimizi bulduk
  float R2 = (R1 * (VT - V1)) / V1;//Formulle takılan direnç değerimizi bulduk
  
  display.setTextColor(WHITE);
  display.setTextSize(1);
   display.drawRoundRect(24, -1,77,9,4,WHITE);//kod kafalar altındaki çizgi oluşumu
  display.setCursor(30,0);
  display.println("KOD KAFALAR");
  
  display.setCursor(30,10);
  display.println("R =");
  display.setCursor(51,10);
  display.println(R2);
  
  display.drawBitmap(50, 19, ohm,24,12,WHITE); //ohm simgesini göster  

  display.display();
   display.clearDisplay();
  delay(4000);
  
}

Credits

Tunahan Fıtlamak

Tunahan Fıtlamak

3 projects • 3 followers

Comments