I am new to Arduino, and I am trying to make an ohmmeter. However, I will be able to conduct my project more efficiently if I can measure the resistance of multiple materials at a time using only one Arduino board.
Is there any way to do this?
I bought an Arduino shield (the input output Arduino shield) - is that the right way to go for this project?
Hope to get a response soon! :)...and happy new year!
If you only have one resistor then you can not use the Arduino to measure its resistance.
You need a resistor from the analog input to 5V and then your unknown resistor from the analog input to ground. Then by measuring the voltage you can calculate the unknown resistor value.
//This is the code to make the arduino function as an ohmmeter
//This code will display the voltage that drops across the unknown resistor //along with its resistance
int analogPin= 0;
int raw= 0;
int Vin= 5;
float Vout= 0;
float R1= 1000;
float R2= 0;
float buffer= 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
raw= analogRead(analogPin);
if(raw)
{
buffer= raw * Vin;
Vout= (buffer)/1024.0;
buffer= (Vin/Vout) -1;
R2= R1 * buffer;
Serial.print("Vout: ");
Serial.println(Vout);
Serial.print("R2: ");
Serial.println(R2);
delay(1000);
}
}