Chapter 12 , PN Junction Diode

Example 12.1 , Page Number 226

In [5]:
import math

#Variables

I0 = 2 * 10**-7              #Current (in Ampere)
VF = 0.1                     #Forward voltage (in volts)

#Calculation

I = I0 * (math.exp(40*VF)-1)      #Current through diode (in Ampere)

#Result

print "Current throrough diode is ",round(I*10**6,2)," micro-Ampere."
Current throrough diode is  10.72  micro-Ampere.

Example 12.2 , Page Number 226

In [14]:
import math

#Variables

VF = 0.22                      #Forward voltage (in volts)
T = 298.0                      #Temperature (in kelvin)
I0 = 10**-3                    #Current (in Ampere)
n = 1

#Calculation

VT = T/11600                   #Volt equivalent of temperature (in volts)
I = I0*(exp(VF/(n*VT))-1)      #Diode Current (in Ampere) 

#Result

print "Diode current is ",round(I,1)," A."
Diode current is  5.2  A.

Example 12.3 , Page Number 226

In [2]:
import math

#Variables

I1 = 0.5 * 10**-3          #Diode current1 (in Ampere)
V1 = 340 * 10**-3          #Voltage1 (in volts)
I2 = 15 * 10**-3           #Diode current2 (in Ampere)
V2 = 440 * 10**-3          #Voltage2 (in volts)

#Calculation

n = 4/math.log(30)                #By solving both the given equations

#Result

print "Value of n is ",round(n,2),"."
Value of n is  1.18 .

Example 12.4 , Page Number 228

In [12]:
import math

#Variables

I300 = 10 * 10**-6             #Current at 300 kelvin (in Ampere)
T1 = 300                       #Temperature (in kelvin)
T2 = 400                       #Temperature (in kelvin)

#Calculation

I400 = I300 * 2**((T2-T1)/10)  #Current at 400 kelvin (in Ampere)  

#Result

print "Current at 400 k is ",round(I400*10**3,1)," mA."
Current at 400 k is  10.2  mA.

Example 12.5 , Page Number 230

In [11]:
import math

#Variables

rb = 2               #bulk resistance (in ohm)
IF = 12 * 10**-3     #FOrward current (in Ampere)

#Calculation

VF = 0.6 + IF * rb   #Voltage drop (in volts)

#Result

print "Voltage drop across a silicon diode is ",VF," V."
Voltage drop across a silicon diode is  0.624  V.

Example 12.6 , Page Number 230

In [10]:
import math

#Variables

T = 398.0                    #Temperature (in kelvin)
I0 = 30 * 10**-6             #Reverse saturation current (in Ampere)
V = 0.2                      #Voltage (in volts)

#Calculation

VT = T/11600                 #Volt equivalent of temperature (in volts)
I = I0 * (math.exp(V/VT)-1)       #Diode current (in Ampere)
rac = VT/I0 * math.exp(-V/VT)     #dynamic resistance in forward direction (in ohm)
rac1 = VT/I0 * math.exp(V/VT)     #dynamic resistance in reverse direction (in ohm)

#Result

print "Dynamic resistance in forward direction is ",round(rac,2)," ohm.\nDynamic resistance in backward direction is ",round(rac1/10**6,3)," Mega-ohm."
Dynamic resistance in forward direction is  3.36  ohm.
Dynamic resistance in backward direction is  0.389  Mega-ohm.

Example 12.8 , Page Number 237

In [9]:
import math

#Variables

PDmax = 0.5              #power dissipation (in watt)
VF = 1                   #Forward voltage (in volts)
VBR = 150                #Breakdown voltage (in volts)

#Calculation

IFmax = PDmax/VF         #Maximum forward current (in Ampere)
IR = PDmax/VBR           #Breakdwon current that burns out the diode (in Ampere)

#Result

print "Maximum forward current is ",IFmax," A.\nBreakdwon current that burns out the diode is ",round(IR*10**3,2)," mA."
Maximum forward current is  0.5  A.
Breakdwon current that burns out the diode is  3.33  mA.

Example 12.9 , Page Number 238

In [8]:
import math

#Variables

R = 330                   #Resistance (in ohm)
VS = 5                    #Source voltage (in volts)

#Calculation

VD = VS                   #Voltage drop across diode (in volts)
VR = 0                    #Voltage drop across the resistance (in volts)
I = 0                     #Current through circuit

#Result

print "Voltage drop across the diode is ",VD," V.\nVoltage drop across the resistance is ",VR," V.\nCurrent through the circuit is ",I," A."
Voltage drop across the diode is  5  V.
Voltage drop across the resistance is  0  V.
Current through the circuit is  0  A.

Example 12.10 , Page Number 239

In [7]:
import math

#Variables

VS = 12.0                     #Source coltage (in volts)
R = 470.0                     #Resistance (in ohm)

#Calculation

VD = 0                      #Voltage drop across diode (in volts)
VR = VS                     #Value of VR (in volts)
I = VS/R                    #Current (in Ampere)

#Result

print "Value of VD is ",VD," V.\nValue of VR is ",VR," V.\nCurrent through the circuit is ",round(I*10**3,2)," mA."
Value of VD is  0  V.
Value of VR is  12.0  V.
Current through the circuit is  25.53  mA.

Example 12.11 , Page Number 239

In [6]:
import math

#Variables

VS = 6                 #Source voltage (in volts)
R1 = 330               #Resistance (in ohm)
R2 = 470               #Resistance (in ohm)
VD = 0.7               #Diode voltage (in volts)

#Calculation

RT = R1 + R2           #Total Resistance (in ohm)
I = (VS - 0.7)/RT      #Current through the diode

#Result

print "Current through the circuit is ",I * 10**3," mA."
Current through the circuit is  6.625  mA.

Example 12.12 , Page Number 240

In [5]:
import math

#Variables

VS = 5                 #Source voltage (in volts)
R = 510                #Resistance (in ohm)
VF = 0.7               #Forward voltage drop (in volts)

#Calculation

VR = VS - VF           #Net voltage (in volts)
I = VR / R             #Current through the diode

#Result

print "Voltage across the resistor is ",VR," V.\nThe circuit current is ",round(I * 10**3,2)," mA."
Voltage across the resistor is  4.3  V.
The circuit current is  8.43  mA.

Example 12.13 , Page Number 240

In [4]:
import math

#Variables

VS = 6                         #Source voltage (in volts)
VD1 = VD2 = 0.7                #Diode Voltage drop (in volts)
R = 1.5 * 10**3                #Resistance (in ohm)

#Calculation

I = (VS - VD1 - VD2)/R         #Current (in Ampere)

#Result

print "Total current through the circuit is ",round(I * 10**3,3)," mA." 
Total current through the circuit is  3.067  mA.

Example 12.14 , Page Number 240

In [3]:
import math

#Variables

VS = 12                          #Source voltage (in volts)
R1 = 1.5 * 10**3                 #Resistance (in ohm)
R2 = 1.8 * 10**3                 #Resistance (in ohm)
VD1 = VD2 = 0.7                  #Diode Voltage drop (in volts)

#Calculation

RT = R1 + R2                     #Total Resistance (in ohm)
I = (VS - VD1 - VD2)/RT          #Current (in Ampere)

#Result

print "Total current through the circuit is ",round(I * 10**3,3)," mA." 
Total current through the circuit is  3.212  mA.

Example 12.15 , Page Number 241

In [2]:
import math

#Variables

R = 3.3 * 10**3              #Resitance (in ohm) 

#Calculation

#Case (a)

V11 = V21 = 0                #Voltages (in volts)
V01 = 0                      #Output Voltage (in volts)

#Case (b)

V21 = 0                      #Voltage (in volts)
V22 = 5                      #Voltage (in volts)
V02 = V22 - 0.7              #Output voltage (in volts)  

#Case (c)

V31 = 5                      #Voltage (in volts)
V32 = 0                      #Voltages (in volts)
V03 = V31 - 0.7              #Output voltage (in volts)  

#Case (d)

V41 = V42 = 5                #Voltages (in volts)
V04 = V41 - 0.7              #Output voltage (in volts)  

#Result

print "Output Voltage in case 1 is ",V01," V.\nOutput Voltage in case 2 is ",V02," V.\nOutput Voltage in case 3 is ",V03," V.\nOutput Voltage in case 4 is ",V04," V."
Output Voltage in case 1 is  0  V.
Output Voltage in case 2 is  4.3  V.
Output Voltage in case 3 is  4.3  V.
Output Voltage in case 4 is  4.3  V.

Example 12.16 , Page Number 242

In [2]:
import math
import numpy
%matplotlib inline
from matplotlib.pyplot import plot,title,xlabel,ylabel

#Variables

rB = 1.0                                    #bulk resistance (in ohm)
V = 10 * 10**-3                             #Signal Amplitude (in volts)

#Calculation

#Case (a)

R = 20.0                                    #Resitance (in kilo-ohm)
Vg = 20.0                                   #Source voltage (in volts)
I = (Vg - 0.7)/R                            #Current (in milli-Ampere)         

#Case (b)

rj = 50.0                                   #junction resistance (in ohm)
re = rB + rj                                #a.c. resistance (n ohm)
rnet = re * (R*10**3)/(re + (R*10**3))      #Net resistance (in ohm)
V1 = V * re/(re + 1000)                     #Voltage drop across 51 ohm resitance (in ohm)

#Result

print "Current in dc circuit is ",round(I)," mA.\na.c voltage drop across 51 ohm resistance is ",round(V1*10**3,3)," mV."

#Graph

x = numpy.linspace(-4*math.pi,4*math.pi,500)
y = numpy.sin(x)
plot(x,0.7 + 0.48*10**-3*y)
title("Total Voltage 'V' across the diode")
xlabel("t(in seconds)->")
ylabel("Voltage(in volts)->")
Current in dc circuit is  1.0  mA.
a.c voltage drop across 51 ohm resistance is  0.485  mV.
Out[2]:
<matplotlib.text.Text at 0x652ae90>