Measuring Voltage With Arduino
Measuring Voltage With Arduino
Recent Donors:
X
Thanks S.K. for your $10 donation
Search...
PCF8563 (RTC) /
Arduino Testing
Arduino Web
Page Button and
Push Button LED
Control
Differences
Between Arduino
Revision 2 and 3
Difference
Between Arduino
Can't see the video? View on YouTube → and ATmega328
WeMos SAMD21
Arduino M0
Principle of Operation Quick Start
Tutorial
Input Impedance
A digital multimeter set to measure DC voltage will typically have an Choosing an
Arduino for
input impedance of 10MΩ or greater. Beginners
What this means is that the resistance between the two multimeter
probes is 10MΩ or more.
The circuit shown below will divide the input voltage by 11 (from
the battery as the example input voltage being measured).
Precautions
Common Ground Shop Related
Products
If the Arduino is powered from an external power supply or a USB
cable (i.e. not powered by a isolated battery or other isolated power
supply) the circuit may share a common ground or 0V connection
with the circuit under test.
Input Protection
The resistor values in the circuit diagram above provide some over-
$8.99
AUSTOR 925 StarTech.c…
voltage protection when measuring low voltages such as 5V, 9V or $13.99
Pieces 37 2 Port Native
12V. So if a voltage of say 30V is accidentally measured, it will not Values 5% $89.99
PCI Express
blow the Arduino analog input pin. Carbon Film RS232 Serial
Resistors …
(192) Adapt…
(73)
Any voltage higher than about 55V could damage the Arduino. The
Ads by Amazon
point on the resistor divider network connected to the the Arduino
analog pin is equivalent to the input voltage divided by 11, so 55V ÷
11 = 5V. In other words, when measuring 55V, the Arduino analog
pin will be at its maximum voltage of 5V.
circuit board
schematic diagram
electronic circuit
Note that calibrated values are used in this sketch – these will
need to be changed for your particular reference voltage and
actual resistor division factor, explained below.
/*---------------------------------------------------------
Program: volt_measure
The sum or total of all 10 values added together are stored in sum.
The variable sample_count keeps track of the number of samples.
Both variables are reset after calculating and displaying the voltage:
sample_count = 0;
sum = 0;
#define NUM_SAMPLES 10
Don't make this value too high or the sum of all the samples will be
too big to fit in the sum variable.
This calculates the divided voltage – i.e. the voltage on the A3 pin.
Serial.print(voltage * 11.0);
The above line of code calculates the actual voltage and then sends
it out the serial port for display in the serial monitor window.
Amazon.com Amazon.co.uk
electronic circuit
Now measure the voltage across the 100k resistor (R2) i.e. between
Arduino pin A3 and GND.
For example, if the first or input voltage measured is 10.02V and the
second or output voltage is 0.9V, then the division factor is:
Serial.print(voltage * 11.133);
Comments Login
Displayed next to your comments. Not displayed publicly. If you have a website, link to it here.