Introduction: Arduino - 10 Ohm -- 1000 K Ohm – User Selectable Ohm Meter

Abstract

The Arduino inbuilt 10 bit ADC, can be used for constructing / measuring the 10 Ohm to 1000 K Ohm user selectable Digital Ohm Meter. The 16x2 LCD display driver, connected with Arduino Uno will be used for displaying the measured resistance. The AD680 bandgap voltage reference, that provides a fixed 2.5 Volt output, is used as potential divider reference voltage.

Parts and components

Arduino Uno board

16x2 LCD = 1 No

1K Potentiometer = 1 No

4 Way, 2 Pole Rotary switch = 1 No

Resistor 10 K = 4

Nos Resistor 1.5 K = 1 No

Resistor 15 K = 1 No

Resistor 150 K = 1 No

Resistor 1.5 M = 1 No

AD680 2.5 Volt bandgap voltage reference = 1 No

Capacitor 100nF = 1 No

Capacitor 1nF = 1 No

Step 1: Schematic

The 16x2 is very common type LCD, with two rows, and each row displays 16 characters of either 5x7 or 5x8 dot matrix characters.

The LCD is available in a 16 pin package. It consists of back light and contrast adjustment function and each dot matrix has 5×8 dot resolution.

The 16x2 LCD display is connected to the Arduino (13, 12, 11,10,9 and 8) digital IO pins, where LCD operates at 4 bit data mode.

If the display is not visible, adjust the Contrast pot (1K), to make it visible.

A Rotary switch operates by rotation of its spindle / shaft. Rotary switches are chosen when more than 2 positions are needed.

A four way, two pole rotary switch used for this design. One pole is connected to the voltage divider network and then A0 analog input pin of Arduino.

And another pole is connected to 6,5,4 and 3 Digital IO pins, used for selecting the Ohm Meter range.

Voltage divider circuit is used to divide voltage into two parts (measurement and drop).

Internal Vref (1100 mV) of Arduino is selected for measurement.

AD680 2.5 Volt bandgap reference voltage generator is fed to the potential divider for accurate resistance measurement.

ADC Resolution = Vref / (1024 -1).

ADC Resolution = 1.1 V / 1023 = 1100mV / 1023 = 1.075 mV.

Step 2: Potential Divider

Where

Rx is unknown resistance value

R1 is known resistance value

Vx is measured ADC value

V is reference voltage divider to potential divider

If V is 2.5 Volt, ADC reference voltage is 1.1 volt, ADC resolution is 10 bits, then

ADC equivalent value for V is (2.5 * 1024) / 1.1 = 2327.27. The software uses this value for calculating / measuring the resistance.

1K Ohm Scale

From potential divider (R8:Rx)(1500ohm and 1000 Ohm), 0 to 1 Volt measurement voltage is fed to A0 analog input.

If Vx is 1 Volt then Vmeasurment = 1.0 V = 1000 mV = 1000 Ohm.

Ohm meter Resolution = (1.1 / 1023) 1000 Ohm = 1.075 ohm.

10 K Ohm Scale

From potential divider (R2:Rx) (15K ohm and 10K Ohm), 0 to 1 Volt measurement voltage is fed to A0 analog input.

If Vx is 1 Volt then Vmeasurment = 1.0 V = 1000 mV = 10K Ohm.

Ohm meter Resolution = (1.1 / 1023) 10K Ohm = 10.75 ohm.

100 K Ohm Scale

From potential divider (R3:Rx) (150K ohm and 100K Ohm), 0 to 1 Volt measurement voltage is fed to A0 analog input.

If Vx is 1 Volt then Vmeasurment = 1.0 V = 1000 mV = 100K Ohm.

Ohm meter Resolution = (1.1 / 1023) 100K Ohm = 100.75 ohm.

1000 K Ohm Scale

From potential divider (R4:Rx) (1.5M ohm and 1M Ohm), 0 to 1 Volt measurement voltage is fed to A0 analog input.

If Vx is 1 Volt then Vmeasurment = 1.0 V = 1000 mV = 1000K Ohm.

Ohm meter Resolution = (1.1 / 1023) 1000K Ohm = 1000.75 ohm.

Step 3: Software

The Arduino LiquidCrystal library is used for displaying the measured resistance at 16x2 LCD.

The 1.1V internal reference is chosen for the ADC.

The voltage divider will, provide the input voltage between 0 to 1000mV. Hence the software will measure and display the values between 0 Ohms to 1000K Ohm, in accordance with the Scale selection.

Sine 4 way 2 pole rotary switch is used, the Scale selection and voltage divider selection happens in parallel.

Initially the software will display the “Ohm meter” for about one second.

If over resistance is connected, the software will display the over resistance indication too (> 1K Ohm, > 10K Ohm, > 100K Ohm, > 1000K Ohm).

The resistance value is calculated with the above said equation, by applying the constant resistance and constant reference voltage.

Every 500 mSec the ADC is polled and displays the new reading.

// Experiment of measuring 0 Ohm - 1000K Ohm resistance measurement
// Display it on a 16x2 LCD

// The Arduino circuit connection for LCD: // LCD RS pin to digital pin 13 // LCD Enable pin to digital pin 12 // LCD D4 pin to digital pin 11 // LCD D5 pin to digital pin 10 // LCD D6 pin to digital pin 9 // LCD D7 pin to digital pin 8

// The Arduino circuit connection for the scale // Rotary pin for 1K Ohm scale is connected pin 3 of digital IO // Rotary pin for 10K Ohm scale is connected pin 4 of digital IO // Rotary pin for 100K Ohm scale is connected pin 5 of digital IO // Rotary pin for 1000K Ohm scale is connected pin 6 of digital IO

// Analog pin A0 is connected to the potential divider

// Name:- M.Pugazhendi // Date:- 26thJul2016 // Version:- V0.1 // e-mail:- muthuswamy.pugazhendi@gmail.com

// include the library code: #include <LiquidCrystal.h>

//initialize the library with the numbers of the interface pins LiquidCrystal lcd(13,12,11,10,9,8);

// Arduino pins used for the switches #define S1 6 #define S2 5 #define S3 4 #define S4 3

// State of each switch (0 or 1) int s1_state; int s2_state; int s3_state; int s4_state;

int analogPin1 = 0;

// variable to store the value read int val = 0;

// variable to store the value calculated float x = 0; float y = 0;

void setup() { // Select the internal analog reference 1.1 Volt. analogReference(INTERNAL); // pins for switches are inputs pinMode(S1, INPUT); pinMode(S2, INPUT); pinMode(S3, INPUT); pinMode(S4, INPUT);

// set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("Ohm meter");

// One sencond delay delay(1000); }

void loop() { // Read the DC voltage measurment scale. s1_state = digitalRead(S1); s2_state = digitalRead(S2); s3_state = digitalRead(S3); s4_state = digitalRead(S4);

// read the Analog input pin val = analogRead(analogPin1);

//Clear screen lcd.clear(); if(s1_state == 0x00) { // set the cursor to line 1 lcd.print("1K Ohm Scale"); // set the cursor to line 2 lcd.setCursor(0, 1); if(val >= 932) { lcd.print("> 1K Ohm"); } else { x = (2327.27 - (float)val); y = ((float)1500 * (float) val); x = y / x; lcd.print(x); lcd.print(" Ohm"); } } if(s2_state == 0x00) { // set the cursor to line 1 lcd.print("10K Ohm Scale"); // set the cursor to line 2 lcd.setCursor(0, 1); if(val >= 932) { lcd.print("> 10K Ohm"); } else { x = (2327.27 - (float)val); y = ((float)15 * (float) val); x = y / x; lcd.print(x); lcd.print(" K Ohm"); } } if(s3_state == 0x00) { // set the cursor to line 1 lcd.print("100K Ohm Scale"); // set the cursor to line 2 lcd.setCursor(0, 1); if(val >= 932) { lcd.print("> 100K Ohm"); } else { x = (2327.27 - (float)val); y = ((float)150 * (float) val); x = y / x; lcd.print(x); lcd.print(" K Ohm"); } } if(s4_state == 0x00) { // set the cursor to line 1 lcd.print("1000K Ohm Scale"); // set the cursor to line 2 lcd.setCursor(0, 1); if(val >= 932) { lcd.print("> 1000K Ohm"); } else { x = (2327.27 - (float)val); y = ((float)1500 * (float) val); x = y / x; lcd.print(x); lcd.print(" K Ohm"); } }

//500mS delay delay(500); }

Step 4: Conclusion

The project is successfully simulated by using the Proteus.

The measured resistance is displayed 16x2 LCD display.

The measurement and test results of various resistor value are given in above table.

Note, at 1000K measurement range error, should be cross checked against the real hardware