Professional Documents
Culture Documents
In this project, we used two types of displays namely 16×2 LCD and 4-digit
seven-segment display. In the first first section, we will see how to display a
value on LCD and in the second section, we will see how to display measured
voltage value on a 4-digit seven-segment display.
DC voltmeter with LCD display
Liquid crystal display is interfaced with the microcontroller to display measured
voltage value. Built-in analog to digital converter of pic microcontroller is used to
a measured analog voltage.
Recommended Reading
Before going further in this article about digital voltmeter using pic controller, you
should know how to interface LCD with pic16f877A microcontroller and how to
use analog to digital converter module of pic microcontroller. If you don’t know
read the following articles first:
LCD interfacing with PIC16F877A microcontroller
How to use ADC module of Pic Microcontroller
Analog voltage measurement using PIC16F877A microcontroller
ADC Channel
In this project, AN0/RA0 channel of the pic16F877A microcontroller is used. ADC
module of pic microcontroller converts an analog signal into binary numbers.
PIC16F877A microcontroller has a 10 bit ADC. So it converts an analog signal to
a 10-bit digital number which can be back converted into voltage using the
following calculation in the programming of digital voltmeter.
Simulation Result
Liquid crystal display is used to display values of voltage. As shown in the
figure below. The below diagram shows the result of the digital voltmeter using
the pic microcontroller and LCD display.
int Adread;
float voltage;
char volt[4];
void main() {
PORTA = 0;
TRISA = 0X01;
PORTB = 0;
TRISB = 0;
LCD_Init();
ADC_Init();
LCD_Cmd(_LCD_CURSOR_OFF);
LCD_Cmd(_LCD_CLEAR);
delay_ms(1000);
while (1)
voltage = ADC_Read(0);
Lcd_Out(2,1,"Voltage = ");
Lcd_Out(2,11,Ltrim(volt));
Lcd_Out(2,13,"Volt");
Code Working
Now let’s understand the working of code. First, we used ‘sbit’ to define pins connection with LCD and
PIC16F877A. These lines are used to define pic microcontroller pins that will be used with 16×2 LCD.
These code lines initialize built-in library of ADC module and liquid crystal dislpay.
LCD_Out(1, 1, "Digital voltmeter"); // print "Digital voltmeter"on first line and first row
This code is placed inside the while(1) loop function and it keeps executing. Inside this loop,
ADC_Read(0) reads analog input signal value from AN0/RA0 pins and store this value into a variable
“voltage”. Second line converts measured digital value back into analog voltage by multiplying voltage
variable with resolution factor and voltage divider scale down factor. After that we display voltage value
on LCD second line.
Before printing value on LCD, we first convert integer variable “voltage” into string by using inttostr()
routine.
voltage = ADC_Read(0);
inttostr(voltage,volt);
Lcd_Out(2,1,"Voltage = ");
Lcd_Out(2,11,Ltrim(volt));
Lcd_Out(2,13,"Volt");
This digital voltmeter using a pic can read voltage only between 0-40 volt. High voltage measurement
voltmeter can also be designed using pic microcontroller and difference amplifier. The difference
amplifier will be used to step down dc voltage instead of a voltage divider.
Digital DC Voltmeter using 7-Segment
Display and Pic Microcontroller
In this tutorial, we will design a digital voltmeter using a 7-segment display and
pic microcontroller. Usually, we use LCDs to display sensor data. In the last
tutorial, we designed a DC digital voltmeter with a 16×2 Liquid crystal display. But
in this post, instead of using LCD, we will use a four-digit 7-segment display to
print voltage value. We will use the ADC module of PIC16F877a microcontroller
to measure DC voltage.
Components Required
1. PIC16F877A Microcontroller
2. 4-digital Seven Segment Display
3. Resistors
4. Crystal Oscillator
5. Capacitors
6. NPN transistors
Digital Voltmeter with 7-segment display
circuit diagram
A picture below shows the circuit diagram of DC voltmeter with four digit seven-
segment display and voltage divider circuits interfacing with PIC16F877A
microcontroller. But you can use any other pic microcontroller also.
How to measure DC voltage?
Firstly, lets discuss do we need to use a voltage divider circuit. The simple and
basic reason to use voltage divider circuit is that pic microcontroller operating
voltage is between 0-5 volts. Hence, built-in ADC module of PIC16F877A
microcontroller can read analog signal in the range 0 to 5 volts only. Therefore, in
order to measure dc voltages higher than this level, we need come up with a
solution to step down input voltage. This is the reason a voltage divider circuit is
required in this project.
A voltage divider circuit as its name suggests divides the voltage between across
two resistors. As you can see from the above circuit of dc voltmeter, we used two
resistors
R9 = 180K
R7 =20k
For example, if input voltage is 19 volts, the output voltage will be:
1.9 volts is less than 5 volts. Therefore, we can measure this voltage with ADC of PIC16F877A
microcontroller. If you see from the voltage divider formula, the voltage step down or reduction factor is
20/200 = 1/10
Step down factor = 1/10
We can use this reduction factor in our programming to get actual voltage by measuring only the output
voltage of voltage divider. We will measure step -down voltage that is the output of voltage divider
circuit. But, inside our program, we will multiply measured voltage value with the reduction factor to get
actual value of input voltage.
We used analog channel AN0/RA0 of PIC16F877A microcontroller. We have already post a guide on how
to use analog digital module of Pic Microcontroller, you can read this post:
As you know that there are two types of 7-segment displays: namely common anode and common
cathode type. We will use a common cathode type 4-digit device to display measure voltage value.
Connect PORTD with A-g pins of 4-digital seven-segment display using 330ohm current limiting resistors.
Also connect RB0-RB3 pins of PORTB with control pins 1-4 of display device. Same data lines are used to
send binary pattern to each digit of display device, but control lines select that at which place (7-
segment) we want to display a digit.
To explore further on 7-segment displays interfacing with pic microcontrollers, go through these in-
depth guides:
This circuit is simulated with proteus. As you can see, we connect a 50 volts DC source with a voltage
divider circuit through a variable resistor. We use this variable resistor to apply a variable voltage to the
circuit.
We can observe the same voltage on a 4-digit seven-segment device according to the input voltage
variation.
MikroC Code
This code is written using MikroC for Pic compiler. Create a new project with MikroC compiler by
selecting PIC16F877A microcontroller and set frequency to 8MHz. If you don’t know how create new
project in mikroC, we suggest you read this post:
After creating a new project with MikroC, set configuration bits to these values:
After that copy this code and compile it with MikroC for Pic compiler.
// This array stores binary bit pattern that will be send to PORTD
long tlong;
void get_digits()
void display_voltage()
{
PORTD = binary_pattern[a2]; // send 1000's place data to fourth digit
delay_ms(3);
delay_ms(3);
delay_ms(3);
delay_ms(3);
void interrupt()
void main(void)
digit1 = 1;
digit2 = 1;
digit3 = 1;
digit4 = 1;
while(1)
tlong = (float)adc_value*0.488768555;
voltage = tlong;
This code is for MPLAB XC8 Compiler. If you don’t know how to use MPLAB and XC8 compiler, you can
read this complete in-depth guide:
After creating a new project, set configuration bits by generating configuration bit file with MPLAB XC8.
While generating this file, select the HS crystal option and leave the remaining setting as to default
settings.
#include <xc.h>
// This array stores binary bit pattern that will be send to PORTD
long tlong;
void Analog_setting(){
ADCON0 = 0x81;
ADCON1 = 0x02;
if(channel>7)return 0;
__delay_ms(2);
ADCON0bits.GO_DONE = 1;
while(ADCON0bits.GO_DONE);
aadc = ADRESH;
aadc = aadc<<2;
bbdc = ADRESL;
ccdc = aadc|bbdc;
return ccdc;
void main(void)
Analog_setting();
TRISB=0X00;
digit1 = 1;
digit2 = 1;
digit3 = 1;
digit4 = 1;
while(1)
tlong = (float)adc_value*0.488768555;
voltage = tlong;
__delay_ms(3);
__delay_ms(3);
__delay_ms(3);
__delay_ms(3);
return ;
You have come across many online tutorials on various websites about voltage measurement using
different microcontrollers. But all these tutorials are about measurement of low DC voltage. In this
project, you will learn how to measure high AC voltage using PIC16f877A micrcontroller.
Alternating Voltage Measurement using Difference Amplifier Method and Pic Microcontroller
To measure 220V AC, it is necessary to step down the voltage as microcontrollers are unable to measure
voltages greater than 5V. Applying a voltage higher than 5V to the analog input of a microcontroller can
result in permanent damage. Thus, in order to protect the microcontroller, it is crucial to step down the
220V AC voltage to an AC voltage with a peak value lower than 5V. For instance, 220V AC represents the
RMS voltage, with a corresponding peak value of 311 volts. Therefore, it is essential to reduce the high
AC voltage to a level where its peak value does not exceed 5 volts.
There are two methods to step down 220 alternating voltage into low alternating voltage whose peak
value should not be greater than 5 volts.
Potential Transformer ( All Electrical Engineering students must know about P.T and its use)
Difference amplifier ( We will discuss the difference amplifier method in this project.)
The Potential Transformer is capable of stepping down 220 Alternating current voltage. However, why
would you want to spend more money when you can achieve this using inexpensive operational
amplifiers and just a few resistors? The difference amplifier method proves to be more economical than
using a Potential Transformer when stepping down voltages below 400 volts AC.
NOTE: Difference amplifier method is economical for voltage measurement less than 400 volt. Because
above 400 volt, this method become expensive than potential Transformer. There are reasons behind
it. I am not going to discuss reasons here.This method is suitable for final year students who want to
measure Alternating voltage and current.
The difference amplifier is a circuit used to amplify voltage between two different voltage levels. When
dealing with alternating voltage, there are two distinct voltage levels: one is positive relative to neutral,
and the other is negative relative to neutral. For more detailed information on the difference amplifier
and its applications, I would suggest conducting a search on Google.
You can adjust the gain of the difference amplifier according to your requirements by selecting the
proper values of resistors. In this project, the gain is equal to:
In the above picture, resistors R1, R2, R3, R4, and R5 have high values, which prevent high voltage from
appearing across the op-amp. The use of high input resistors ensures that the current is in the
microampere range, resulting in low power loss in the milliwatt range. According to the difference
amplifier gain formula, the gain can be calculated as follows:
NOTE: Please make sure to calculate the peak value of the sine wave, as the peak voltage is the
maximum voltage input to the microcontroller’s analog pin. Therefore, with a gain of 0.0091 in respect
to the peak voltage of the sine wave, the output voltage from the op-amp is:
In the figure above, we can observe that the other terminal of R7 is connected to the 5-volt supply
instead of the ground, which is typically done when using a differential amplifier in various applications.
The purpose of the R7 resistor is to raise the DC voltage level at the output of the op-amp. Since a sine
wave has a zero DC voltage level and negative voltage cycle, it becomes important to increase the DC
level of the sine wave by 5 volts. By doing so, we prevent any negative voltage from appearing across
the microcontroller. Consequently, the output peak voltage from the op-amp becomes 5 volts plus
2.8301 volts, resulting in a total of 7.8301 volts. However, it is important to note that microcontrollers
are unable to measure voltages greater than 5 volts. To address this, as illustrated in the figure above, a
voltage divider is employed to divide the output voltage by 2. This ensures that the output voltage level
is within the microcontroller’s measurement range.
Capacitors C1, C2, and C3 are used to filter harmonics from the input voltage and to provide protection
to the microcontroller from harmonics. Now, the AN pin can be connected to the microcontroller analog
pin to measure voltage easily.
To know about how to measure analog voltage using the analog module of the PIC16F877A
microcontroller, go through the PIC microcontrollers tutorials.
Circuit Diagram
To know about LCD interfacing with PIC microcontrollers, go through PIC microcontrollers tutorials.
Code for this project is written using MikroC. To download code for AC voltage measurement click on
the link below:
float v;
char txt[5];
char txt1[5];
void voltage_READ(void)
{
float max;
int i;
int t[40];
ADCON0.ADON=1;
v =v*(10.0/1023.0);
v=(v-5.0);
t[i]=v*110.1909091;
ADCON0.ADON=0;
max=t[0];
if(max<t[i])
max=t[i];
max=max*.707106781;
intToStr(max, txt);
Lcd_out(1,9,txt);
delay_ms(1000);
void main()
ADCON0.ADCS1=1;
ADCON0.ADCS1=0;
ADCON0.ADON=0;
while(1)
Lcd_out(1,1, "Voltage:");
voltage_READ();
In this section, we will see how to measure AC voltage using a potential transformer and Pic
Microcontroller. In the last section, we have seen how to use an operational amplifier as a difference
amplifier to step down AC voltage level from 220 volts AC to less than 5 volts AC. Here, we will delve
further into the process of measuring AC voltage with the help of a potential transformer and a Pic
Microcontroller. Understanding the intricacies and the practical applications of this setup is essential for
accurate voltage measurements. By following the steps mentioned in the previous section, we can
ensure that the AC voltage is accurately measured with the help of the potential transformer and Pic
Microcontroller.
AC voltage measurement using potential transformer and digital display (I will discuss this
method in this tutorial)
As I have already discussed in this project, I will be using potential transformer to step down 220volt ac
voltage to less than 5 volt ac. I will discuss it later why we need to step down ac voltage to measure it
with the help of pic microcontroller.
Components required
Followings are the main components of ac voltage measurement project. Brief descriptions of all
components are also given below:
Potential transformer
Bridge rectifier
A potential transformer, also known as a voltage transformer, is a specific type of transformer that is
used to decrease or “step down” the magnitude of AC voltage. Its primary purpose is to measure high
voltage levels by transforming them into lower, more manageable values.
In this project, the potential transformer plays a crucial role in reducing the voltage from 220 volts AC to
12 volts AC. By utilizing a carefully calculated turns ratio, the secondary winding of the potential
transformer consists of fewer turns than its primary winding, resulting in a significant decrease in
voltage.
The turning ratio formula serves as a fundamental guideline for determining the appropriate number of
winding turns, allowing the potential transformer to effectively step down the alternating current
voltage and facilitate safe and accurate voltage measurement.
Ns/Np = Vs/Vp
The bridge rectifier is an electronic circuit used to convert AC voltage into pulsating DC voltage.
Essentially, it transforms the negative cycle of AC voltage into a positive cycle. So why do we need a
bridge rectifier in this project? It’s because microcontrollers are unable to read negative voltage.
Consequently, we must convert the negative half cycle of AC voltage into a positive cycle. The bridge
rectifier is constructed by connecting rectifier diodes in a specific arrangement to form a bridge. For this
purpose, we employ 1N4007 rectifier diodes to create an H Bridge.
The voltage divider circuit, as the name suggests, is used to divide voltage. It employs two resistors to
achieve this. In this setup, a potential transformer steps down the 220V AC voltage to 12V AC. To
convert the 12V AC into pulsating DC, a bridge rectifier is used. However, it is important to note that
microcontrollers can only read voltages up to 5V. Therefore, the voltage divider circuit further divides
the voltage into two parts, ensuring that less than 5V appears across the analog-to-digital converter pin
of the PIC microcontroller. We will discuss the analog-to-digital converter in more detail later.
Liquid crystal display or LCD is used to used to display value of measured ac voltage. 16X2 LCD is used in
this project. LCD is interfaced with pic16f877a microcontroller. IF you don’t know how to interface LCD
with PIC16F877A microcontroller, check following article:
LCD interfacing with pic16f877a microcontroller
PIC16F877A microcontroller
PIC16F877A microcontroller is used in this project. PIC16F877A microcontroller is belongs to 16F family
of pic microcontrollers. It have built in analog to digital converters module. Some of basic features of
PIC16F877A microcontroller is given below:
Comparator modules
Serial communication
UART communication
For more information about pic16f877a microcontroller features and if you are new to microcontroller’s
worlds, check following article.
The circuit diagram for measuring AC voltage is presented below. In this section, we have discussed all
the components of this project.
The input to the circuit is a 220-volt AC voltage. A potential transformer is used to step down the voltage
from 220 volts AC to 12 volts AC. After that, a bridge rectifier converts the stepped-down AC voltage into
pulsating DC voltage. A voltage divider is then used to further divide the voltage into two parts.
The voltage of less than 5 volts appears across the analog-to-digital converter pin of the PIC16F877A
microcontroller. Microcontrollers are essentially small microcomputers that only understand digital
values. The built-in analog-to-digital converter module of the PIC16F877A microcontroller converts the
analog values of the AC voltage into digital values. These digital values are then used in processing the
data within the microcontroller.
Instructions written in the form of code instruct the microcontroller on what to do. The microcontroller
itself does not perform any tasks on its own. You need to provide it with instructions by writing a
program that outlines what you want it to do.
Proteus Simulation
The diagram below shows the simulation results of an AC voltage measurement project. The LCD
displays a reading of 220 volts AC, which is measured using a microcontroller and the necessary
components connected to it, including a potential transformer.
float maxpoint = 0;
int i;
char ch[5];
void main()
ADC_Init();
Lcd_Init();
Lcd_Out(1,1,"AC voltage");
for(i=0;i<500;i++)
if(temp = ADC_Read(0),temp>maxpoint)
maxpoint = temp;
maxpoint = maxpoint * 4;
intToStr(maxpoint, ch);
lcd_out(2,1, Ltrim(ch));
maxpoint = 0;
}// while
These lines define the connections of the LCD module to the microcontroller’s pins. sbit stands for
“single bit” and is used to specify the pin connections for the LCD control and data lines.
These lines define the direction of the LCD pins. TRISBx_bit are used to configure the corresponding pins
as input (1) or output (0). These lines specify that RB2 (LCD_RS), RB3 (LCD_EN), RB4 (LCD_D4), RB5
(LCD_D5), RB6 (LCD_D6), and RB7 (LCD_D7) are configured as outputs, so they will be used to control
the LCD.
These lines declare some variables used in the main function. maxpoint is a floating-point variable to
store the maximum voltage value measured. i is an integer variable used as a loop counter. temp is an
unsigned integer variable used to store the ADC reading. ch is an array of characters used to store the
string representation of the voltage value.
float maxpoint = 0;
int i;
char ch[5];
In the main function, after initializing the LCD, it enters an infinite loop (while(1)). The loop does the
following:
Displays “AC voltage” on the first line of the LCD using Lcd_Out.
It then starts a for loop that runs 500 times (from i = 0 to i < 500).
Inside the loop, it reads an analog voltage value from channel 0 of the ADC using ADC_Read(0)
and stores it in the variable temp.
It then compares temp with the current maxpoint value, and if temp is greater, it updates
maxpoint with the new value. This is done to find the maximum voltage value among the 500
readings.
After the loop, it processes the maxpoint value to convert it into an AC voltage value. The exact
formula used for conversion is defined above.
The converted voltage value is then converted into a string using intToStr and stored in the ch
array.
The voltage value is displayed on the second line of the LCD using lcd_out.
In summary, in this tutorial, we have learned how to measure AC voltage using two different methods
and a PIC microcontroller.
After reading this, you will be able to design AC Ammeter using PIC16F877A microcontroller. It is a very
important task in pic microcontroller projects. I have already posted a dc current measurement
circuit with code. you can also read it.
In the first section, we will provide details of the current transformer. In the next section, we will talk
about measuring voltage from the secondary side of the CT. After that, the working of the code will be
explained.
Current transformers (CTs) measure an alternating high current of the order of thousands of Amperes.
They step down AC current to a lower value, making it easily readable with the help of a microcontroller.
The ability to step down current depends on the rating and current step-down ratio of the current
transformer.
Suppose you have a current transformer with a current ratio of 100:10 Amperes. Its mean primary
current of the transformer is 100 Amperes, and the secondary current is 10 Amperes. You cannot use
this current transformer to measure current higher than 100 Amperes.
By measuring the low current on the secondary side, we can easily convert it into the primary current
value by using the current ratio formula. I will discuss in the latter part of this discussion how to use this
step-down ratio in the programming part.
We cannot measure current directly. Firstly, we convert the secondary side current into voltage. We can
use a known value of a resistor load. We measure the voltage across this known resistor. After that, we
can convert this measured voltage into the current. We can use Ohm’s Law formula to convert the
voltage into the current.
V=IR
I = V/R
As you can see in this circuit diagram, we use an R1 load resistor to convert current into voltage. In this
circuit, a voltage divider is used, but we can also use an operational amplifier to step down the voltage
across the load resistor.
For example, let’s say you want to create a current protection circuit and the circuit specifications are as
follows:
If the current flowing through a line is greater than 100 Ampere, a control action should be performed
to operate a relay.
To create such an intelligent system, we can use analog and digital electronics, but it is better to opt for
digital electronics considering cost constraints. In this tutorial, we will be utilizing a PIC microcontroller,
specifically the PIC16F877A, to measure alternating current.
You can check about the PIC16F877A pinout and its features on this link.
Hardware components
1. PIC16f877A
2. CT
The operational amplifier acts as a voltage level-shifting circuit or difference amplifier. You can go
through this guide on AC voltage measurement to understand its workings.
To measure AC current with a PIC microcontroller, we have to use the ADC module of the PIC
microcontroller. To use the ADC module, we will convert current into voltage form by using a 0.1-ohm
shunt resistor across CT, and we will measure the voltage drop across the shunt resistor. This voltage
drop can then be easily converted back into current. For example, the voltage drop across a 0.1-ohm
shunt resistor is 8V.
V=IR
I=V/R
I=8/.1=8A
However, the problem is the ADC of the PIC microcontroller can never measure a voltage greater than 5
volts. Therefore, to solve this problem, we can use difference amplifiers. Because by adjusting the gain
of the difference amplifier, we can reduce the voltage lower than 5 volts. The following diagram shows
the circuit of CT and difference amplifier interfacing. You can use any op-amp such as LM741, TL074.
This is a circuit diagram of interfacing the current sensor with a PIC microcontroller. Connect the
secondary side of CT to the points shown on the schematic. After that, connect the shunt resistor in
parallel with the current sensor. The difference amplifier circuit converts voltage below a 5-volt
magnitude. It also shifts the level of AC voltage from the negative side to the positive side. Connect the
output of the difference amplifier with RA1 or analog channel one of the PIC16F877A.
The liquid crystal display shows the values of the current. We use PORTB to connect LCD. You can go
through this LCD interfacing guide.
This code is for a PIC microcontroller to measure and display the current using an analog current
measurement circuit.
The code for this project is written in the MIKROC compiler. If you do not know how to use MikroC for
Pic, you can refer to these tutorials:
void current_READ(void)
{
float max;
int i, current;
int t[40];
v = ADC_Read(1);
v = v * (10.0 / 1023.0);
v = (v - 5.0);
t[i] = v * 10;
max = t[0];
max = t[i];
delay_ms(1000);
void main()
ADCON0.ADCS1 = 1;
ADCON1.ADCS2 = 1;
ADCON0.ADON = 0;
while(1)
delay_ms(1000);
This section defines the connections between the LCD display and the microcontroller’s PORTB pins. The
code configures the connections between the LCD display and the PIC microcontroller’s PORTB pins (RB2
to RB7) for data and control signals. It also sets the direction of these pins as digital outputs.
This section sets the direction of the PORTB pins as output, which allows them to communicate with the
LCD display.
It declares two global variables: float v to store measurement results, and char txt1[] (not shown in the
provided code) to store text for display on the LCD.
This function current_READ() is responsible for reading the voltage values from the ADC and calculating
the peak and RMS currents. It uses a loop to read the ADC values 40 times and stores them in an
array t[]. The maximum value from the array is then taken as the peak value and converted to RMS by
multiplying it with 0.707106781. Finally, the measured current value is converted to a string and
displayed on the LCD.
void current_READ(void)
float max;
int i, current;
int t[40];
v = ADC_Read(1);
v = v * (10.0 / 1023.0);
v = (v - 5.0);
t[i] = v * 10;
max = t[0];
for(i = 0; i <= 39; i++)
max = t[i];
delay_ms(1000);
The main() function is the entry point of the code. It initializes the LCD display using Lcd_Init() a function.
The ADC conversion clock is set and the ADC module is disabled initially. Inside the infinite while loop,
the text “Current:” is displayed on the LCD, and the current_READ() function is called to measure and
display the current value. There is a delay of 1 second before each iteration of the loop.
void main()
ADCON0.ADCS0 = 1;
ADCON0.ADCS1 = 1;
ADCON1.ADCS2 = 1;
ADCON0.ADON = 0;
while(1)
delay_ms(1000);
}
The code continuously measures and displays the RMS current value on an LCD screen. It assumes that
an external circuit with a shunt resistor and appropriate signal conditioning provides an AC voltage
signal to be measured by the PIC microcontroller’s ADC. The code displays the measured current value
on the LCD for monitoring purposes.
Video demo:
Conclusion
In conclusion, this article has provided a comprehensive guide to designing an AC ammeter using a PIC
microcontroller. The tutorial covered the fundamentals of current transformers, the process of
interfacing a current transformer with the PIC16F877A microcontroller, and writing the necessary code
for AC current measurement. By following the instructions and understanding the concepts presented,
readers now have the knowledge and skills to create their own AC ammeter for their PIC microcontroller
projects.