# Chapter - 5 : Digital Meters¶

## Example : 5.1 - Page No : 117¶

In [2]:
from __future__ import division
#Given data
V_REF= 10 # in volt
w2= V_REF/2 # The second MSB weight in volt
print "The second MSB weight = %0.f V" %w2
w3= V_REF/4 # The third MSB weight in volt
print "The third MSB weight = %0.1f V" %w3
w4= V_REF/8 # The forth MSB weight in volt
print "The forth MSB weight = %0.2f V" %w4

# (i)
r_DAC= w4 # resolution of the DAC in volt
print "(i) : Resolutio of the DAC = %0.2f V" %r_DAC

#(ii)
FSO= V_REF+w2+w3+w4 #full scale output in volt
print "(ii) : Full scale output = %0.2f V" %FSO

# (iii)
FSO_R= FSO/4 # full scale output when the feedback resistor is made one fourth of R in volt
print "(iii) : The full scale output when the feedback resistor is made one fourth of R i volt = %0.4f" %FSO_R

The second MSB weight = 5 V
The third MSB weight = 2.5 V
The forth MSB weight = 1.25 V
(i) : Resolutio of the DAC = 1.25 V
(ii) : Full scale output = 18.75 V
(iii) : The full scale output when the feedback resistor is made one fourth of R i volt = 4.6875


## Example : 5.2 - Page No : 117¶

In [3]:
 #Given data
V_REF= -5 # in volt
V_A= -5 # in volt
V_C=V_A # in volt
V_D=V_C # in volt
V_B= 0
Vout= -1*(V_A+V_B/2+V_C/4+V_D/8)
print "Output voltage = %0.3f V" %Vout

Output voltage = 6.875 V


## Example : 5.3 - Page No :¶

In [10]:
 #Given data
D=16
D1= D/2 # first MSB output in volt
print "First MSB output  = %0.f V" %D1
D2= D/4 # second MSB output in volt
print "Second MSB output = %0.f V" %D2
D3= D/8 # third MSB output in volt
print "Third MSB output  = %0.f V" %D3
D4= D/16 # fourth MSB output in volt
print "Fourth MSB output = %0.f V" %D4
D5= D/32 # fifth MSB output in volt
print "Fifth MSB output  = %0.1f V" %D5
D6= D/64 # sixth MSB (LSB) output in volt
print "Sixth MSB (LSB) output = %0.2f V" %D6
print "The resolution is equal to the weight of the LSB       = %0.2f V" %D6
# Full scale output occurs for a digital input of 111111
FSO= D1+D2+D3+D4+D5+D6 # in volt
print "Full scale output occurs for a digital input of 111111 = %0.2f V" %FSO
# The output voltage for a digital input of 101011
D0=16
D1=16
D2=0
D3=16
D4=0
D5=16
Vout= ( D0*2**0 + D1*2**1 + D2*2**2 + D3*2**3 + D4*2**4 + D5*2**5  )/64 # in volt
print "The output voltage for  digital input of 101011        = %0.2f V" %Vout

First MSB output  = 8 V
Second MSB output = 4 V
Third MSB output  = 2 V
Fourth MSB output = 1 V
Fifth MSB output  = 0.5 V
Sixth MSB (LSB) output = 0.25 V
The resolution is equal to the weight of the LSB       = 0.25 V
Full scale output occurs for a digital input of 111111 = 15.75 V
The output voltage for  digital input of 101011        = 10.75 V


## Example : 5.4 - Page No : 123¶

In [12]:
 #Given data
R=100 # in kohm
R=R*10**3 #in ohm
C=1*10**-6 # in F
V_REF= 5 # in volt
t=0.2 # time taken to read unknown voltage in sec
T=R*C # in sec
Vx= T/t*V_REF # in volt
print "The value of Unknown voltage = %0.1f V" %Vx

The value of Unknown voltage = 2.5 V


## Example : 5.5 - Page No : 124¶

In [27]:
 #Given data
# For an 8-bit converter reference voltage V_REF be taken as 100 V
V_REF= 100 # in volt
f=75*10**6 # in Hz
# For setting
D7=1
Vout1= V_REF*2**7/2**8 # in volt
print "For D7 = 1, The output voltage    = %0.f volt" %Vout1
# since 180-100 = 80 > 50  set D7=1

# For setting
D6=1
Vout2= V_REF*2**6/2**8 # in volt
print "For D6 = 1, The output voltage    = %0.f volt" %Vout2
# Hence for setting D7=1 and D6=1 output voltage
Vout3= Vout1+Vout2 # in volt
print "D7 and D6 = 1, The output voltage = %0.f volt" %Vout3
# since 80>75  set D6=1
# For setting D5=1, D6=1 and D7=1
Vout4   = V_REF*2**5/2**8 + Vout1+ Vout2 # in volt
print "For D6 = 1, The output voltage    = %0.1f volt" %Vout4
print "All other digits will be set to zero or 1. Output will be accordingly indicated as a result of successive approximation."
print "The Converted 8-bit digital form will be 1110010"
T=1/f #in sec
print "Conversion time = %0.1f ns" %(T*10**9)

For D7 = 1, The output voltage    = 50 volt
For D6 = 1, The output voltage    = 25 volt
D7 and D6 = 1, The output voltage = 75 volt
For D6 = 1, The output voltage    = 87.5 volt
All other digits will be set to zero or 1. Output will be accordingly indicated as a result of successive approximation.
The Converted 8-bit digital form will be 1110010
Conversion time = 13.3 ns


## Example : 5.6 - Page No : 124¶

In [29]:
 #Given data
N=8 # Number of bits
f=1*10**6 # in Hz
T=1/f
Tc= N*T # in second
print "Time of conversion = %0.f µs" %(Tc*10**6)

Time of conversion = 8 µs


## Example : 5.7 - Page No : 124¶

In [30]:
 #Given data
Vin= 2 # in volt
Vout= 10 # in volt
R=100 # kohm
R=R*10**3 # in ohm
C= 0.1 # in miu F
C=C*10**-6 # in F
#  Vout= -1/(R*C)*integrate('Vin','t',0,t) = -Vin*t/(R*C)
t= Vout*R*C/Vin # in sec
print "The maximum time upto which the reference voltage can be integrated = %0.f ms" %(t*10**3)

The maximum time upto which the reference voltage can be integrated = 50 ms


## Example : 5.8 - Page No : 134¶

In [31]:
 #Given data
n=3
R=1/10**n
fs1=1 # full scale range of 1 v
r1= fs1*R # resolution for full scale range of 1 V
print "Resolution for full scale range of 1 V  = %0.3f V" %r1
fs2=10 # full scale range of 10 v
r2= fs2*R # resolution for full scale range of 10 V
print "Resolution for full scale range of 10 V = %0.2f V" %r2
# The display for 2 V reading on 10 V scale of 3*1/2 digital meter would be 02.00 i.e
LSD= 5*R # in volt
print "Total possible error = %0.3f V" %Total_pos_Error

Resolution for full scale range of 1 V  = 0.001 V
Resolution for full scale range of 10 V = 0.01 V
Total possible error = 0.015 V


## Example : 5.9 - Page No : 134¶

In [37]:
 #Given data
R= 1/10**4 # resolution
print "Resolution of voltmeter = %0.4f" %R
print "There are 5 digit places in 4½ display, so ",round(reading1,2)," would be displayed as 16.580 V on a 10V range "
print "Any reading up to 4th decimal can be displayed."
R= 10*R # resolution on 10 V range
print "Resolution of 10 V range =",round(R,3)," So"

Resolution of voltmeter = 0.0001
There are 5 digit places in 4½ display, so  16.58  would be displayed as 16.580 V on a 10V range
Any reading up to 4th decimal can be displayed.
Hence  0.7254  will be displayed as :  0.7254
Resolution of 10 V range = 0.001  So
0.7254 will be displayed as :  0.725 instead of 0.7254


## Example : 5.10 - Page No : 135¶

In [43]:
from __future__ import division
#Given data
n=3
R=1/10**n
fs1=10 # full scale range of 10 v
r1= fs1*R # resolution for full scale range of 10 V
print "Resolution for full scale range of 10 V = ",r1
fs2=100 # full scale range of 100 v
r2= fs2*R # resolution for full scale range of 100 V
print "Resolution for full scale range of 100 V = ",r2
print "The display of 14.53 V reading on 10 V scale would be 14.530"
print "The display of 14.53 V reading on 100 V scale would be 0145.3"

Resolution for full scale range of 10 V =  0.01
Resolution for full scale range of 100 V =  0.1
The display of 14.53 V reading on 10 V scale would be 14.530
The display of 14.53 V reading on 100 V scale would be 0145.3


## Example : 5.11 - Page No : 135¶

In [45]:
from numpy import pi
#Given data
Vmax= 255 # in volt
Vx= 180 # in volt
f=10 # in kHz
f=f*10**3 # in Hz
t= (Vmax-Vx)/(2*pi*f*Vmax) # time taken to read the unknown voltage in second
t=t*10**6 # in micro second
print "Time taken to read the unknown voltage = %0.2f µs" %t

Time taken to read the unknown voltage = 4.68 µs


## Example : 5.12 - Page No : 146¶

In [47]:
 #Given data
f=2.5 # in kHz
f=f*10**3 # in Hz
# Part (i) when
t=0.1 # in sec
count= f*t
print "When GATE ENABLE time is 0.1 sec then the counter count or display = %0.f" %count
# Part (ii) when
t=1 # in sec
count= f*t
print "When GATE ENABLE time is 1 sec then the counter count or display   = %0.f" %count
# Part (iii) when
t=10 # in sec
count= f*t
print "When GATE ENABLE time is 10 sec then the counter count             = %0.f" %count

When GATE ENABLE time is 0.1 sec then the counter count or display = 250
When GATE ENABLE time is 1 sec then the counter count or display   = 2500
When GATE ENABLE time is 10 sec then the counter count             = 25000


## Example : 5.13 - Page No : 147¶

In [49]:
 #Given data
N=45 # unit less
t=10 # in ms
t=t*10**-3 # in sec
f=N/t # Hz
f=f*10**-3 # in kHz
print "The value of frequency = %0.1f kHz" %f

The value of frequency = 4.5 kHz


## Example : 5.14 - Page No : 147¶

In [51]:
 #Given data
totalPulse= 174 # unit less
t=100 #time period of total pulses in miu s
t=t*10**-6 # in sec
t1= t/totalPulse # time period of one pulse in sec
f= 1/t1 # frequency in Hz
f=f*10**-6 # in MHz
print "The value of frequency = %0.2f MHz" %f
resolution= totalPulse/t # in sec
resolution=resolution*10**-6 # per micro sec
print "Resolution of measurement = %0.2f per µs" %resolution

The value of frequency = 1.74 MHz
Resolution of measurement = 1.74 per µs


## Example : 5.15 - Page No : 147¶

In [52]:
 #Given data
t=1/(2*10**6)  # time of one cycle o 2MHz clock in sec
N=500 # number of cycle
t1= N*t # time of 1 cycle by the electronic counter in sec
f= 1/t1 # in Hz
f=f*10**-3 # in kHz
print "The value of frequency of input signal = %0.f kHz" %f

The value of frequency of input signal = 4 kHz