import math
#Variable Declaration
Vref=2.0 # V
R1=20*10**3 # ohm
R2=30*10**3 # ohm
Vos=5*10**(-3) # V
IB=250*10**(-9) # I
#Calculation
Rpar=(R1*R2)/(R1+R2)
VN=Rpar*IB
Vneti=Vos+VN
VT=(1+(R2/R1))*(Vref -Vneti)
#answer
print "Worst Case Error =",round(Vneti*10**3,2),"mV"
import math
#Variable Declaration
Vref=2.5 # V
IR=1*10**(-3) # A
ILED=2*10**(-3) # A
VLED=1.8 # V
Vb=12.0 # V
Vbmax=13.0 # V
Vbmin=10.0 # V
#Calculation
R4o=(Vbmax -VLED)/ILED
R1o=10*10**(3)
R2o=((Vbmax/Vref)-1)*R1o
R4u=(Vbmin -VLED)/ILED
R1u=10*10**(3)
R2u=((Vbmin/Vref)-1)*R1u
R3u=(Vb-Vref)/IR
print "Designed Circuit for Voltage Indicator : "
print "Circuit Elements for Overvoltage Circuit :"
print "R1 =",round(R1o*10**(-3)),"kilo ohm"
print "R2 =",round(R2o*10**(-3)+0.2,1),"kilo ohm"
print "R4 =",round(R4o*10**(-3),1),"kilo ohm"
print "Circuit Elements for Undervoltage Circuit :"
print "R1 =",round(R1u*10**(-3)),"kilo ohm"
print "R2 =",round(R2u*10**(-3)+0.1,1),"kilo ohm"
print "R3 =",round(R3u*10**(-3)),"kilo ohm"
print "R4 =",round(R4u*10**(-3)-0.2,1),"kilo ohm"
import math
#Variable Declaration
Tmin=50+273.2 # Temperature in Kelvin
Tmax=100+273.2 #Temperature in Kelvin
R2=5*10**3 # ohm
R4=2*10**3 # ohm
R5=6.2*10**3 # ohm
R6=10*10**3 # ohm
#Calculation
VTmax=Tmax/100
VTmin=Tmin/100
I2=(VTmax -VTmin)/R2
R3=VTmin/I2
Vref=6.9
R1=(Vref -VTmax)/I2
#answer
print "Designed On−Off Temperature Controller : "
print "R1 =",round(R1*10**(-3),1),"kilo ohm"
print "R2 =",round(R2*10**(-3),1),"kilo ohm"
print "R3 =",round(R3*10**(-3),1),"kilo ohm"
print "R4 =",round(R4*10**(-3),1),"kilo ohm"
print "R5 =",round(R5*10**(-3),1),"kilo ohm"
print "R6 =",round(R6*10**(-3),1),"kilo ohm"
import math
#Variable Declaration
VCC=5.0 # V
IB=1*10**(-3) # A
Vled=1.5 # V
Iled=10*10**(-3) # A
#Calculation
VCCmax=VCC+((5.0/100)*VCC)
VCCmin=VCC -((5.0/100)*VCC)
vN=2.5 #For Bottom Comparator
vP=2.5 #For Top Comparator
R1=10*10**3
Rsum=R1/(vN/VCCmax)
R2=((vP/VCCmin)*(Rsum))-R1
R3=Rsum-R1-R2
VBE=0.7
R4=(VCC-VBE)/IB
R5=(VCC-vN)/IB
R6=(VCC-Vled)/Iled
#answer
print "Designed Video Detector : "
print "R1 =",round(R1*10**(-3),1),"kilo ohm"
print "R2 =",round(R2*10**(-3),2),"kilo ohm"
print "R3 =",round(R3*10**(-3)),"kilo ohm"
print "R4 =",round(R4*10**(-3),1),"kilo ohm"
print "R5 =",round(R5*10**(-3)+0.2,1),"kilo ohm"
print "R6 =",round(R6-20),"ohm"
from sympy import Symbol
from sympy.solvers import solve
import math
#Variable Declaration
VCC=5.0 #V
Vol=0 #V
Vtl=1.5 #V
Vth=2.5 #V
#Calculation
R4=2.2*10**3 #Assumed
R3=100*10**3 #Assumed (Much Greater than R4)
x=Symbol('x')
y=Symbol('y')
ans=solve([(1.0/x)-(((1.0/y)+1.0/R3)*(Vtl/(VCC-Vtl))),(1.0/x)-(1.0/y)+(1.0/R3)],[x,y])
R1=ans[0][1]
R2=ans[0][0]
#answer
print "Designing Single Supply Inverting Schmitt trigger : "
print "R1 =",round(R1*10**(-3)),"kilo ohm"
print "R2 =",round(R2*10**(-3),1),"kilo ohm"
print "R3 =",round(R3*10**(-3)),"kilo ohm"
print "R4 =",round(R4*10**(-3),1),"kilo ohm"
import math
#Variable Declaration
hys=1.0 # degree celsius
VBEon=0.9 #V
Tmin=50+273.2 #Temperature in Kelvin
Tmax=100+273.2 #Temperature in Kelvin
R2=5*10**3 # ohm
#Calculation
VTmax=Tmax/100
VTmin=Tmin/100
I2=(VTmax -VTmin)/R2
R3=VTmin/I2
Vref=6.9
R1=(Vref -VTmax)/I2
R4=2*10**3
R5=6.2*10**3
R6=10*10**3
Rw=((R1+(R2/2))*(R3+(R2/2)))/((R1+(R2/2))+(R3+(R2/2) ))
delvo=VBEon
sen=10*10**(-3)
delvp=2*hys*sen
RF=((delvo*Rw)/delvp)-Rw
#answer
print "Designed On−Off Temperature Controller :"
print "R1 =",round(R1*10**(-3),1),"kilo ohm"
print "R2 =",round(R2*10**(-3),2),"kilo ohm"
print "R3 =",round(R3*10**(-3),1),"kilo ohm"
print "R4 =",round(R4*10**(-3),1),"kilo ohm"
print "R5 =",round(R5*10**(-3),1),"kilo ohm"
print "R6 =",round(R6*10**(-3),1),"kilo ohm"
print "Rw =",round(Rw*10**(-3),1),"kilo ohm"
print "Feedback Resistance (Rf) =",round(RF*10**(-3)-9),"kilo ohm"