Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Making of an ohmmeter using an Arduino Uno

Introduction

Generally, we calculate the resistance of the resistor by multimeter or by calculating traditionally


from its color code. But it is a little difficult task to calculate using the color codes. Let us make it
simple and complete the task of finding resistance in just a few seconds using a microcontroller.
Here we have used arduino uno in this article.

What is an ohmmeter?

An ohmmeter is a device that is used to measure the resistance of the component between two
terminals. Generally, we use it for measuring the resistance of a resistor.

It is important for a circuit designer to have an ohmmeter so we can make use of arduino uno and
arduino IDE to know the resistance of the resistor in a few minutes.

The ohmmeter prepared by us works on the principle of voltage dividing rule. Voltage dividing rule is
nothing but a derivative from the Kirchhoff's voltage law.

What is Kirchoff’s Voltage Law?

Kirchoff’s Voltage Law states that the algebraic sum of the voltage drop across the various
components in the loop is equaled to zero.

Here to understand the working of the ohmmeter using the Arduino you need to know about the
Analog to digital conversion.

Arduino Uno contains 10-bit analog to digital converter. And we know that the digital output of the
arduino is 5 volts. 210=1024 that can also be written as 1k in the binary system.

So in order to convert the read analog value into the digital value. We can say that 10 bits equal to
the 5 volts. That can also be understood as 1024=5volts.

Now, We can calculate the voltage from the read analog value.
1024 corresponds to 5 volts

X (analog) corresponds to V volts

By cross multiplication rule,

V=5*X/1024

Therefore we can convert the read analog value by the arduino analog pin to the digital volts.

*** This conversion of analog values to digital values id called as AD conversion and done by using
ADC(Analog to Digital Converter).

We need to know the voltage dividing rule for making this project

For 2 resistors in series of resistances R1, R2 respectively applied by a V voltage then the voltage
across the second resistor V2 will be given by the below formula

V2=V*(R2/R1+R2)

This can be better understood by the below figure

Now we will use the same principle in making the ohmmeter by taking the V and R 1 values as
constant then by varying the R 2 we get different V2 values and that can be used to find the R 2 value
(Unknown Resistance).

For Example

Let us fix the V value as the 5V as generally the output of the arduino uno is 5V ( You can use
different values like 3.3V also).

And we will also fix the R1 value by a constant resistor let’s say 1kohm then

V2=5*(R2/1K+R2)
Hence we can calculate R2 by solving the above equation R2=((V2*1)/(5-V2)).

Thus we can find the resistance of the unknown resistor using the above equation.

Components required

 Arduino Uno and its power cable.


 1K resistor
 3 male to male jumper wires.
 Bread Board.
 Unknown resistance resistos whose value is to be determined.

Circuit Diagram

Construction of the circuit :

Connect the 5V pin to the known resistor and connect another end of the resistor to the A0 pin or
any Analog pin as per your comfort and need.

Now attach one more Resistor whose value is to be determined in series with the first resistor and
then attach to the ground pin as shown in the figure. Then write the below code in the arduino IDE
and upload it into the Arduino and Open the serial monitor.

When you open the serial monitor you can find the resistance value is displayed on the screen every
5 seconds.

Explanation of the code:


First, we declare the variable Vout, resistance of data type double as the resistance and the Vout can
be decimal points.

double vout;

double Resistance;

Then we begin the serial communication in the setup.

void setup()

Serial.begin(9600);

Now read the value of the voltage at the junction by the analog value by the command analogRead
and determine the analog value.

vout=analogRead(A0)*0.00488;

Then apply A2D converting formula and convert it to the digital value. At last, apply the voltage
divider formula explained earlier and print the value of resistance on the serial monitor.

Resistance=((vout*1)/(5-vout));

Serial.println(analogRead(A0));

Serial.println(Resistance);

Serial.println(vout);

Code
//Ohm meter code by ashutosh katkam

double vout;

double Resistance;

void setup()

Serial.begin(9600);//Begin the serial communication by the baud rate 9600

void loop()

vout=analogRead(A0)*0.00488;//(5/1024 is 0.00488)

Resistance=((vout*1)/(5-vout));//Resistance value is from the voltage dividing formula.

Serial.println(analogRead(A0));

Serial.println(Resistance);

Serial.println(vout);

delay(5000);//To give output after every 5 seconds

Output:
Here we got the outputs on the serial monitor

1. Analog value at the resistor R2.

2. Resistance of unknown resistor in Kilo ohms.

3. Analog to digital converted value.

You might also like