• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos | Circuits for Beginners | Basic Circuits | Hobby Projects | Transistor Circuits | LED Drivers 

You are here: Home / Arduino Engineering Projects / Make this Advanced Digital Ammeter using Arduino

Make this Advanced Digital Ammeter using Arduino

Last Updated on June 26, 2019 by Swagatam

caution electricity can be dangerous

In this post we are going to construct a digital ammeter using 16 x 2 LCD display and Arduino. We will understand the methodology of measuring current using a shunt resistor and implement a design based on Arduino. The proposed digital ammeter can measure current ranging from 0 to 2 Ampere (absolute maximum) with reasonable accuracy.

How Ammeters Work

There are two types of ammeters: Analog and digital, their workings are way different from each other. But, they both have one concept in common: A shunt resistor.

A shunt resistor is a resistor with very small resistance placed between the source and the load while measuring the current.

Let’s see how an analog ammeter works and then it will be easier to understand the digital one.

how an analog ammeter works

A shunt resistor with very low resistance R and assume some kind analog meter is connected across the resistor who’s deflection is directly proportional to voltage through the analog meter.

Now let’s pass some amount of current from left hand side. i1 is the current before entering the shunt resistor R and i2 will be the current after passing through shunt resistor.

The current i1 will be greater than i2 since it dropped a fraction of current through shunt resistor. The current difference between the shunt resistor develops very small amount of voltage at V1 and V2.
The amount of voltage will be measured by that analog meter.

The voltage developed across the shunt resistor depends on two factors: the current flowing through the shunt resistor and the value of the shunt resistor.

If the current flow is greater through the shunt the voltage developed is more. If the value of the shunt is high the voltage developed across the shunt is more.

The shunt resistor must be very tiny value and it must possess higher wattage rating.

A small value resistor ensures that the load is getting adequate amount of current and voltage for normal operation.

Also the shunt resistor must have higher wattage rating so that it can tolerate the higher temperature while measuring the current. Higher the current through the shunt more the heat is generated.

By now you would have got the basic idea, how an analog meter works. Now let’s move on to digital design.

By now we know that a resistor will produce a voltage if there is a current flow. From the diagram V1 and V2 are the points, where we take the voltage samples to the microcontroller.

Calculating Voltage to Current Conversion

Now let’s see the simple math, how can we convert the produced voltage to current.

The ohm’s law: I = V/R

We know the value of the shunt resistor R and it will be entered in the program.

The voltage produced across the shunt resistor is:

V = V1 – V2

Or

V = V2 – V1 (to avoid negative symbol while measuring and also negative symbol depend on direction of current flow)

So we can simplify the equation,

I = (V1 – V2)/R
Or
I = (V2 - V1)/R

One of the above equations will be entered in the code and we can find the current flow and will be displayed in the LCD.

Now let’s see how to choose the shunt resistor value.

The Arduino has built in 10 bit analog to digital converter (ADC). It can detect from 0 to 5V in 0 to 1024 steps or voltage levels.

So the resolution of this ADC will be 5/1024 = 0.00488 volt or 4.88 millivolt per step.

So 4.88 millivolt/2 mA (minimum resolution of ammeter) = 2.44 or 2.5 ohm resistor.

We can use four 10 ohm, 2 Watt resistor in parallel to get 2.5 ohm which was tested in the prototype.

So, how can we say the maximum measurable range of the proposed ammeter which is 2 Ampere.

The ADC can measure from 0 to 5 V only i.e. . Anything above will damage the ADC in the microcontroller.

From the tested prototype what we have observed that, at the two analog inputs from point V1 and V2; when the current measured value X mA, the analog voltage reads X/2 (in serial monitor).

Say for example, if the ammeter reads 500 mA the analog values on serial monitor reads 250 steps or voltage levels. The ADC can tolerate up to 1024 steps or 5 V maximum, So when the ammeter reads 2000 mA, the serial monitor reads 1000 steps approx. which is near to 1024.

Anything above 1024 voltage level will damage the ADC in Arduino. To avoid this just before 2000 mA a warning message will prompt on LCD saying to disconnect the circuit.

By now you would have understood how the proposed ammeter works.

Now let’s move on to constructional details.

Schematic diagram:

Arduino DC Digital Ammeter

The proposed circuit is very simple and beginner friendly. Construct as per the circuit diagram. Adjust the 10K potentiometer to adjust display contrast.

You can power the Arduino from USB or via DC jack with 9 V batteries. Four 2 watt resistors will dissipate the heat evenly than using one 2.5 ohm resistor with 8- 10 watt resistor.

When no current is passing the display may read some small random value which you may ignore it, this might be due to stray voltage across measuring terminals.

NOTE: Don’t reverse the input load supply polarity.

Program Code:

//------------------Program Developed by R.GIRISH------------------//
#include <LiquidCrystal.h>
#define input_1 A0
#define input_2 A1
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int AnalogValue = 0;
int PeakVoltage = 0;
float AverageVoltage = 0;
float input_A0 = 0;
float input_A1 = 0;
float output = 0;
float Resolution = 0.00488;
unsigned long sample = 0;
int threshold = 1000;
void setup()
{
lcd.begin(16,2);
Serial.begin(9600);
}
void loop()
{
PeakVoltage = 0;
for(sample = 0; sample < 5000; sample ++)
{
AnalogValue = analogRead(input_1);
if(PeakVoltage < AnalogValue)
{
PeakVoltage = AnalogValue;
}
else
{
delayMicroseconds(10);
}
}
input_A0 = PeakVoltage * Resolution;
PeakVoltage = 0;
for(sample = 0; sample < 5000; sample ++)
{
AnalogValue = analogRead(input_2);
if(PeakVoltage < AnalogValue)
{
PeakVoltage = AnalogValue;
}
else
{
delayMicroseconds(10);
}
}
input_A1 = PeakVoltage * Resolution;
output = (input_A0 - input_A1) * 100;
output = output * 4;
while(analogRead(input_A0) >= threshold)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Reached Maximum");
lcd.setCursor(0,1);
lcd.print("Limit!!!");
delay(1000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Disconnect now!!");
delay(1000);
}
while(analogRead(input_A0) >= threshold)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Reached Maximum");
lcd.setCursor(0,1);
lcd.print("Limit!!!");
delay(1000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Disconnect now!!");
delay(1000);
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print("DIGITAL AMMETER");
lcd.setCursor(0,1);
lcd.print(output);
lcd.print(" mA");
Serial.print("Volatge Level at A0 = ");
Serial.println(analogRead(input_A0));
Serial.print("Volatge Level at A1 = ");
Serial.println(analogRead(input_A1));
Serial.println("------------------------------");
delay(1000);
}
//------------------Program Developed by R.GIRISH------------------//

If you have any specific question regarding this Arduino based digital ammeter circuit project, please express in the comment section, you may receive a quick reply.

You'll also like:

  • 1.  Simple Frequency Meter Circuits – Analogue Designs
  • 2.  Make this 7 Segment Digital Clock with Beep Alert Circuit
  • 3.  Arduino Frequency Meter Using 16×2 Display
  • 4.  How to Interface Servo motors with Arduino
  • 5.  Grid Dip Meter Circuit
  • 6.  Wireless Thermometer Using 433 MHz RF Link Using Arduino

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Have Questions? Please Comment below to Solve your Queries! Comments must be Related to the above Topic!!

9 Comments
Newest
Oldest
Inline Feedbacks
View all comments

Primary Sidebar

Calculators

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (114)
  • Battery Chargers (82)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (100)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (116)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (102)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (65)
  • Mini Projects (148)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (77)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (61)
  • Sensors and Detectors (120)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations

wpDiscuz