You are on page 1of 11

12/8/2018 Arduino Digital Ammeter Project with Circuit & Code

ARDUINO (HTTPS://CIRCUITDIGEST.COM/ARDUINO-PROJECTS)

Arduino Based Digital Ammeter (/microcontroller-


projects/arduino-ammeter)
By (page_author.html)Arun Kumar (/users/arun-kumar)  Sep 20, 2017 8

Arduino based Digital Ammeter

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

V = voltage across the conductor in Volt (v).


I = current pass through the conductor in Ampere (A).
R = resistance constant of proportionality in Ohm (Ω).

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

So in order to nd out the current, we need some data:

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.

Circuit Diagram and Connections: 

https://circuitdigest.com/microcontroller-projects/arduino-ammeter 2/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code

The schematic diagram of the Arduino Ammeter Project is follows

(/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

Current Sensing Circuit:


This Ammeter circuit consists resistor and LED as load. Resistor is connected in series to the LED that current ows through the load and
voltage drops is determined from the resistor. The terminal V1, V2 are going to connect with the analog input of the Arduino.

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.

int voltage_value0 = analogRead(A0);


int voltage_value1 = analogRead(A1);

  

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.

int subraction_value =(voltage_value0 - voltage_value1) ;


float temp_val = (subraction_value*0.00488);
float current_value = (temp_val/22);

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

Arduino Based Ammeter

TAGS ARDUINO UNO (/TAGS/ARDUINO-UNO) ARDUINO (/TAGS/ARDUINO) AMMETER (/TAGS/AMMETER)

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)

Quote and Order boards in minutes on https://jlcpcb.com/quote (https://jlcpcb.com/quote)

Get Our Weekly Newsletter!


Subscribe below to receive most popular news, articles and DIY projects from Circuit Digest

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

Log in (/user/login?destination=node/1415%23comment-form) or register (/user/register?


destination=node/1415%23comment-form) to post comments

Michael
Sep 21, 2017

beautiful work and how it operate


Log in (/user/login?destination=node/1415%23comment-form) or register (/user/register?
destination=node/1415%23comment-form) to post comments

pavansai
Jan 18, 2018

can you give construction vedio


Log in (/user/login?destination=node/1415%23comment-form) or register (/user/register?
destination=node/1415%23comment-form) to post comments

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

Log in (/user/login?destination=node/1415%23comment-form) or register (/user/register?


destination=node/1415%23comment-form) to post comments
op-amp to increase the range of the circuit. Also refer

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

LOG IN (/USER/LOGIN?DESTINATION=NODE/1415%23COMMENT-FORM) OR REGISTER (/USER/REGISTER?


DESTINATION=NODE/1415%23COMMENT-FORM) TO POST COMMENT

TI WHITEPAPERS

https://circuitdigest.com/microcontroller-projects/arduino-ammeter 8/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code

NEWS ARTICLES PROJECTS

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)

Single-chip maXTouch Touchscreen Controllers for 20-inch Automotive Touchscreens (/news/single-chip-maxtouch-


touchscreen-controllers-for-20-inch-automotive-touchscreens)

(/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)

ACTIVE FORUM TOPICS 

https://circuitdigest.com/microcontroller-projects/arduino-ammeter 9/11
12/8/2018 Arduino Digital Ammeter Project with Circuit & Code

How to set the range of G force of Wireless Vibration Sensor (/forums/embedded/how-set-range-g-force-wireless-vibration-sensor)


(/users/snart-caleb) Snart Caleb (/users/snart-caleb) Replies: 1

why should //uint8_t, //uint16_t macro actually to be used !! (/forums/embedded/why-should-uint8t-uint16t-macro-actually-be-


used)
(/users/saj) saj (/users/saj) Replies: 2

is the same effect in updation of Timer 0 resister (/forums/embedded/same-effect-updation-timer-0-resister)


(/users/saj) saj (/users/saj) Replies: 3

Question about relays (/forums/general/question-about-relays)


(/users/kangyunmei) kangyunmei (/users/kangyunmei) Replies: 1

ADC (/forums/embedded/adc)
(/users/baiju) Baiju (/users/baiju) Replies: 3

Log in to post questions (/user/login?destination=node/add/forum)

User login
E-mail or username *

Password *

Create new account (/user/register)


Request new password (/user/password)

Log in

EV VIDEOS FLOW METER SPACE

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

Embedded Electronics (https://circuitdigest.com/embedded)

Power Electronics (https://circuitdigest.com/power-electronics)

Analog Electronics (https://circuitdigest.com/analog-electronics)

Internet of Things (https://circuitdigest.com/internet-of-things)

Audio Electronics (https://circuitdigest.com/audio-electronics)

POPULAR

ROBOTICS (/ROBOTICS-PROJECTS) 555 CIRCUITS (/555-TIMER-CIRCUITS) ARDUINO PROJECTS (/ARDUINO-PROJECTS)

RASPBERRY PI PROJECTS (/SIMPLE-RASPBERRY-PI-PROJECTS-FOR-BEGINNERS) ELECTRONICS NEWS (HTTPS://CIRCUITDIGEST.COM/NEWS)

ELECTRONICS FORUM (HTTPS://CIRCUITDIGEST.COM/FORUMS) CALCULATORS (HTTPS://CIRCUITDIGEST.COM/CALCULATORS)

NEWSLETTER

Sign Up for Latest News

Enter your email

Subscribe

Hardware Startup? (/hardware-start-up-listing)

Copyright © 2018 Circuit Digest (http://circuitdigest.com/). All rights reserved.

Privacy Policy (http://circuitdigest.com/privacy-policy) | Cookie Policy (https://circuitdigest.com/cookie-policy) | Terms of Use (https://circuitdigest.com/terms-of-


use) | Contact Us (http://circuitdigest.com/contact) | Advertise (http://circuitdigest.com/advertise)

https://circuitdigest.com/microcontroller-projects/arduino-ammeter 11/11

You might also like