You are on page 1of 3

Experiment # 6

Objective:

Design and Implement an Arduino-based Ammeter


Apparatus:
 Arduino Board (e.g., Arduino Uno)
 Breadboard and jumper wires
 Resistors (known values for calibration)
 Display device (LCD or Serial Monitor for output)
 Power source
Theory:
An ammeter is a measuring instrument used to quantify the flow of electric current in a circuit. It is
typically connected in series, allowing it to measure the total current passing through the circuit.
Ammeters come in analog and digital forms. In analog ammeters, the measurement is based on the
interaction between an electric current and a magnetic field, causing a needle or pointer to deflect.
Digital ammeters, on the other hand, convert the current into voltage, which is then
displayed digitally.
The principal functioning of an ammeter is based on the principles of electromagnetism and Ohm's
Law. When measuring electric current in a circuit, an ammeter is connected in series.

Circuit Diagram:

Fig:7 Arduino base ammeter


Procedure
 Connect the circuit

 Connect the resistor of a known value with Analog pin (A0) of the Arduino
Board.
 Connect the Arduino board with the computer.
 Write the Arduino code to read the analog input and convert it to current.
 Upload the code and display values on Arduino Serial Monitor

Code:
const int analogInputPin = A0; // Analog input pin connected to the shunt resistor
const float shuntResistance = 0.1; // Shunt resistor value in ohms (adjust based on your resistor)

void setup() {
Serial.begin(9600); // Initialize serial communication for debugging
}

void loop() {
int sensorValue = analogRead(analogInputPin); // Read analog input value
float voltage = sensorValue * (5.0 / 1023.0); // Convert analog value to voltage
float current = voltage / shuntResistance; // Use Ohm's Law to calculate current

Serial.print("Voltage: ");
Serial.print(voltage);
Serial.print(" V, Current: ");
Serial.print(current);
Serial.println(" A");

delay(1000); // Delay for readability and to prevent serial flooding


}
Observation and Calculation:

Actual Readings Experimental Readings


(mA) (mA)
0.20 0.20
0.25 0.28
0.30 0.28
0.35 0.34
0.50 0.54
1.00 1.22
1.50 1.56
2.00 2.02
2.50 2.52
3.00 3.02
3.50 3.52
4.00 4.02
4.50 4.52
5.00 4.98

Table : Readings for Ammeter

Conclusion:
In conclusion, an Arduino-based ammeter can be effectively implemented by connecting a shunt resistor
in series with the circuit, measuring the voltage drop across the resistor using an analog input pin on the
Arduino, and utilizing Ohm's Law to calculate the current. This straightforward approach provides a
basic ammeter functionality for hobbyist projects, educational purposes, or simple applications.
However, users should be mindful of potential inaccuracies and consider calibration against a known
current source for more precise measurements. The simplicity of this Arduino-based ammeter makes it
accessible for those with basic programming skills and a clear understanding of the electrical
components involved, offering a practical solution for current measurement in various
electronic projects.

You might also like