import math
#variable declaration
h = 6.625*10**-34 #planks constant(J*s)
C = 3*10**8 #free space velocity(m/s)
Eg = 1.43*1.6*10**-19 #(joules)
#calculation
LambdaC = h*C/Eg #wavelength(nm)
#result
print "Maximum wavelength for photodiode GaAs = ", round(LambdaC*10**9,0),"nm"
import math
#variable declaration
Ip_q = 5.4*10**6 #electron-hole pair generated
Pin_hv = 6*10**6 #number of incident photons
#calculation
etta = Ip_q / Pin_hv #Quantum efficiency
#result
print "Quantum efficiency at 1300nm =" ,etta*100,"%"
import math
#variable declaration
R = 0.65 #Responsivity of photodiode(A/W)
Pin = 10*10**-6 #Optical power level(watts)
#calculation
Ip = R*Pin #Photocurrent(A)
#result
print "Photocurrent =",Ip*10**6,"uA"
import math
#variable declaration
Lambda = 1300*10**-9 #Wavelength (m)
C = 3*10**8 #freespace velocity(m/s)
q = 1.6*10**-19 #Charge (coulombs)
etta = 0.9 #Quantum efficiency
h = 6.625*10**-34 #planks constant(J*s)
Eg = 0.73 #energy gap(eV)
#calculation
R = (etta*q*Lambda)/(h*C) #responsivity(A/W)
LambdaC = 1.24/ Eg #cutô€€€off wavelength(meters)
#result
print "Responsivity = ",round(R,2),"A/W"
print "Cutoff wavelength = ",round(LambdaC,1),"um"
import math
#variable declaration
etta = 0.65 #Quantum efficiency
C = 3*10**8 #freespace velocity(m/s)
Lambda = 900*10**-9 #Wavelength (m)
q = 1.6*10**-19 #Charge (coulombs)
h = 6.625*10**-34 #planks constant(J*s)
Pin = 0.5*10**-06 #optical power(W)
Im = 10*10**-06 #multiplied photocurrent(uA)
#calculation
Ip = ((etta*q*Lambda)/(h*C))*Pin #photocurrent(uA)
M = Im/Ip #multiplication
#result
print "Primary photocurrent = ",round(Ip*10**6,3),"uA"
print "Primary photocurrent is multiplied by " ,round(M+1,0)
import math
#variable declaration
Lambda = 1330.0*10**-9 #Wavelength (m)
ID = 4.0*10**-9 #photdiode current(nA)
etta = 0.90 #Quantum efficiency
RL = 1000.0 #load resistance(ohms)
Pin = 300.0*10**-9 #incident optical power(nW)
Be = 20.0*10**6 #reciver bandwidth
q = 1.6*10**-19 #Charge (coulombs)
h = 6.625*10**-34 #planks constant(J*s)
T = 283.0 #room temperature(kelvin)
KB = 1.38*10**-23 #boltzmann's constant
#calculation
Ip = (etta*q*Pin*1.3*10**-6)/(h*C) #primary current(uA)
Ishot = 2*q*Ip*Be #mean-squre shot noise current(A^2)
IDB = 2*q*ID*Be #mean-squre dark current(A^2)
IT = (4*KB*T)*Be/RL #mean-sqare thermal current(A^2)
#result
print "Primary current = ",round(Ip*10**6,3),"uA"
print "Mean-squre shot noise current = ",round(Ishot*10**18,2)*10**-18,"A^2 OR = ",round(math.sqrt(Ishot)*10**9,2),"nA"
print "Mean-squre dark current = ",round(IDB*10**20,2)*10**-20,"A^2 OR = ",round(math.sqrt(IDB)*10**9,2),"nA"
print "Mean-squre thermal current = ",round(math.sqrt(IT)*10**9,0),"nA"
import math
#variable declaration
CP = 3*10**-12 #photodiode capacitance(pF)
CA = 4*10**-12 #amplifier capacitance(pF)
CT = CP+CA #total capacitance
RT1 = 1000 #load resistance 1(ohms)
RT2 = 50 #load resistance 2(ohms)
#calculation
BC1 = 1/(2*math.pi*RT1*CT) #circuit bandwidth 1 (Hz)
BC2 = 1/(2*math.pi*RT2*CT) #circuit bandwidth 2 (Hz)
#result
print "Circuit bandwidth for 1k ohms = ",round(BC1*10**-6,0),"MHz"
print "Circuit bandwidth for 50 ohms = ",round(BC2*10**-6,0), "MHz"