Arduino Digital Ammeter Project With Circuit & Code
Arduino Digital Ammeter Project With Circuit & Code
ARDUINO (HTTPS://CIRCUITDIGEST.COM/ARDUINO-PROJECTS)
Ammeter is used to measure current ow through any load or device. Here in this Arduino Ammeter, we will explain about measuring of
current by using ohm’s law. It will be quite interesting as well as a good application of basic science that we studied in our school days.
All of us are well known of ohm’s law, It states that “the potential difference between two poles or terminals of an conductor is directly
proportional to the amount of current pass through the same conductor” for constant of proportionality we use resistance, so here it comes
the equation of ohm’s law.
V = IR
In order to nd the current pass through the device we just rearrange the equation as below, or we can calculate with ohm's law calculator
(https://circuitdigest.com/calculators/ohms-law-calculator).
I=V/R
1. Voltage
2. Resistance
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 1/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
We are going to build a series resistance along with the device. As we need to nd voltage drop across the device, for that we need voltage
readings before and after the voltage drop, that is possible in the resistance because of no polarity.
Like in the above diagram, we have to nd the two voltages that are owing across the resistor. The difference between the voltages (V1-V2)
at the two ends of resistors gives us voltage drop across the resistor (R) and we divide the voltage drop by the resistor value we get the
current ow (I) through the device. That is how we can calculate the Current value passing through it, let’s gets into it practical
implementation.
Required Components:
Arduino Uno.
Resistor 22Ω.
LCD 16x2.
LED.
10K pot.
Breadboard.
Multimeter.
Jumper cables.
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 2/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
(/fullimage?
i=circuitdiagram_mic/arduino-based-digital-ammeter-circuit-diagram.png)
The schematic diagram shows the connection of the Arduino Uno with LCD, resistor and LED. Arduino Uno is the power source of the all
other components.
The Arduino has analog and digital pins. The sensor circuit is connected to the analog inputs from which we get value of the voltage. The
LCD is connect with the digital pins (7,8,9,10,11,12).
The LCD has 16 pins the rst two pins (VSS,VDD) and last two pins(Anode, Cathode) are connected to the gnd and 5v. The reset (RS) and
enable (E) pins are connected to the Arduino digital pins 7 and 8. The data pins D4-D7 are connected to the digital pins of Arduino
(9,10,11,12). The V0 pin is connected to the middle pin of pot. The red and black wires are 5v and gnd.
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 3/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
In the ADC of Arduino that coverts the voltage into 10 bit resolution numbers from 0-1023. So we need to covert it in voltage value using the
programming. Before that we need to know the minimal voltage that ADC of Arduino can detect, that value is 4.88mV. We multiply the value
from ADC with the 4.88mV and we get the actual voltage into the ADC. Learn more about the ADC of Arduino here
(https://circuitdigest.com/microcontroller-projects/arduino-uno-adc-tutorial).
Calculations:
The voltage value from the ADC of Arduino is ranges between 0-1023 and the reference voltage is ranges between 0-5v.
For example:
The value of the V1= 710, V2= 474 and R=22Ω, the difference between the voltages are 236. We convert it into voltage by multiply with
0.00488, then we get 1.15v. So the Voltage difference is 1.15v, by dividing it by 22 here we get the current value 0.005A. Here we have used
the low value 22ohm resistor as current sensor. This is how we can measure the current using Arduino.
Arduino Code:
Complete code for arduino based ammeter to measure current, is given at the end of this article.
Arduino programming is almost same as like c programming, rst we declare the header les. The header les call the le in the storage, like
for the calculation I get the voltage values by using analogread function.
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 4/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
A temporary oat variable is declared for holding voltage value like oat temp_val. The value is multiplied with 0.00488 to get actual voltage
difference then it is divided by resistor value to nd the current ow. 0.00488v is the minimal voltage that the ADC of Arduino can detect.
Check the full demonstration Video below and also check the Arduino Digital Voltmeter (https://circuitdigest.com/microcontroller-
projects/arduino-digital-voltmeter).
Code
#include<LiquidCrystal.h>
LiquidCrystal lcd (7,8,9,10,11,12);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
lcd.begin(16,2);
lcd.clear();
}
void loop() {
// put your main code here, to run repeatedly:
int voltage_value0 = analogRead(A0);
int voltage_value1 = analogRead(A1);
int subraction_value =(voltage_value0 - voltage_value1) ;
oat temp_val = (subraction_value*0.00488);
oat current_value = (temp_val/22);
Serial.print(current_value);
lcd.setCursor(0,0);
lcd.print("current value=");
lcd.setCursor(0,1);
lcd.print (current_value);
lcd.print("A");
delay(1000);
}
Video
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 5/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
RESISTORS (/TAGS/RESISTORS)
JLCPCB Prototype: Only $2 for 10 pcs PCBs, 48 Hours Quick Turn (https://jlcpcb.com/)
JLCPCB, with 300,000+ Customers Worldwide, 8,000+ PCB Orders Per Day. (https://jlcpcb.com)
Email Address *
Name
Country
United States of America
Subscribe
PREVIOUS POST
Using Python with Arduino - Controlling an LED (https://circuitdigest.com/microcontroller-projects/arduino-python-tutorial)
NEXT POST
Arduino Based Floor Cleaning Robot using Ultrasonic Sensor (https://circuitdigest.com/microcontroller-projects/arduino-
oor-cleaning-robot)
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 6/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
COMMENTS
Alien
Sep 21, 2017
Some powerful led you have there! Drawing 2Amp? Ridiculous! Maybe if you test it with good multimeter...
Log in (/user/login?destination=node/1415%23comment-form) or register (/user/register?
destination=node/1415%23comment-form) to post comments
Also, the 0.08 amp on your lcd display .... tooooo much for led. Way too much!
By the way, to test if your multimeter leads are good or not, switch your multimeter to resistance measurement, to the
lowest possible value, and then put the 2 leads together and see what the multimeter displays. If it's a value of more
than 5 ohm, your leads are bad and will cause wrong measurements. For example, a battery that has 1.2V with good
multimeter will show 1.3 or 1.4 with a bad one. I am telling you this only because in the video, your multimeter is one of
the cheapest with bad leads. DT830D is produced by many company - actually, it's produced in China and sold to
whoever wants to put his name on it. It comes in yellow and black. Maybe just the test leads are of poor design, don't
know since I never bought them, but did tested the leads and they show 1 ohm which is bad. Good leads are in the
range of 0.1 ohm.
arun kumar
Oct 10, 2017
ok
Log in (/user/login?destination=node/1415%23comment-form) or register (/user/register?
destination=node/1415%23comment-form) to post comments
Hiro_Hamada (/users/hirohamada)
Sep 07, 2018
(/users/hirohamada)
Looks spooky to me as well
Michael
Sep 21, 2017
pavansai
Jan 18, 2018
AMAL MOHAN
Sep 06, 2018
sir,
Log in (/user/login?destination=node/1415%23comment-form) or register (/user/register?
destination=node/1415%23comment-form) to post comments
i need speci cations like sensitivity, range of this circuit etc.
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 7/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
Hiro_Hamada (/users/hirohamada)
Sep 07, 2018
(/users/hirohamada)
The range depends on the value of resistor used. You can use a shunt resistor with a
https://circuitdigest.com/microcontroller-projects/arduino-wattmeter-to-...
(https://circuitdigest.com/microcontroller-projects/arduino-wattmeter-to-measure-voltage-current-power-
consumption)
Devanshu (/users/devanshu)
Oct 08, 2018
(/users/devanshu)
What will I do if I want to make a ammeter of range 0-2A with input voltage 5V I have already
Log in (/user/login?destination=node/1415%23comment-form) or register (/user/register?
destination=node/1415%23comment-form) to post comments
use a 2.4 ohm resistor But It will not working
TI WHITEPAPERS
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 8/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
Energy-Saving Low-Noise LDO Regulator for Automotive Modules and Smart Automation (/news/energy-saving-low-noise-
ldo-regulator-for-automotive-and-smart-automation)
(/news/energy-
saving-low-
noise-ldo-
regulator-for-
automotive-
and-smart-
automation)
(/news/single-
chip-
maxtouch-
touchscreen-
controllers-
for-20-inch-
automotive-
touchscreens)
USB-C Combo Buck-Boost Battery Charger for Mobile Computing Systems (/news/usb-c-buck-boost-battery-charger)
(/news/usb-c-
buck-boost-
battery-
charger)
New SIMO PMICs Shrink Power Regulator Size for IoT Devices (/news/simo-pmic-reduce-power-regulator-size-for-iot-
devices)
(/news/simo-
pmic-reduce-
power-
regulator-size-
for-iot-
devices)
Latest Issue of Mouser’s Methods Technology E-zine Explores Smarter Edge Computing for IoT (/news/latest-issue-of-
methods-technology-e-zine-explores-edge-computing-for-iot)
(/news/latest-
issue-of-
methods-
technology-e-
zine-explores-
edge-
computing-
for-iot)
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 9/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
ADC (/forums/embedded/adc)
(/users/baiju) Baiju (/users/baiju) Replies: 3
User login
E-mail or username *
Password *
Log in
more » (https://circuitdigest.com/ti-training/electric-vehicles-videos)
Connect with us on social media and stay updated with latest news, articles and projects!
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 10/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code
(https://www.linkedin.com/company/cir
(https://www.facebook.com/circuitdigest/)
(https://twitter.com/CircuitDigest)
(https://plus.google.com/+Circuitdigest)
(https://www.youtube.com/channel/UCy3CUAIYgZdAOG9k
(https://www.instagram.com/circuit_digest/)
(https://www.pinterest.com/circuitdigest/)
digest/)
CATEGORIES
POPULAR
NEWSLETTER
Subscribe
https://circuitdigest.com/microcontroller-projects/arduino-ammeter 11/11