Arduino Ohmmeter. How to make?

Programming, Tutorial, Coding, New Design, and/or any project for your Arduino and Raspberry Pi can post your topic /suggestion here.
User avatar
Diy
Admin
Admin
Contact:
Location: Philippines
Posts: 185
Joined: Sat Apr 23, 2016 10:32 pm

Arduino Ohmmeter. How to make?

Sat Mar 03, 2018 10:32 am

Arduino Ohmmeter

In this tutorial we will be making a simple, but quite accurate Arduino ohmmeter. This project requires only a few components: an Arduino development board, a breadboard, 3 jumper wires and a few resistors. This project is based on a voltage divider.

Here is our Wiring diagram:
arduino ohmmeter_mini.png
And Here is our Source Code:
arduino_ohmmeter.zip
(843 Bytes) Downloaded 27 times

Code: Select all

const int sensorPin = A0;  // Analog input pin that senses Vout
int sensorValue = 0;       // sensorPin default value
float Vin = 5;             // Input voltage
float Vout = 0;            // Vout default value
float Rref = 999;          // Reference resistor's value in ohms (you can give this value in kiloohms or megaohms - the resistance of the tested resistor will be given in the same units)
float R = 0;               // Tested resistors default value

void setup ()
{
  Serial.begin(9600);      // Initialize serial communications at 9600 bps
}

void loop ()
{
  sensorValue = analogRead(sensorPin);  // Read Vout on analog input pin A0 (Arduino can sense from 0-1023, 1023 is 5V)
  Vout = (Vin * sensorValue) / 1023;    // Convert Vout to volts
  R = Rref * (1 / ((Vin / Vout) - 1));  // Formula to calculate tested resistor's value
  Serial.print("R: ");                  
  Serial.println(R);                    // Give calculated resistance in Serial Monitor
  delay(1000);                          // Delay in milliseconds between reeds
}


Return to “ARDUINO AND RASPBERRY PI”

Links

In total there are 9 users online :: 1 registered, 0 hidden and 8 guests
Registered users: Bing [Bot]
Most users ever online was 156 on Sun Jun 17, 2018 7:42 am
Total posts 439
Total topics 318
Total members 62
Our newest member anonymous-kali
No birthdays today