Design of Digital Voltmeter For AC Voltage Measurement Using PIC Microcontroller

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

International Journal of Science and Research (IJSR)

ISSN (Online): 2319-7064


Index Copernicus Value (2015): 78.96 | Impact Factor (2015): 6.391

Design of Digital Voltmeter for AC Voltage


Measurement Using PIC Microcontroller
Shagun Malhotra1, Abhishek Verma2, Twishish Shrimali3
1
Electronics Design Engineer, R&D Department, Vinytics Peripherals Pvt. Ltd, New Delhi, India
2
Senior Design Consultant, R&D Department, Vinytics Peripherals Pvt. Ltd, New Delhi, India
3
Software Developer, R&D Department, Vinytics Peripherals Pvt. Ltd, New Delhi, India

Abstract: This article describes the design of a digital voltmeter for AC voltage measurement using PIC microcontroller. This design
uses the PIC microcontroller, rectifier, voltage divider and seven segment displays to complete the desired measurement. We are using
our microcontroller programming skills as well as our circuit designing expertise for the required design. This meter is calibrated for the
measurement of upto 500 volts AC. Here we are using PIC microcontroller because this is having an internal ADC, however any other
microcontroller can be used with or without internal ADC. But separate ADC is required if microcontroller used is without internal
ADC.

Keywords: PIC 16F876 Microcontroller, Seven Segment Display, AC to DC Conversion, Voltage Divider

1. Introduction calibrated to the actual measured voltage. This voltage is


displayed through a 7- segment LED display unit.
A voltmeter is an instrument used for measuring electrical
potential difference between two points in an electric circuit. The system architecture of a Digital Voltmeter (DVM) is
Analog voltmeters have a pointer across a scale in proportion shown below (Figure 1) through a simplified block diagram.
to the voltage of the circuit; digital voltmeters give a It consists of a microcontroller module which regulates the
numerical display of voltage by use of an analog to digital entire reading of value and display activity for the system.
converter. A digital voltmeter (DVM) measures an unknown This proposed system also having few more hardware
input voltage by converting the voltage to a digital value and sections like voltage divider, rectifier, and switching of seven
then displays the voltage in numeric form. DVMs are usually segment displays.
designed around a special type of analog-to-digital converter
called an integrating converter. The first digital voltmeter
was invented and produced by Andrew Kay of Non-Linear
Systems (and later founder of Kaypro) in 1954 [6]. DVM
measurement accuracy is affected by many factors, including
temperature, input impedance, and DVM power supply
voltage variations. However this implementation is quite
rugged and very much reliable.

2. Objectives
The objective for this project is to design a digital voltmeter
for AC measurement upto 500 volts, which is one of the
general requirements for any electrical circuit. In order to
increase accuracy and repeatability this circuit is designed
using a microcontroller which also minimize the other
electronic circuitry. Thus this design will improve the overall
performance of the voltmeter.

3. System Architecture
This paper will describe how to make a simple digital
voltmeter using a PIC16F876 microcontroller. The range of
this DVM is 0-500V, but the range can be decreased based
on the requirements by using the hardware circuit needs
described in this project. The PIC microcontroller reads the Figure 1: Block Diagram of Digital Voltmeter
input voltage through one of the 5 analog channels and
converts it to a 10-bit digital number using the internal ADC. a) PIC 16F876 Microcontroller
By manipulating the output of the ADC this value can be The PIC16F876A-I/SP is an 8-bit enhanced Flash
Microcontroller with low-power, high-speed flash/EEPROM
Volume 6 Issue 2, February 2017
www.ijsr.net
Licensed Under Creative Commons Attribution CC BY
Paper ID: ART2017579 154
International Journal of Science and Research (IJSR)
ISSN (Online): 2319-7064
Index Copernicus Value (2015): 78.96 | Impact Factor (2015): 6.391
technology. It features 256bytes of EEPROM data memory, common pin is cathode or anode seven segment displays can
self programming, an ICD, 2 comparators, 5 channels of 10- be either named as common cathode or common anode
bit Analogue-to-Digital (A/D) converter, 2 display respectively.
capture/compare/PWM functions, the synchronous serial port
can be configured as either 3-wire serial peripheral Interface
(SPI) or the 2-wire inter-integrated circuit (I²C) bus and a
universal asynchronous receiver transmitter (USART). The
data EEPROM, flash program memory is readable and
writable during normal operation (over the full VDD range).
This memory is not directly mapped in the register file space.
Instead, it is indirectly addressed through the special function
registers. All devices have a host of features intended to
maximize system reliability, minimize cost through
elimination of external components, provide power saving
operating modes and offer code protection.
 Synchronous serial port (SSP) with SPI (master mode) and
I²C (master/slave) Figure 3: Pin Diagram of Seven Segment Display
 Universal synchronous asynchronous receiver transmitter
(USART/SCI) with 9-bit address detection Types of Seven Segment Displays:
Common Anode (CA): In common anode type, all the
 Brown-out detection circuitry for brown-out reset (BOR)
anodes of 8 LED‟s are connected to the common terminal
-bit/up to 8-channel Analogue-to-digital converter (A/D)
 10-bit/up
and cathodes are left free. Thus, in order to glow the LED,
 100,000 Erase/write cycles enhanced flash program these cathodes have to be connected to the logic „0‟ „0‟ and
memory typical anode to the logic „1‟.
 1,000,000 Erase/write cycles data EEPROM memory
typical Common Cathode (CC): As the name indicates cathode is
 >40 Years Data EEPROM retention the common pin for this type of seven segments and
 Self-reprogrammable under software control remaining 8 pins are left free. Here, logic low is applied to
rcuit serial Programming (ICSP) via two pins
 In-circuit the common pin and logic high to the remaining pins.
 Single-supply 5V in-circuit serial programming
 Programmable code protection Working:
 Power saving sleep mode Seven segment display works, by glowing the required
respective LEDs in the numeral. The display is controlled
using pins that are left freely. Forward biasing of these pins
in a sequence will display the particular numeral or alphabet.
Depending on the type of seven segment the segment pins
are applied with logic high or logic zero and in the similar
way to the common pins also.

Figure 4: Seven Segment Display Top View


Figure 2: PIC 16F876 Microcontroller
c) Voltage Divider
This system is having three seven segment displays for A simple voltage divider is shown below in Figure 5, using
displaying of voltages ranging from 00.0volt to 500 volts two different valued resistors with values of several kΩ each.
AC. This voltmeter has been calibrated with 0.1volt of Use voltage supply which is under measurement. Observe
resolution upto 99.9 volts and of 1volt of resolution from 100 the Vout, according to the voltage divider formula Vout = Vs
volts onwards. x R2/(R1 +R2).

b) Seven Segment Display


Generally seven segment displays are available in 10 pin
package. The pin diagram of seven segment display is shown
in the Figure 3. Seven segment display is an electronic
circuit consisting of 10 pins. Out of 10 pins 8 are LED pins
and these are left freely. 2 pins in middle are common pins
and these are internally shorted. Depending on either the
Volume 6 Issue 2, February 2017
www.ijsr.net
Licensed Under Creative Commons Attribution CC BY
Paper ID: ART2017579 155
International Journal of Science and Research (IJSR)
ISSN (Online): 2319-7064
Index Copernicus Value (2015): 78.96 | Impact Factor (2015): 6.391
process is known as rectification. Once the rectification is
done the voltage under measurement should be given to the
specified ADC channel pin of the microcontroller, since our
PIC microcontroller is having internal ADC.

Figure 5: Voltage Divider Network

d) Software Implementation
CCS developed the first C Compiler for Microchip
microcontrollers over 20 years ago and continues to provide
software solutions to developers of embedded applications
using PIC MCU and PIC24/dsPIC DSC devices. CCS
compilers are easy to use and quick to learn.

CCS compiler include pro-level optimization, the largest


library of built-in functions, powerful PIC MCU specific pre-
processor commands, and ready-to-run example programs to
quickly jump-start any project. [5]

Key Compiler Features:


 Easily migrate between all Microchip PIC MCUs devices
 Minimize development time with: peripheral drivers and
standard C constructs
 C++ style input/output streams with full data formatting
to any device or for strings
 Use CCS libraries and object code royalty free
 Convenient functions like #bit and #byte allow C
variables to be placed at absolute addresses
 The integral one-bit type (Short Int) permits the compiler
Figure 6: Flow chart for the proposed Digital Voltmeter
to generate very efficient Bit-oriented code
 Easily define, set-up and manage interrupts. A number of samples/reading will be read by the
microcontroller as per our algorithm. By averaging the
4. Proposed System measured value by number of samples, we get the exact
voltage reading under measurement. Here 8-bit data pins
The project is divided into two parts- software part and the have been directly connected to the each seven segment
hardware part. Software part is basically the algorithm/code display in parallel. By using the switching property of the
compiled using a compiler as explained above. In the transistors, we are enabling the display unit to show the
hardware part a great bit of work is done as because the desired reading on the seven segment display.
required measurement has been divided into three broad
sections, (1) voltage divider, (2) analog to digital conversion, Our voltmeter is designed in such a way that it shows the
(3) reading data at ADC channel and displaying of voltage reading with 0.1volt of resolution upto 99.9volts and with
on seven segment display. 1volt of resolution after 100volts. This is done by automatic
range selection of the meter, i.e. by removing the decimal
Operation of the proposed system: from the seven segment display as shown in the test images
The flow chart of the voltmeter system is shown below (Figure 7).
(Figure 6). At the start of the program, PIC needs to be
initialized the I/O pins assigned and clock frequency. 5. Test and Result photos of the system
Initialization of ADC port should be done at which voltage
will be read by the microcontroller. Since microcontroller is This image is taken when the voltage was measured at the
a digital device it can read/measure DC voltages upto 5volts line voltage 223V AC (around 220V). This voltmeter has
only. Therefore, we should have divided the input voltage by been tested for different voltages ranging from 0-500 Volts
a factor of 100 so that we could measure 500volts in terms of AC. Therefore the project is successful. Now the voltmeter is
5volts. ready to measure any voltage ranges from 0-500V.
After the voltage divider network we should convert AC
voltage into DC so that our microcontroller can read it
efficiently. We use ordinary diodes for this purpose. This

Volume 6 Issue 2, February 2017


www.ijsr.net
Licensed Under Creative Commons Attribution CC BY
Paper ID: ART2017579 156
International Journal of Science and Research (IJSR)
ISSN (Online): 2319-7064
Index Copernicus Value (2015): 78.96 | Impact Factor (2015): 6.391
experience of working with private as well as government
organization. He has published various papers in International
journals. He is now working as Electronics Design Engineer with
Vinytics Peripherals Pvt. Ltd. Delhi.

Abhishek Verma received his B.Tech degree from


Uttar Pradesh Technical University, Lucknow and
MBA degree from IMT Ghaziabad. Also having
experience of project management for various
electrical and electronics lab equipment. He is currently working as
Senior Design Consultant with Vinytics Peripherals Pvt. Ltd. Delhi.
Figure 7: Digital voltmeter with 7-segment display (at the
testing stage) Twishish Shrimali received his B.Tech degree from
Rajasthan Technical University, Jaipur. He is currently
6. Conclusion working as Software Developer with Vinytics
Peripherals Pvt. Ltd. Delhi. His area of interest is
This project has been successfully designed, constructed and Linux based operating system and its applications.
also tested for the specified range. This voltmeter is calibrated
with 0.1volt of resolution upto 99.9 volts and of 1volt of
resolution from 100 volts onwards. It is relatively cheaper
voltmeter, comparing to those present in the market. This
research will enhance the possibility of using digital voltmeters
to improve micro, small and medium scale industries in the
country.

7. Future Scope
We can extend this voltmeter to measure DC voltage also, so
that this voltmeter could be used for both types of
measurements AC voltages as well as DC voltages. Further
such meters can be interfaced with a complex measurement
system using serial interface or wireless mode so that data
could be utilized for control purposes.

8. Acknowledgment
We take this opportunity to thank all those who motivate us
to think innovative and design such a circuit which is usable
largely in the engineering field of measurement. We also
want to thank Mr. Vinod Verma, Director Vinytics
Peripherals Pvt. Ltd, New Delhi and the other staff members
especially from the production department of the company.

References
[1] Sedra Adel, S. and Smitch Ken, C: Microelectronic
Circuits, Oxford University Press, New York (1998).
[2] Anonymous: Microchip Co,Ltd. “PIC16F8X Datasheet”,
August (2006).
[3] Khawn Nue, Dr. KyawSoe Lwin, Hla Myo Tun, Design
and Construction of Digital Multi-Meter Using PIC
Microcontroller” International journal of scientific &
technology research, volume 4, issue 07, july 2015 ISSN
2277-8616.
[4] Ronald J. Tocci, Neal S. Widmer, Gregory L. Moss -
Digital Systems, principles and applications.
[5] www.ccsinfo.com
[6] https://en.wikipedia.org/wiki/Voltmeter

Author Profile
Shagun Malhotra received his B.Tech degree from
Guru Gobind Singh Indraprastha University, New
Delhi and M.Tech degree from Maharshi Dayanand
University, Rohtak. He is having a wide industrial
Volume 6 Issue 2, February 2017
www.ijsr.net
Licensed Under Creative Commons Attribution CC BY
Paper ID: ART2017579 157

You might also like