Comments on: How to Make an Arduino Ohm Meter Raspberry Pi, Arduino, and DIY Electronics Projects and Tutorials Mon, 22 Jan 2018 02:48:22 +0000 hourly 1 By: Panos Mon, 01 Jan 2018 21:42:27 +0000 If V out / Vin = R1 / (R1 + R2) is the right form of voltage divider equation
keeping in mind that V out is the voltage drop across your unknown resistor R2
Isn’t it better to write : V out / Vin =R2/ (R1 + R2) ?
Thank you in advance

By: Panos Tue, 26 Dec 2017 21:30:29 +0000 Hi, using a 10000 ohm as known resistor and a LED as unknown resistor
I find Rled = 4202.5 [ohm] / Vout = 3.52 [v]
aiming to verify the result I used the equation R2/R1 = (Vin/Vout) -1, and the measured resistance (Rled = 4202.5 [ohm])
I verified the measured voltage Vout = 3.52 [v].

applying voltage divider in the circuit (using an op. amplifier) gives the following equation
Vout/Vin = (R1+R2)/R1 which is different from the Vout / Vin = R1 / ( R1 + R2 ).
Where am I wrong?
P.S If the circuit is needed I can send you by email.
Thank you in advance,

By: Dante Wed, 04 Oct 2017 18:07:34 +0000 There is an interesting thing going on when you try to use 12 ohm for R1 and 1 ohm for R2. For some reason, when I connect the R2 to earth, (R1 is connected to 5V from arduino) the lcd turns off and all the power goes to R1 and it starts to heat up. As soon as I remove the ground, the lcd turns back on. I don’t know if arduino’s adc were runing while the lcd was down. Any suggestion on why this happened? This does not happens when 1k+ resistors are used.

By: chupo_cro Wed, 20 Sep 2017 23:24:36 +0000 Your expression would be right if R1 (known resistor) would be connected to Vcc and R2 (unknown resistor) would be connected to GND. But in this schematics the resistors are swapped so unknown resistor is connected to Vcc and the known one is connected to GND. You obviously connected the unknown resistor to GND so that is why you got wrong results. You can either swap the resistors or change the expression as you already did.

By: Cain Tue, 05 Sep 2017 21:27:56 +0000 I know this post is old, and correct me if I’m wrong, but isn’t the formula for a voltage divider: :

Vout / Vin = R2 / ( R1 + R2 )

And simplifies down to:

R2 = R1 / ( ( Vin / Vout ) -1 )

which would change your Arduino code from:

R2 = R1 * buffer;


R2 = R1 / buffer;

Just wanted to point this for anyone who’s calculations show errors like mine did using a 10 ohm constant (R1) and 37.6 ohm “unknown” (R2) with the above math.

By: Lucas Wed, 07 Jun 2017 14:13:50 +0000 Can I use an external 12V power supply for this type of measurement? I wanted to use Arduino to control electric windows in my car. However, the button panel operates at 12V and uses resistors to communicate which button has been pressed.

By: Saira Mon, 15 May 2017 18:53:55 +0000 Can you link how to convert this project with output on 16×2 lcd?

By: Rafac13 Thu, 11 May 2017 13:55:25 +0000 Hi oryaninbar ,

Can you post your code?

By: Circuit Basics Sat, 25 Feb 2017 16:05:19 +0000 Hi John, I just added a section to the post that explains how to output the resistance measurements to an LCD. Hope that helps…

By: Jucinaldo Araujo Wed, 30 Nov 2016 14:22:25 +0000 Thanks for sharing this.. work for me ,together with lcd i2c …tks again.

By: oryaninbar Mon, 31 Oct 2016 04:20:05 +0000 Hi, I made a 6 channel ohm meter but I am getting non consistent readings (around 2k). I tried to allow more time (5 milliseconds) between readings to allow the ADC to settle, I changed the reference resistor to closer to the measured one and I even tried to rewire the circuit but still getting fluctuating values for the same measured resistors. Im wondering if I need to implement some digital filtering (averaging a few samples, discarding peak values etc). I did notice in the screen shots the values are consistent.

Any suggestion appreciated…

By: Zhen Wang Sat, 08 Oct 2016 18:52:27 +0000 Hello. I noticed that the resistance data is not as stable as in real ohm-meter. Is there possible way to improve that?

By: bob Thu, 29 Sep 2016 00:01:31 +0000 I was trying to adapt this to read a negative earth variable resistor, common in automobiles and one wire sensors so more useful than the current circuit. my algebra is a bit rusty but change the following lines and there you go. fixed resistor is now R2.

float R1= 0;
float R2= 1000;
Serial.print(“R1: “);

By: Mr Ameamu Wed, 31 Aug 2016 00:08:34 +0000 “: How to Make an Arduino Ohm Meter #arduino #diyelectronics

By: bob Mon, 01 Aug 2016 22:21:15 +0000 thanks anyway but another kind man solved my problem. my accuracy was improved when both resistors were close in value because of the nature of the voltage divider used in the circuit.

By: Nathan W. Mon, 01 Aug 2016 21:55:54 +0000 First, check all your connections, and also verify that you have updated the sketch with the new resistance value for R1. If it still doesn’t work after that, I would conclude that you have a bad resistor or your analog pin 0 has somehow been damaged (the latter is really unlikely). A voltage divider works by sinking a portion of the voltage in the circuit back to ground. Since electricity follows the path of least resistance, the point directly before R1 is Vin (5V on this setup), after R2 is 0V (connected to ground), and between R1 and R2 is Vout (the amount not being sunk to ground by R2).

You could test to see if it’s a problem with analog pin 0 by removing R2 from the circuit. This should give you a Vout of 5V (since none of the voltage is sunk to ground), and an R2 of 0 (which is actually infinity). If this works properly, it’s probably a bad resistor that you’re trying to check, or a very big resistor, in which case you need to have a bigger R1 to get reliable values. If this doesn’t work properly, then your analog pin 0 is messed up.

If it’s your analog pin, simply moving the wire from analog pin 0 to analog pin 1, and modifying line 1 of the sketch to match your new analog pin should fix the problem. If that doesn’t fix it, then either your entire Arduino is screwed up, or it’s your connections. If it’s your connections… well, that should have been the first thing you checked!

By: Nathan W. Mon, 01 Aug 2016 21:34:18 +0000 See my comment below – it didn’t attach as a reply for some reason.

By: Nathan W. Mon, 01 Aug 2016 21:32:38 +0000 In this sketch, the value of “raw” is set by doing an analogRead of pin 0, which is connected to the wire coming out between the resistors. This value is a 10-bit analog representation of 0-5V. This means that it will be some value between 0 and 1023. To get the actual voltage value (or at least as close as we can get with a 10-bit resolution), we multiply times Vin, then divide by 1024. So, if the voltage read at pin 0 is 2.4V, it will be read into raw as 492. So with the equation:

Vout = (raw * Vin) / 1024

raw = 492, Vin = 5

Vout = (492 * 5) / 1024

Vout = 2460 / 1024

Vout = 2.40234375

The value provided is close enough to be worth using unless you need ultra-precise measurements. With the Arduino Due and Zero, you can change the analog resolution to a 12-bit number, giving you values between 0 and 4095 if you need more precision.

By: Nathan W. Mon, 01 Aug 2016 21:14:26 +0000 Actually, the original equation is:
Vout / Vin = R1 / (R1 + R2)

Cross multiply:
Vout * (R1 + R2) = R1 * Vin

Divide both sides by Vout:
R1 + R2 = (R1 * Vin) / Vout

Subtract R1 from both sides:
R2 = ((R1 * Vin) / Vout) – R1

Simplify the right side:
R2 = (Vin / Vout – 1) * R1

By: Nathan W. Mon, 01 Aug 2016 20:31:35 +0000 400 ohms is under 10% tolerance (8% to be exact) on a 5k ohm resistor. It’s likely that your resistor has a tolerance of 10-15%, and this is well within that boundary. Additionally, if your 278K resistor also has a 10% tolerance and you have not measured its resistance exactly before using it in your project, there’s a possibility that this could throw your calculations off as well.

By: pacifique Wed, 20 Jul 2016 10:40:40 +0000 hello john so to display the value of resistance into arduino ohmmeter using LCD is very simple, you need just to some kind of simple codes in your sketch so i will be helping you uploading the full sketch including printing the values in LCD so let me a bit later to do it and upload it very soon

By: jose martin saavedra crisanto Mon, 18 Jul 2016 02:35:27 +0000 muy bueno very good

By: bob Mon, 11 Jul 2016 02:09:07 +0000 i’m using 278k R1 and measuring a 5k resistor and the reading jumps up and down 400 ohms or less. what could cause this, i tried a second uno and soldering all wires.

By: Mr Ameamu Tue, 14 Jun 2016 13:29:02 +0000 “: How to Make an Arduino Ohm Meter #arduino #diyelectronics

By: dev Thu, 28 Apr 2016 09:29:49 +0000 can we use a different resistor value?

By: John Rey Fri, 04 Mar 2016 07:39:18 +0000 I mean can i display it to a LCD instead of the serial monitor?

By: John Rey Fri, 04 Mar 2016 07:37:25 +0000 Hi sir, is it possible to read the value of the resistors in a LCD? Can you make a code for it. PLease thank you

By: tamatoacoco Sun, 28 Feb 2016 15:20:19 +0000 Hi, I used your schematics to try to detect a broken resistor in my 3D printer (the one heating the plastic);
Your circuitry was tested on various resistance and all the values displayed were correct.
Then I put 2×100 kOhms resistance in series to have a 200kOhms equivalent resistance (because the printer resistance is 100 kOhms, I was told) and the values displayed were then weird : Vout=0.1 to 0.12 max and R2= several MOhms… I also tried with only one 100 kOhms resistance, same kind of values.
What can I conclude ?
Thanks in advance.

By: Alex Taylor Sat, 26 Dec 2015 16:39:45 +0000 Excellent, just what i need after a day of tinkering to sort my resistors, far easier and quicker than using my multimeter

By: Chris Sun, 22 Nov 2015 18:18:08 +0000 What exactly is raw?

By: Vincent Tseng Tue, 29 Sep 2015 17:27:51 +0000 Because the formulae is Vin/Vout = R1/(R1+R2), with some algebra, you’ll end up with R2 = (Vin/Vout – 1)*R1.

By: Nikita Fri, 14 Aug 2015 11:41:39 +0000 Why do I need to subtract 1 in line 21?