Dec 15th, 2019 | by: ELECTRONOOBS | Views 3924
Views 3924
Months back I've made an Arduino based multimeter that was able to measure quite well voltage, current, capacitance, inductance and resistance. That was soldered on a homemade PCB and with wire connections, you can see that tutorial here. But that version had some errors. First of all the circuit was a mess becuae I wasn't using a professional made PCB and we had a lot of wires. Then, I've used the wrong current sensor so thet mode was not working. Also, the worst thing was that we had different inputs for each mode. Usually, multimeters have just only one input for the probes and then a rotary switch to change between modes. That's exaclty what I've made in this second version and also a few more improvements. Now we have auto scale mode for all the measurements, we can also measure negative voltage because we use the ADS1115 ADC sensor in differential mode, we can also measure AC voltage because the circuit has a full bridge rectifier and a few more improvements...
PART 1 - What we need

The list is a bit long. See below all we need. For the resistors and capacitors I've sued basically only 0402 size and that's a bit dificult to solder by hand. use a lot of fux. But first download the GERBERs and order the PCB to JLCPCB. You will also need the 3D case for the final multimeter. Get the OLED display, the amplifier ICs and the ADC. For the ATmega328 IC you could just desolder one from an old Arduino NANO. You will also need the LiPo battery and probably a boost converter to get 5V.


We need:

PART 2 - Schematic


The schematic could be a bit tricky. But I've separated all parts. The first block should be the one in the middle witch is the rotary switch. As you can see the input from the probe is divided into 4 outputs for voltage, resistacne, capacitance and inductance. Current is done separatelly with a sliding switch (S4.1). The first measure block is the voltage one. As you can see we have the input from the probes connected to the full bridge rectifier and then we have a capacitor so we can store the voltage for AC mode. Then, that voltage is connected to some dividers and the output of the dividers to the ADC0 and ADC1 of the ADS1115, so in this way we can measure in differential mode and be able to measure negative voltages too.

Next we have the blocks for resistacne and capacitance. Resistacne is easy. In the code, by changiong D3, D4 adn D5 to "LOW" we create a virtual GND to those pins. So, we can select fropm different voltage dividers in order to select scale. Then we measure the voltage with the ADC2 input of the ADS1115. We know the divider value and the measured voltage, so we can get the resistance value. Is that easy. You can see more about resistance measure here on this tutorial.

Now for capacitance mode, we first charge up the capacitor with one of the D11 or D13 pins, depending on the mode. Then we measure the time it takes to discharge to 63.2% and then we use the time constanct to get the capacitor value. See more on the tutorial here.

Next, we have indcutance meter. here we have an "LC tank" made with those 1uF capacitors in paralel which make a 2uF cap, and the coil that we insert. An inductor in parallel with a capacitor is called an LC circuit, and it will electronically "ring" like a bell. Well regardless of the frequency or how hard a bell is struck, it will ring at it’s resonating frequency. We will electronically strike the LC bell, wait a bit to let things resonate, then take a measurement.

So what we will do is applying a pulse signal to the LC circuit. In this case it will be 5 volts from the arduino from D6. We charge the circuit for some time. Then we change the voltage from 5 volts directly to 0. That pulse will make the circuit to resonate creating a cushioned sinusoidal signal oscilating at the resonant frecuency. Using the OPAMP we pàss that signal to square waves and then with the ARduino at pin D9 we measure the pulse lenght and bt taht we obtain the frequency. With the frequency, we get the inductor value because we already know the 2uF value of the capacitor. See more here.

Current meter is simple. We connect the input to the ACS712 amplifier which is specially designed for current measure. It will give an analog output according to the current value and we know the gain. In this case I'm using the 20A model adn the gain is 100mV/A output. So all we do in the code is to measure the analog output and then by knowing taht each 100mV is 1A we can get the current value. You have some more theory here.

PART 3 - Voltage problem

Once you see the PCB you will notice that on the back we have 2 pads for the batery (+ and -) and the charging circuit. We won't use these parts for now and this is why. In order to properly make calculations in the code, we alo need to know the refference voltage of the battery. For that I've placed a divider on the scheamtic made with resistors R21 and R28. The input of that divider is the battery and using A6 we could measure the refference in the code using the internal refference of 1.1V. But, dum as I am, if we set the analog refference to internal, then all analog measurements will eb set to "INTERNAL" and we don't want that. So the solution is this:


Instead of measuring the battery value, what I've done is place a boost converter at the input that will always supply 5V. So now we know that the input will ALWAYS be 5V. But with this configuration we can't use the battery charger circuit. So, stay tuned for a future update of the circuit and PCB. So get the boost converter and set it to exactly 5V and then connect it to the PCB like shown above. One pin to the + pad and the other to GND of the PCB, NOT to the "-" pad! So don't solder any components from the "Charge circuit" block from the schematic.

PART 4.1 - The ATMEGA328 IC


Ok, get the GERBER files from below and order the PCB, or mount the same circuit on a prototyping PCB if you want. Anyway, get the PCB and let's start soldering components. But that must go in this order. First, we have to solder the ATMEGA328 and the basic components. That means all the components in the "ATMEGA328" block from the scheamtic. The chip, the crystal, the pullup R19, the small 22pF capacitors for the crystsl and the DRT C10 capacitor of 100nF. Also solder C9 and C1 of 100nF as well. With these components the IC should work. To test if it dose, connect the FTDI programmer to the UART pins, DTR to DTR, RX to TX, TX to RX, GND and Vcc and upload a code. For example uplaod a simple counter and print that on the monitor. If you get results, then the IC is working.

4.2 The rest

If the IC works, you can now solder all the other components from the scheamatic. Use a lot of flux and food solder beacuse the 0402 pads are very small. Or, if you want go here to easyEDA and get the schematic and make your own board with bigger components. Connect the OLED display with thin wires. Connect and glue the battery and the boost converter on the back. Add the 4mm bullet connectors as probe input. Check the rotary switch pins. The swithc has 3 inpouts and 12 outputs. The PCB has 4 inputs. You must use inputs A, B and C. D is not used. Also, make sure which is output "1" of the roraty swith and make sure it will be connected to hole 1 on the PCB. Is time for the code.

PART 5 - The code

Get the code from below. You will also need some libraries for the OLED display and the ADC1115 Ic. make sure you download those as well from teh link below and install them to the Arduino IDE. Then connect the FDTI programmer to those UART pads. DTR to DTR, RX to TX, TX to RX, GND and Vcc and upload the code. The code is quite long but you have comments that should help you understand. See the schematic at the same time in order to understand better.

/////////////////////////////Library for ADS1115 ADC//////////////////////////////////
#include <Adafruit_ADS1015.h>       //download here: https://www.electronoobs.com/eng_arduino_Adafruit_ADS1015.php
Adafruit_ADS1115 ads(0x48);

////////////////////////OLED 64x124 display with i2c//////////////////////////////////
//OLED screen libraries
#include <Adafruit_GFX.h>           //download here: https://www.electronoobs.com/eng_arduino_Adafruit_GFX.php
#include <Adafruit_SSD1306.h>
#define OLED_RESET 11
Adafruit_SSD1306 display(OLED_RESET);

PART 6 - The 3D case

Go below and downlaod the STL files for the case. It has only 2 main parts and 4 smaller parts. The small parts are 2 push buttons and 2 sliding swithces. We use those to control the buttons and switches on the PCB. I've printed itr with PETG with 2 perimeters, 20% infill, 0.3 layer height and a 0.4mm nozzle.

PART 7 - Test modes

Rotate the switch and test each mode. You might need to adjust some variables in the code. Test the values with a commercial multimeter as well in order to compare. When you get good results, place the PCB isnide the case and that's it. The project is done.

PART 8 - See the video


  • Mark Greco

    about 2 years ago

    Wireless OLED to mount on glasses?? Anyone interested?? I will design the glasses mount


    about 2 years ago

    That is a very good idea

  • Kami Shah

    about 2 years ago

    How to store the values which were tested earliear...

  • Fercho López

    about 3 months ago

    Disculpe la molestia, estoy realizando el proyecto del multímetro, pero las resistencias no las esta midiendo correctamente, que deberia de modificarle al codigo

Login or Sign Up to post comments on this tutorial.