Thursday, 5 March 2020

Arduino based Digital Ammeter


Ammeter is used to measure current flow 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 find the current pass through the device we just rearrange the equation as below, or we can calculate with ohm's law calculator.

I = V / R

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

Voltage
Resistance
We are going to build a series resistance along with the device. As we need to find 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.

Required Components:

Arduino Uno.
Resistor 22Ω.
LCD 16x2.
LED.
10K pot.
Breadboard.
Multimeter.
Jumper cables.




Circuit Diagram and Connections:
The schematic diagram of the Arduino Ammeter Project is follows

 

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 first 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.



Arduino Code:
Complete code for arduino based ammeter to measure current, is given at the end of this article.


#include
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) ;
 float temp_val = (subraction_value*0.00488);

 float 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);
}



No comments: