An ammeter is an instrument used for electric current measurement in a circuit. In an ammeter, the electric current passing through it is measured in Amperes (A). In the olden times, ammeters were just laboratory instruments based on the earth’s magnetic field. By the late 19th century, little more improved instruments were designed which could be attached in any position and began to give accurate measurements. Then it was the era of digital ammeters in which the current flowing is shown through digital displays.

Here is a Digital Ampere meter Using PIC Microcontroller 16F877A and Seven Segments Display (0 to 10 A). As the name suggests, this Digital ammeter project measures the current from 1 to 10 Amperes and is a PIC Microcontroller 16F877A based ammeter that uses seven segment display along with it. It can be used easily to measure the current flowing through a load/circuit and the seven-segment display shows it digitally.

## Circuit Schematics of Digital Ammeter Using Pic Microcontroller

Where the load is an LED, you can connect any load.

## Components Required

- PIC16F877A
- Transistor (BC548 x8)
- Resistor (1K x8, 10K, 100K x2, 22K, 330 x2, 0.47/2W)
- Seven segment Display x8
- Crystal (20MHz)
- Capacitor (10uF, 33PF x2)

## Working

- PIC has an internal ADC (Analog to Digital Converter) Module, which we have used here to read the analog current value.
- In our digital voltmeter article, we have seen the calculation of voltage via potential divider networks. Now let’s see the mathematical calculation of the current. The current calculation may be a little bit confusing as compared to voltage.
- ADC module of PIC can measure 0 to +5V since the Vcc is +5V DC.

## Calculating Current Through the Load

- Input current is not directly fed to the microcontroller used in this Digital Ammeter circuit project, it’s reduced by a 0.47Ω resistor; the voltage drop across the 0.47Ω resistor is read by the ADC.
- Then the ADC value is multiplied by a constant called the ADC constant for obtaining the real value of the current.

## Mapping Adc Value to Input Current

- The output of 10-bit PIC Microcontroller ADC may vary from 0 to 1023 while input varies from 0 to +5V.
- Hence we have to map 0 → 1023 to 0 → 5 which can be done by multiplying the ADC value with a constant K.

In our case to get the real V_{adc}, multiply ADC input to a constant K (0.00489). - This constant can be obtained from an equation,

For example consider ADC value is 1023 (Vadc=5V& v = 10233)

Multiply this 10.63 by 100 to get 1063. These values can be separated and displayed on seven segment screen.

## Separating Values

Well we have 1063, the real value is 10.63, so enable dot (.) segment in second display unit.

Then do modular division,

1063%10 = 3

(1063/10)%10 = 6

(1063/100)%10 = 0

(1063/1000)%10 = 1

Hence we separated all the digits. Now send those digits to seven segment display by the technique of seven-segment multiplexing.

## Conclusion

Having an ammeter is a must for any electronic enthusiast. If you don’t have any you can easily made your own using PIC microcontroller following the above article.

## Leave a Reply