Arduino Multimeter - Build A Digital Multimeter With Arduino (Tested)
Arduino Multimeter - Build A Digital Multimeter With Arduino (Tested)
Search ...
Product Categories
Learn
Login / Register
About Us
Questions?
Videos
Gadgets, Sensors
Table of Contents
1. Overview
2. What Is A Multimeter?
8. Required Materials
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 1/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
10.1. Circuit
10.2. Code
11.1. Circuit
11.2. Code
12.1. Circuit
12.2. Code
13.1. Circuit
13.2. Code
14.1. CIrcuit
14.2. Code
14.3. logo.h
Overview
A multimeter is an essential tool in any electronics project. Without it, completing projects faces infinite difficulties. In this article, we are going to use an
Arduino board and an OLED display to make a cost-effective digital multimeter. It can measure voltage, current, resistance and, capacitance. Once the
project is completed, you own a multimeter at the lowest possible cost.
What Is A Multimeter?
In simple words, a multimeter is a device that converts electrical parameters such as voltage, current and so on to a language we can understand. First
prototypes of this widely used device (called galvanometer) were created in 1820. Despite being only capable of measuring current, they became an
essential part of any electronics projects.
Multimeters are generally categorized as analog and digital. Analog multimeters use physical pointers to display values and are being used less and less.
However, digital multimeters benefit from digital displays and are much more popular.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 2/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
An analog multimeter:
A digital multimeter:
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 3/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Multimeters measure various parameters. However, the most important ones are voltage, current and, resistance. Other parameters include capacitance,
self-inductance, frequency, diode test, connectivity test, brightness, transistor test and, so on.
For this project, we will make a multimeter that can measure voltage, current, resistance and capacitance.
Various methods exist for measuring the voltage, such as using the hall effect, the simplest one is the voltage divider.
The voltage divider is a circuit that puts a fraction of the voltage between two resistors.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 4/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Now if we know the R1 and R2 resistance and the Vout values, we can easily calculate the voltage using the above formula.
The simplest method for measuring the current is using Ohm’s law. This law states the electrical current in a path is directly proportional to the voltage
divided by the resistance in that path.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 5/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Another technique for measuring the current is using the hall-effect principle. The passing of the electrical current creates a magnetic field and
consequently the hall voltage. By measuring the hall voltage, you can calculate the magnetic field intensity and therefore the passing electrical current.
The same voltage divider technique can be used to measure the resistance. The only difference compared to measuring the voltage is that here, we know
the input voltage, the resistance of R1 and the output voltage. R2 is the unknown variable.
An effective method for measuring the capacitance is the capacitor charge and discharge rule.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 6/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
It takes a specific amount of time for the capacitor to charge to 63.2%. This is calculated using the following formula:
τ^(second)=R×C
So if we know the resistance and the time it takes for the capacitor to charge to 63.2% of its capacitance, we can calculate the capacitance.
Required Materials
Hardware Components
Arduino UNO R3 × 1
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 7/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Resistor 1k × 1
Resistor 10k × 2
Resistor 100k × 1
Resistor 4.7k × 1
Resistor 220 × 1
Software Apps
Arduino IDE
We use the voltage divider technique for the voltmeter. We need the Arduino’s ADC unit to read the voltage.
Circuit
Here we have used 10 and 4.7 kilo-ohm resistors for the voltage division circuit. Connect the wires according to the following diagram.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 8/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Warning
Since the input voltage for Arduino’s ADC is 5 volts, selecting these resistors will allow the measuring of voltages up to 15 volts. Higher
voltages could damage your Arduino board.
By changing the resistors you can change the range of acceptable input voltages. The higher the input voltage, the lower the accuracy will be.
Note
The voltmeter should be in parallel to the section for measuring its voltage.
Code
Upload the following code to your Arduino and view the results in the Serial Monitor window.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 9/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
1 /*
2 Voltmeter with Arduino
3 modified on 21 Jul 2019
4 by Saeed Hosseini @ Electropeak
5 Home
6 */
7 const int VoltMeter = 2;
8 float V = 0.00;
9 void calculate_voltage() {
10 float R1 = 10000.00;
11 float R2 = 4700.00;
12 float v_ref = 5.00;
13 float resistor_ratio = 0.00;
14 float adc_value = 0.00;
15 float voltage = 0.00;
16 resistor_ratio = (R2 / (R1 + R2));
17 for (int i = 0; i < 20 ; i++)
18 {
19 adc_value = adc_value + analogRead(VoltMeter);
20 delay(3);
21 }
22 adc_value = adc_value / 20;
23 voltage = ((adc_value * v_ref) / 1024);
24 V = voltage / resistor_ratio;
25 }
26 void setup() {
27 Serial.begin(9600);
28 }
29 void loop() {
30 calculate_voltage();
31 Serial.print(V);
Here, using the formula for voltage division rule and reading voltage by the ADC unit, we calculate the input voltage.
Tip
To find the voltage using the ADC unit, we use the following proportion:
We use the AC712 sensor for making the ammeter. It is available as a module in various ranges. In this project, we are using the 5A range of this module.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 10/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
This sensor uses the hall effect to measure the current. Then it outputs a voltage proportional to the measured current, namely 185 millivolts for each amp
of current.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 11/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Circuit
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 12/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Note
To measure the current, the ammeter has to be in series with the intended section to measure the current.
Code
Upload the following code to your Arduino and view the results in the Serial Monitor window.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 13/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
1 /*
2 Ammeter with Arduino
3 modified on 21 Jul 2019
4 by Saeed Hosseini @ Electropeak
5 Home
6 */
7 const int Ammeter = A2;
8 float I = 0.00;
9 void calculate_current() {
10 int sensitivity = 185;
11 int adc_value = 0;
12 float v_ref = 4.94;
13 float voltage = 0.00;
14 float pure_voltage = 0.00;
15 float offset_voltage = 2.47;
16 for (int i = 0; i < 40 ; i++)
17 {
18 adc_value = adc_value + analogRead(Ammeter);
19 delay(2);
20 }
21 adc_value = adc_value / 40;
22 voltage = ((adc_value * v_ref) / 1024);
23 pure_voltage = voltage - offset_voltage;
24 // if(pure_voltage > 0.001) pure_voltage = 0.00;
25 pure_voltage = pure_voltage * 1000;
26 I = pure_voltage / sensitivity;
27 Serial.println(String("ADC = ") + adc_value );
28 Serial.println(String("V = ") + voltage + "v");
29 Serial.println(String("Pure = ") + pure_voltage + "mv");
30 Serial.println(String("I = ") + I + "A");
31 }
Here, the ADC unit reads the sensor’s output voltage, then calculates and displays the current using the mentioned proportion of 185 millivolts for each
amp of current.
Note
The first time you start the sensor, it should be free of any load and output voltage should be around 2.5 volts. Read this value carefully and
substitute it for the offset-voltage variable preset.
We use the same voltage divider technique for making the ohmmeter.
The range of resistors’ values is the main issue in an ohmmeter. The farther apart resistance values of the known and unknown resistors are, the less
accurate results will become. So it would be better to use several resistors to maintain smaller ranges. You can manually change the resistors using a
switch or set it up automatically.
In order to automatically change the resistance range, we measure the unknown resistor one by one using the known resistors. Using the known resistors
and the measured values, we calculate more accurate values for the unknown resistors.
Here we have used three ranges of 1, 10 and 100 kilo-ohms. You can make changes based on your project requirements.
Circuit
We have used the 1, 10 and 100 kilo-ohms resistors to set the ranges. Connect the wires according to the following diagram.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 14/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Code
Upload the following code to your Arduino and view the results in the Serial Monitor window.
1 /*
2 Ohmmeter with Arduino - Automatic range
3 modified on 21 Jul 2019
4 by Saeed Hosseini @ Electropeak
5 Home
6 */
7 const int OhmMeter = 0;
8 const int R3 = 6;
9 const int R2 = 5;
10 const int R1 = 4;
11 float R = 0.00;
12 void calculate_resistor() {
13 float v_ref = 4.94;
14 float r1 = 0.00;
15 float r_ref1 = 1000.00;
16 float adc_value1 = 0.00;
17 float voltage1 = 0.00;
18 float r2 = 0.00;
19 float r_ref2 = 10000.00;
20 float adc_value2 = 0.00;
21 float voltage2 = 0.00;
22 float r3 = 0.00;
23 float r_ref3 = 100000.00;
24 float adc_value3 = 0.00;
25 float voltage3 = 0.00;
26 pinMode(R1, OUTPUT);
27 pinMode(R2, INPUT);
28 pinMode(R3, INPUT);
29 digitalWrite(R1, HIGH);
30 for (int i = 0; i < 20 ; i++)
31 {
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 15/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
In this piece of code, unknown resistance values are calculated one by one, using the known resistors. Then we use the conditions to calculate the main
resistor’s resistance.
Note
In order to measure the resistance accurately and turn Arduino pins on and off, setting them as LOW wouldn’t suffice. Arduino pins should be
defined as inputs so they can be fully turned off.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 16/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
We are using the same capacitor’s charging time algorithm to measure the capacitance. After the measurement process, the capacitor should be
discharged for the next measurement.
Circuit
Here we used a 10 kilo-ohm resistor to charge the capacitor and a 220-ohm resistor for discharge.
Code
Upload the following code to your Arduino and view the results in the Serial Monitor window.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 17/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
1 /*
2 Capacitance meter with Arduino
3 modified on 21 Jul 2019
4 by Saeed Hosseini @ Electropeak
5 base on: https://www.arduino.cc/en/Tutorial/CapacitanceMeter
6 Home
7 */
8 const int CapacitancMeter = 1;
9 const int ChargePin = 13;
10 const int DischargePin = 11;
11 float C = 0.00;
12 void calculate_capacitance() {
13 unsigned long start_time;
14 unsigned long elapsed_time;
15 float microFarads;
16 float nanoFarads;
17 float r_ref = 10000.00;
18 digitalWrite(ChargePin, HIGH);
19 start_time = millis();
20 while (analogRead(CapacitancMeter) < 648) {}
21 elapsed_time = millis() - start_time;
22 microFarads = ((float)elapsed_time / r_ref) * 1000;
23 if (microFarads > 1)
24 {
25 C = microFarads;
26 }
27
28 else
29 {
30 nanoFarads = microFarads * 1000.0;
31 C = nanoFarads;
Start charging the capacitor and registering the starting time using millis() command
Continue charging up to 63.2% of the total capacitance of the capacitor (equal to 648 in ADC)
Calculating the capacitance using the time constant formula, knowing the resistance and time
Note
If you increase the known resistor’s resistance, the charging time will increase, resulting in more accurate results. However, longer charge
duration reduces the measurable capacitance range. If you decrease the resistance, charge time will be reduced and the measurable range
increases, at the cost of losing accuracy.
Now that all target parameters are measured, you can complete your multimeter by adding an OLED display and two buttons to navigate the menus.
CIrcuit
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 18/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Code
Upload the following code to your Arduino and view the results in the Serial Monitor window.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 19/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
1 /*
2 Digital Multimeter with Arduino and OLED
3 modified on 21 Jul 2019
4 by Saeed Hosseini @ Electropeak
5 Home
6 */
7 #include <Wire.h>
8 #include <Adafruit_GFX.h>
9 #include <Adafruit_SSD1306.h>
10 #include "logo.h"
11 #define SCREEN_WIDTH 128
12 #define SCREEN_HEIGHT 32
13 #define OLED_RESET -1
14 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
15 const int select_button = 2;
16 const int right_button = 3;
17 const int OhmMeter = A0;
18 const int CapacitancMeter = A1;
19 const int VoltMeter = A2;
20 const int Ammeter = A3;
21 const int R3 = 6;
22 const int R2 = 5;
23 const int R1 = 4;
24 const int ChargePin = 13;
25 const int DischargePin = 11;
26 boolean is_select = false;
27 int navigator = 0;
28 int flag = 0;
29 float R = 0.00;
30 float V = 0.00;
31 float I = 0.00;
logo.h DOWNLOAD
H 1 file(s) 12.56 KB
Press the button connected to pin 3 to navigate the menus. Pushing the button on pin 2 enters the measurement process for the highlighted item on the
menu. Pressing it again takes you back to the main menu.
Success
Congratulations! Now you have a professional digital multimeter.
What’s Next?
Explore more exciting electronics projects and expand your skills in the fascinating world of electronics. Stay tuned for more guides and tutorials at Your
Electronics Guide.
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 20/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Send
PREVIOUS NEXT
ESP32 Bluetooth Low Energy (BLE) on Arduino IDE [Tutori… ESP32 & ESP8266 NTP Client-Server: Getting Date and Ti…
More To Explore
ESP32
Majid Merati
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 21/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Arduino
Majid Merati
Comments (63)
Dongkoi Reply
Hello. thank you for this Article. it will surely be a great help in building our own multimeter project. I hope you’ll response in my question while building
this kind of project. Thanks again!
Dongkoi Reply
hi there, just wanna ask some question. how can i combine all the codes?
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 22/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
dongkoi
hehe you’re right, its in step 5. thanks a lot.
koidong Reply
what should be the right thing to do with the logo.h file? i’ve copied it to the folder where my code is located but it keeps showing an error “logo.h: no such
file or directory”.
koidong Reply
thank you. it finally works! thanks for this article!
koidong Reply
Where to connect the inputs for resistance and capacitance?
johnnyy Reply
excuse me guys but i dont know how to measure the current?? so can you tell me where to connect the inputs of th curreny?
Luis Reply
Hello,
I’m trying assembly this circuit on tinkercad, but I can’t find the part (0.96″ I2C OLED Display Module)
The picture that you shared on step 5 is about tinkercad or did you use another software?
Can you please help me?
Enoch Reply
Electropeak in making the capacitance
What is the name of the Blue component used with the resistors
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 23/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Enoch Reply
What if I want to add a chargeable battery to the circuit how can I go about it.
Secondly please where would my red and black probes be fixed on the board.
Enoch Reply
Thank you very much
This website is very helpful
but can I ask please
What if i did not get the AC712 5A Current Sensor is there any alternatives
Daniel Reply
Thank you for this. I’m currently doing a similar project
Right now I’m searching for the best way to adapt main voltage (220 VAC) signal into an analog input that doesn’t fry up my arduino. A voltage divider is
out of question and I don’t seem to find a suitable transformer for the job of just measuring.. Any suggestions?
Enoch Reply
could not convert display.Adafruit_SSD1306 from void to bool
That is what my code( in the Arduino ide) is saying
Any help please ?????
Enoch Reply
Electropeak thank you very much I am done with the project but I am having some incorrect readings, the resistor is not measuring and before I test for
anything the multimeter just keep reading Like when it is supposed to be 0.00 it would keep reading randomly. Any help please
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 24/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
adam Reply
Hi,
Do you have an idea how to protect the meter be mistested or misseted, say use a R gear to measure a Voltage by mistake?
Thanks
Adam
ABdul Reply
Hey there would you have an idea on how to measure AC voltage?
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 25/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Ahmed Reply
Hi, im willing to make this multimeter but I can’t find the “0.96” Resistor 220 ” could someone send me a link so that I can buy it. Also if possible to
someone to send me a picture of the final result of the mutlimeter to heheboi1396@gmail.com fast as possible. It would help me a lot.
Thanks
Mohammed Reply
Please I have another question if I want to add DC (Power and Energy)
What should I do how can I calculate P=VI and E=Pt by coding
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 26/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
chosen arbitrarily.
You can study the link below for more notes on how to write your code, or consult a programmer.
https://www.programmingelectronics.com/tutorial-3-arduino-ide-and-sketch-overview/
Mohammed Reply
thank you and can I contact you by email or whatsapp ?
Val Reply
Hello, thanks for the great project. I only have one problem, I can’t find the OLED anywhere near me and I can only find LCDs can that work? and do you
have any Idea how to edit the code to make it work around using an lcd for an output?
Iulian Reply
Hello , i have a question , why do you divide by 20 the adc_value in the first step ? “adc_value = adc_value / 20” ? is it because u increment until it’s 20 for i
?
krishna Reply
I am getting a lot of errors in it like Adafruit_GFX.h , Adafruit_SSD1306.h No such file or directory etc. Can anyone kindly help me with making this project?
Ali Abdolmaleki
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 27/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Yes. Reply
you can use it for this goal.
jack Reply
what is the function of logo.h?
bahril Reply
please i want to know codes in Voltmeter , why adc_value divided by 20 ? i dont get it.
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 28/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.
POST COMMENT
info@electropeak.com
Shenzhen, China
COMPANY MY ACCOUNT
About us My Wishlist
Contact us My Account
CUSTOMER SERVICE
FAQ
Return Policy
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 29/30
11/7/23, 6:40 AM Arduino Multimeter | Build a Digital Multimeter with Arduino [Tested]
WORKING DAYS/HOURS
Mon – Fri / 9:00-18:00 GMT+8
https://electropeak.com/learn/make-a-digital-multimeter-with-arduino/ 30/30