# CHAPTER 7 : SPECIAL-PURPOSE DIODES¶

## Example 7.1 : Page number 127-128¶

In [1]:
#Variable declaration
V_S=10.0;                        #Supply voltage in V
V_D=1.6;                         #Forward voltage drop of LED, in V
I_F=20.0;                          #Required limited current through LED, in mA

#Calculations
R_S=(V_S-V_D)/(I_F/1000);               #Series resistor required to limit the current through the LED, in Ω

#Result
print("The value of series resistor required to limit the current through the LED = %d Ω."%R_S);


The value of series resistor required to limit the current through the LED = 420 Ω.


## Example 7.2: Page number 128¶

In [2]:
#Variable declaration
V_S=15.0;                        #Supply voltage in V
V_D=2.0;                         #Forward voltage drop of LED, in V
R_S=2200.0;                         #Series resistor required to limit the current through the LED, in Ω

#Calculations
I_F=((V_S-V_D)/R_S)*1000;                          #Required limited current through LED, in mA

#Result
print("The current through the LED in the circuit = %.2f mA"%I_F);

The current through the LED in the circuit = 5.91 mA


## Example 7.3: Page number 132-133¶

In [3]:
#Variable declaration
Ir=50.0;                                 #Dark current as observed from the current Illumination curve, in mA
V_R=10.0;                                #Reverse voltage in V

#Calculation
R_R=V_R/(Ir/pow(10,6));                    #Dark Resistance in Ω

#Result
print("The dark resistance is=%d kΩ"%(R_R/1000));

The dark resistance is=200 kΩ


## Example 7.4: Page number 133¶

In [4]:
#Variable declaration
E=2.5;                      #Illumination in mW/cm²
m=37.4;                     #sensitivity of the photodiode in 𝜇A/mW/cm²

#Calculations
I_R=m*E;                     #Reverse current in 𝜇A

#Result
print("The reverese current in the photodiode = %.1f  𝜇A"%I_R);

The reverese current in the photodiode = 93.5  𝜇A


## Example 7.5: Page number 137¶

In [5]:
from math import pi
from math import sqrt
#Variable declaration
L=1.0;                        #Inductance of the inductor in mH
C=100.0;                      #Capacitance of the varactor in pF

#Result
f_r=1/(2*pi*sqrt(L*pow(10,-3)*C*pow(10,-12)));        #Resonant frequency of the circuit in Hz
f_r=f_r/1000;                                         #Resonant frequency of the circuit in kHz

#Result
print("The resonant frequency of the circuit = %.1f kHz"%f_r);

The resonant frequency of the circuit = 503.3 kHz

In [ ]: