Introduction: ArduMeter: an Arduino Based Multimeter (Sort Of)
The ArduMeter is an Arduino Based Multimeter, which many people have made to perform different operations, and searching on google you could find all the variety of things it can do. I wanted to make one that is portable, quite easy to use, give decent readings to a certain extent, and of course can help me troubleshoot and experience some cool high speed things that regular multimeters are too slow to capture.
The different functions that the ArduMeter is capable of performing:
- Reading voltages
- Measuring Resistance
- Measuring Continuity
- Graphing a Voltage vs Time graph similar to an oscilloscope.
- And maybe some more in the future.
However as you could guess, this is not a high tech device, and all its functionalities are limited in one way or another. In later steps I will be going in details of each of the ArduMeter’s functionalities, the section of the code it covers, and some of its Theory of operation and limitations.
The 4th function that Graphs a Voltage vs Time graph is definitely my favorite, since now because of that I could actually see a lot of waveforms and signals, (not as much as their values, but the trend) without having to have an oscilloscope. For example, if you have a sensor that you want to test, you could simply hook up the output of that to ArduMeter and using the Voltage vs Time graph you could see what reading it gives without having to have a computer nearby.
Step 1: Materials Used
These are the materials I used:
- Two OLED displays (128*64 0.96 inch) that use the I2C interface.
- Arduino nano
- A voltage booster to provide stable 5 volt from the battery's 3.7 Volt
- 3.7 Volt Lithium Polymer Battery
- Two Trimmer Pots of 10K Ohm
- A Potentiometer (value doesn't really matter for this one) , and a knob
- Two momentary Push Button Switches.
- A 25K-100K resistor for pullup at pin A2.
- A Red Led (Optional: Used to show if Li-po battery has been connected in reverse to the Booster Circuit, since the booster burned out 3 times for me when I did so)
To solder it and make it permanent you would need a few more materials:
- A perfboard
- Female PCB Pinheader
- Lots of Jumper Wires
- Soldering Iron
- Hot Glue Gun
- Heat Shrink Tubing
Step 2: Schematic
So this is the schematic of the connections I used.
These are the connections I used so far: (Don't have a schematic yet)
Momentary push button to D2 & Gnd.
Momentary push button to D3 & Gnd.
Potentiometer Left- Vcc Middle- A1 Right-Gnd.
Trimmer Pot 10K ohml- Left- Gnd Middle- A0 Right- Connect to battery + for voltage measurement while in VoltageRead function, or resistor for resistance function.
OLED display 1- Vcc- 5V Gnd-GND SCL-A5 SDA-A4
OLED display 2- Vcc- 5V Gnd-GND SCL-A5 SDA-A4
Battery connects to Booster Circuit.
Booster Circuit Connects to Arduino.
A Resistor connects from A2 to Gnd to pulldown any floating values.
A wire connects from A2 to any incoming signal to read the voltage levels in the oscilloscope function.
D11 is set up to be a PWM output to check the oscilloscope function.
Buzzer- Positive- D12 Negative-GND.
Step 3: How to Use the ArduMeter
So when you turn on the ArduMeter, you will see a bunch of options. Use the Potentiometer to scroll through those options. Once the box lands on the Function you want to use, click on the Green Button (connected to D2). How to use those individual options will be in the later steps, where I talk about each of those steps in more detail. Now once you are done with the function, press or even hold in some cases, the Red Button (connected to D3). It should take you back to main menu.
Of course I am not a good coder, so some things might not work easily, and sometimes there might be malfunction in the ArduMeter. Tinker with the code that I post in this instructable, and you should be able to find a way around those Bugs hopefully.
Step 4: Voltage Dividers
So pretty much most of the functions in this ArduMeter is based around Voltage Dividers. So this step is dedicated only to give a general idea of it in case you don't know about it.
Voltage Divider Circuit:
A voltage divider is a circuit that basically divides the voltage. Using two resistors it can be easily accomplished. Resistors in series drop voltage in ratio to their resistance. So if you have two resistors in series, a 10 ohm resistor and another 20 ohm resistor, the 20 ohm resistor will drop twice as much voltage as the 10 ohm resistor. So if we connect a 30 Volt battery across the series of resistors, then the 10 ohm resistor would drop 10 Volts and the 20 ohm resistor would drop 20 Volts. Since the voltage across the 10 ohm resistor is 10 Volt, you could attach a load parallel to the resistor and it would also have close to 10 volts across it (Depending on the load). So basically we could use those two resistor to divide the voltage from a 30 volt source to run a device at either 20 volt or 10 volt.
Figure 1 shows schematic of a voltage divider using two resistors, as well as the formula used to find the Voltage across the resistors.
Figure 1.1 shows the diagram of a Potentiometer (variable resistor) . The arrow (the knob) basically moves along the resistor, changing resistance between Pins 1 and 2, and Pins 2 and 3. However the resistance of the 1 to 3 stays the same throughout. Let’s say resistance between Pin 1 and 2 is R1, and resistance between Pin 2 and 3 is R3, and resistance across pin 1 and 3 is Rt. Then Rt= R1+ R2.
Figure 1.2 basically shows how the potentiometer can be used as a voltage divider circuit.
Step 5: Idea Behind It: ReadVoltage Function
Arduino isn’t capable of measuring voltage in the normal sense, instead it compares voltages. Basically if you hook up a 3.3 volt battery to the Arduino, it doesn’t read that there’s 1.5 volts at one of its pins. Instead it compares the Voltage at the pin to a reference voltage, which by Default would be the supply voltage of the Arduino, which Should be 5 Volts. After comparing, it determines that the Voltage at the pin is 66% of the supply voltage. Then the Arduino outputs the reading as an integer between 0-1023, which we could use , through the use of arithmetics, to find the value of the Voltage at the pin. Voltage at the pin= ( (Reading from Arduino* Reference Voltage) / 1023). In this case the reference Voltage would be the supply Voltage of the Arduino or 5 Volts.
However this has a few limitations.
- First of all, the test voltage has to be less than the reference Voltage of the Arduino, otherwise there would be an uncontrolled flow of current from the testing voltage source to the Arduino’s chip, which would fry the Arduino.
- Secondly, the Voltage reading is done through Comparing voltage to a reference, which by default is the supply voltage of the Arduino. The Supply voltage Should be 5 Volts, however most of the times it isn’t. Most USB cables fail to maintain that voltage level under load, or the voltage supplied doesn’t stay constant at 5V.
So there were a few options to work around the problems mentioned above.
- I could use a Voltage divider circuit, in order to reduce the Testing Voltage by a factor before it reaches the Arduino pin. So we could use a Voltage divider to get only ⅖ of the Testing Voltage to the Arduino pin and then we could just multiply the voltage reading we get by 5/2 and we would get the original value of the Testing voltage. Even after that there would still be a limit of Testing Voltage, however getting the range of testing voltage up to 0-12.5V should be sufficient for most cases.
- Arduino can use different reference voltages to classify the Testing Voltage at its pin. It can use INTERNAL references, where the Arduino provides a stable voltage level for comparison. It can also use an EXTERNAL reference, where an external Voltage source will provide a stable known voltage level for comparison. The External Voltage source requires more circuitry.
- For the INTERNAL references, Arduino nano can provide a 1.1 Volt voltage reference, and by default use the supply voltage as reference.
In order to read voltage, I used a voltage Divider to increase the range of test voltage, and I used another function to find the Supply Voltage of the Arduino using the 1.1 Volt Internal Reference of the Arduino. I found the ReadVcc() function online, which allows the arduino to find it's own supply voltage through the use of the internal 1.1 Volt reference. The voltage divider I used was a 10k Trimmer Potentiometer. And that potentiometer ran to the Analog Input pin A0.
Step 6: Idea Behind It: Measuring Resistance
The resistance function would measure the resistance of a resistor connected across the VCC and the end of the Trimmer Pot whose middle goes to A0. We basically have three resistors in series then, connected from VCC to Ground (the Trimmer pot is connected to ground and A0.). So once again we are going to have a Voltage divider circuit, where the voltage Vr across A0 and Ground would Vcc*( R1/ (R1+R2+ R3)) where R1 is the resistance across Pin 1 and 2 of the Trimmer Pot, R2 is the resistance across Pin 2 and 3 of the Trimmer Pot, and R3 is the resistance of the resistor we attached from the end of the trimmer pot to Vcc.
So rearranging the equation we should find that R3= ((Vcc*R1)/ Vr)- (R2+R3).
And that is how the resistance function determines the resistance of the attached resistor.
Step 7: Idea Behind It: Measuring Continuity
The continuity function does the same thing as measuring resistance. However whenever that resistance doesn't exceed a threshold, the ArduMeter turns on an annoying Buzzer to let you know that there is enough continuity between the two points. Otherwise it just tells you to connect object if you hadn't done so, or it shows that there is no continuity.
Step 8: Idea Behind It: Oscilloscope (Voltage Vs Time Graph)
This one is probably the easiest to understand, but a bit harder to execute. So all I had to do for this was take Voltage reading at pin A2 and graph it on a scale of 1-5 V.
However the challenges were in the taking that reading and graphing it as fast or slow as possible. Arduino has a limitation on how fast it can perform the AnalogRead() function, so there was a limitation on the oscilloscope. The X axis of the graph on the ArduMeter can only go down to 14000 uS, of 14ms. So basically it can read the Voltages every 120 uS or so, and everything in between will pretty much be lost. However it is still not bad, because by graphing the readings, and connecting them by lines, we could still get a pretty good looking graph.
Also without a Pulldown resistor at pin A2, it picks up way too much noise, to the point that even touching the wire with your hands would draw a sine wave graph on the display. So to avoid all that, I connected the pullDown resistor.
In the picture above, first I tried the oscilloscope with a 555 timer generated PWM signal, and even though the signal should have been around a kiloHertz or so (my components weren't exact) the ArduMeter managed to make a pretty nice looking graph.
Also pin D11 is set to be a PWM output just to test the ArduMeter's oscilloscope function. By scrolling using the Potentiometer you can change the duty cycle of the PWM. So I also tried graphing that PWM signal with the ArduMeter, and was pretty pleased with the result.
Step 9: Assemble It on Breadboard
Assembling it on bread board looks like this, quite messy. But it did help me to trouble shoot a lot of problems. I would recommend you to do the same before making it permanent. Tinker around with it on the breadboard, and maybe you can make it much better before you solder it permanently.
Step 10: Some Things to Know: Using the Displays
https://learn.adafruit.com/adafruit-gfx-graphics-l... . This link provides a lot of information regarding the display library, and how to display different shapes and stuff. Definitely needed if you want to modify the code.
Also here's the wiring diagram for the .96 inch oled displays in case you needed to see it.
Step 11: Some Things to Know: Using Two Displays at Once
Use that tutorial to learn how to use two oled displays at once. Also my codes have borrowed much more from his videos. So give him a visit.
Anyway you could do all this with only one display, but keeping any future modifications in mind, I decided to use two displays in order to have enough screen real estate. Two use two displays all that was necessary was to change the address of the Oled displays, which could be done by desoldering the resistor from the back of the display. Just watch that video if you are confused.
Step 12: Make It Permanent
This is how it looked once I soldered it all.
I used the Female Pin headers to connect to every single Arduino pin, as well as leave two extra headers point in order to connect testing components. In the future if I want I could add anything to the ArduMeter as long as I can plug things into the Female Pin headers.
As you can see there have been a lot of jumbling of wires, and in order to stop messing things up, I used ample amount of heat shrink tubing to reduce chances of shorts. I recommend you do the same if you are planning to make it as well.
Step 13: Final Assembly
And the final assembly. The code is attached in a file here as well. Take a look at it if you are interested. Play around with it, modify it to your heart's content, and have fun making this and using this.