Monday 9 January 2017

Digital voltmeter using PIC-Controller

Title of project:
                                       Digital voltmeter using PIC-controller

Purpose/Motives:
1.      Easy to build
2.      Ranges from 0-30v
3.      Accuracy up to 100mv
4.      It measures DC voltages
5.      It is coast effective
Schematic diagram:
Real look of Project:


Components:

1. PIC16f72
2. 7-segmet, 3digit common cathode(multiplexed)
3. Crystal 4MHz
4. Zener diode 5.1v
5. Voltage regulator 7805
6. Resistor 560 ohm (8), 1k (3)
7. Transistor BC547 (3)
8. Variable Resistor 10k
9. Resistor 20k & 120k
10.  Switch
11.  9v battery
12.  Capacitor 33pF (2)


Working:
Let’s understand the working of this voltmeter.  We use PIC16f72 IC in this project (it is the heart of this project). It has 28-pins.
We have an ADC (Analog to digital converter).  It is a peripheral device which is built-in in our IC Pic16f72 (It has an 8bit ADC). With the help of code we can enable/disable our ADC easily. The purpose of using ADC is that we have to measure the voltages which are available in the form of analog signal(analog value) but we have to display them in the form of digits on 7-segment display so that we need to convert the input voltages into digital form by using analog to digital converter (ADC). So the voltages which have to be measured, we apply them directly on the ADC input. Now here we have 8-bit ADC so our input voltages will convert in 256 levels in ADC. According to formula:
                No. of levels in ADC=2resolution of ADC
So in our case:
                No. of levels in ADC= 28 =256
Since our voltages now available in 256 levels to obtained our required voltages value at the output of ADC we have to calculate a factor which will multiply to the output of ADC to give required values. So we have another formula:
                Multiplication factor=(Vcc/no. of levels)x100 = (5/256)x100=1.9607843
Vcc is the input voltages of our pic IC which is maximum 5v.
We have calculated a factor (Vcc/no. of levels). Now if we multiply it with our
ADC output so it gives output in mili-volts. To get the values in volts we again multiply it by 100. So we have a total factor (1.9607843).
We know that ADC gives the output voltages by comparing the input voltages to the reference voltages of the PIC IC which is 5v. So ADC can give the maximum output voltage values up to 5v only(because of reference volts). Then to get voltages up to 30v we have multiply the ADC output to the 6 to get 30v from 5v.
Multiplexed 7-segment
We are using the word multiplexed  which means when 4 segment displays are connected as a single segment, the data bus of all the segments comes in parallel and the enable pin is different for all segments. In this way, we control the individual segments by controlling each segment’s enable individually. In our project we have done this by using switching transistor connected between the multiplexed 7-segment and PIC IC.
Now if we select the enable pin separately of segment so at one time only one segment would be ON and would display remaining other would be off at that time. This is how  multiplexed seven segment display works. But now the question is how can we show different data in these 4 segments at a time? Remember, human eyes can’t find the difference within 10ms. I hope you already know about the persistence of vision. If we can change the data with corresponding enable pins of all these 4 segments within 10ms, our eyes will see a set of 4 digits in this segment. In other words, we will do the following within 10ms to display 1234. Feed data bus with 1 and set S1 high. Feed data bus with 2, turn S1 low and set S2 high. Feed data bus with 3, turn S2 low and set S3 high. Feed data bus with 4, turn S3 low and set S4 high. All this has to happen with in 10ms. Finally the process repeats to keep the display stable.

Uses:
1.      It can be used as  a panel meter
2.      It can be used in voltage supplies
3.      Other kind of DC-voltage measuring can also be done by using it.
Future horizons:
             1.      It can be converted  into an Amp-meter and  as a temperature sensor
             2.      Accuracy can be increases upto 1-10mv
             3.      It can be converted into AC-voltmeter.
             4.      It can be converted  into an Amp-meter and  as a temperature sensor(we has done this just                    using LM35 and small change in conversion factor)
Coding:
      •      Main function
      •      User define functions:
   Ø  Short-mask (function for 7-segment)
   Ø  Display function


Specification:
     Ø  Can measure DC-voltages
     Ø  Accuracy upto 100mV
     Ø  Ranges from 0 to 30 V
     Ø  Uses multiplexed 7-segment display(3-digits)
     Ø  Powered by 7 to 35 DC-voltages

Wednesday 30 November 2016

An introduction to the blog members

Aslam-o-Alikum friends..........

  •          Muhammad Umair Aftab
  •             Muhammad Kashif