Arduino based multimeter

Help me by sharing this post


←PREVIOUS TUTORIAL       NEXT PART→

In this tutorial we will merge all the parts seen in these past tutorials here. In those tutorials we have seen how to measure resistance, current, indcutnace and capacitance. Measure voltage is very easy. In this tutorial we make a 5 in 1 multimeter based on an Arduino, an ADC module and an LC tank circuit. The case is 3D printed. You have the schematic, code and all you need to amke this project.




PART 1 - Schematic

You have the schematic for this project below. You need the Arduino, the ADS1115 ADC module, the OLED display, the ACS712 current module, the TP4056 based charger and a few more components. You have all the values below. After you make the connections, you can downlaod the code and upload it to the Arduino and give it a test.

We need:
1 x Arduino NANO/UNO: LINK eBay
1 x ADS1115 sensor: LINK eBay
1 x i2c OLED screen: LINK eBay
1 x TP4056 charging module: LINK eBay
1 x ACS712 current sensor: LINK eBay
1 x LM324 OPAMP: LINK eBay
10 x female bullet connectors: LINK eBay
2 x male bullet connectors: LINK eBay
3 x push buttons: LINK eBay
1 x sliding switch: LINK eBay
1 x 3.7V lipo battery: LINK eBay
RESISTORS: 1x150, 1x220, 1x330, 2x2K, 1x6.8K, 1x10K, 1x20K, 1x470k : LINK eBay
2 x 1n4001 diode: LINK eBay
2 x 1uF nonpolarized capacitor: LINK eBay
wire, solder, soldering-iron, 3D case, etc

Arduino multimeter schematic homemade circuit




PART 2 - Measure voltage

Below you have the full code for this project. Download it and read it line by line in order to understand it better. You will also need the OLED library and the library for the ADS1115 module so downlaod those and install them on your Arduino IDE.


Download full multimeter code:

Download Adafruit_ADS1015 library:
Download Adafruit_GFX.h library:
Download Adafruit_SSD1306.h library:

But first, let's go step by step and see how we measure each value: voltage then resistance, then capaciance, inductance and current. Let's start with volage since that is very easy. Below you have an example code for the ADS1115 module using the library. We read and print the values to the serial monitor. The ADS1115 has its own refference so it doesn't matter if the voltage battery is 3.7 or 4.2 or any other value, the output will always be precise.


#include <Wire.h>
#include <Adafruit_ADS1015.h>
 
Adafruit_ADS1115 ads;
const float multiplier = 0.1875F;
 
void setup(void) 
{
  Serial.begin(9600); 
  // Descomentar el que interese
  // ads.setGain(GAIN_TWOTHIRDS);  +/- 6.144V  1 bit = 0.1875mV (default)
  // ads.setGain(GAIN_ONE);        +/- 4.096V  1 bit = 0.125mV
  // ads.setGain(GAIN_TWO);        +/- 2.048V  1 bit = 0.0625mV
  // ads.setGain(GAIN_FOUR);       +/- 1.024V  1 bit = 0.03125mV
  // ads.setGain(GAIN_EIGHT);      +/- 0.512V  1 bit = 0.015625mV
  // ads.setGain(GAIN_SIXTEEN);    +/- 0.256V  1 bit = 0.0078125mV 
  ads.begin();
}
 
void loop(void) 
{
  int16_t adc0, adc1, adc2, adc3;  
  adc0 = ads.readADC_SingleEnded(0);
  adc1 = ads.readADC_SingleEnded(1);
  adc2 = ads.readADC_SingleEnded(2);
  adc3 = ads.readADC_SingleEnded(3);
  Serial.print("AIN0: "); Serial.println(adc0 * multiplier);
  Serial.print("AIN1: "); Serial.println(adc1 * multiplier);
  Serial.print("AIN2: "); Serial.println(adc2 * multiplier);
  Serial.print("AIN3: "); Serial.println(adc3 * multiplier);
  Serial.println(" ");  
  delay(1000);
}

So, make the connections and uplaot it to the Arduino. It will measure voltage with high precision. But!, you need the voltage divider at input in order to measure up to 20V. Otherwise the ADS1115 module will burn out. See schematic for voltage divider values and how to integrate that in the code measurement.


Arduino multimeter voltage ADS1115





PART 3 - Measure resitance

For more details see the RESISTANCE METER TUTORIAL. But we will use a basic voltage divider to calculate the resistence. As we know, a voltage divider is made of two resistences (R1 and R2) in series. The output voltage in the middle point is [R2/(R1+R2)]Vin. Using this formula and knowing the value of one of the two resistors and measuring the Vout it is very easy to calculate the resistence of the seacond resistor.

On our schematic, the resistance measurement is made with the 2k, 20K and 470K resistors connected on pins D6, D7 and D8. By that we have 3 different scales. If we set D6 as OUPTUT and set to LOW, that will our GND for the voltage divider. The other pins, D7 and D8 are set to INPUT so they have high impedance. So our volage divider is amde out of the 2K resistor and the unknown resistor. We measure the voltage on the ADC1 pin and using the formula we get the resistance. We do that for all the scales.


Arduino multimeter resistance meter

Make sure that you measure the vlues of the 2k, 20K and 470K resistors so you know the exact value and put that later in the full code. Put the multimeter into resistance mode and try different values. Tune your values in the code till you get good results.


Arduino multimeter resistance measure









←PREVIOUS TUTORIAL       NEXT PART→

Help me by sharing this post








yt_link
insta_link
fb_link
twitter_link

Arduino multimeter
page 1/2



ADVERTISERS
PCBWAY PCB service



Gearbest Alfawise U30 2.8 inch Touch Screen DIY Desktop 3D Printer - U30 EU Plug Black
Alfawise U30 2.8 inch Touch Screen DIY Desktop 3D Printer - U30 EU Plug Black only $$162.89

AFFILATE

Gearbest Creality3D CR - 10S 3D Printer - EU Plug Upgrade Version Coffee and Black
Creality3D CR - 10S 3D Printer - EU Plug Upgrade Version Coffee and Black only $$352.94

Gearbest Creality 3D Ender-3 V-slot Prusa I3 DIY 3D Printer Kit 220 x 220 x 250mm Printing Size - EU Plug Black
Creality 3D Ender-3 V-slot Prusa I3 DIY 3D Printer Kit 220 x 220 x 250mm Printing Size - EU Plug Black only $$153.84

Gearbest Alfawise U20 Large Scale 2.8 inch Touch Screen DIY 3D Printer - EU - U20 EU Plug Black
Alfawise U20 Large Scale 2.8 inch Touch Screen DIY 3D Printer - EU - U20 EU Plug Black only $$253.39