# Digital Ammeter Using PIC Microcontroller 16F877A and Seven Segments Display (0 to 10A)

Ammeter is an instrument used for electric current measurement in a circuit. In an ammeter, the electric current passing through it are measured in Amperes (A). In the olden times, ammeters were just a laboratory instrument based upon 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 current flowing through a load/circuit and the seven segment display shows it digitally.

## Components Required

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

## Working

• PIC has 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 current. Current calculation may be 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 0.47Ω resistor is read by the ADC.
• Then the ADC value is multiplied by a constant called ADC constant for obtaining real value of 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 ADC value with a constant K.
In our case to get the real Vadc, multiply ADC input to a constant K (0.00489).
• This constant can be obtained from an equation,
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.

## Digital Ammeter Mikro C Program

I have compiled the program using MikroC pro. For program we are charging a small amount, by the way the .HEX file is free of cost. Mikro C program and Simulation for this Digital Ammeter is available at CG Program Store.

Next project will be Digital Voltmeter and Ammeter by combining Voltmeter and Ammeter circuits together. Till then keep visiting CircuitsGallery and check out other electronics projects.

## 7 thoughts on “Digital Ammeter Using PIC Microcontroller 16F877A and Seven Segments Display (0 to 10A)”

1. SOUMITRA SETH says:

Many Thank`s for PIC projects
Thank All.

• AFRAA says:

HOW I WRITE THE CODING TO DISPLAY CIRCUIT FOR PROJECT

2. Renjith says:

Good

3. amin markar says:

plzz send me the programming for digital voltmeter(0-30V).

• M.Azam says:

Thank you for your post.pls send me micro c programming for digital voltmeter and also ammeter.

4. sivakumar says: