# Chapter 9 : Non Linear Circuits¶

## Example 9.1, Page 408¶

In [1]:
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)

print "Worst Case Error =",round(Vneti*10**3,2),"mV"

Worst Case Error = 8.0 mV


## Example 9.2, Page 409¶

In [2]:
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"

Designed Circuit for Voltage Indicator :
Circuit Elements for Overvoltage Circuit :
R1 = 10.0 kilo ohm
R2 = 42.2 kilo ohm
R4 = 5.6 kilo ohm
Circuit Elements for Undervoltage Circuit :
R1 = 10.0 kilo ohm
R2 = 30.1 kilo ohm
R3 = 10.0 kilo ohm
R4 = 3.9 kilo ohm


## Example 9.3, Page 410¶

In [3]:
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

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"

Designed On−Off Temperature Controller :
R1 = 31.7 kilo ohm
R2 = 5.0 kilo ohm
R3 = 32.3 kilo ohm
R4 = 2.0 kilo ohm
R5 = 6.2 kilo ohm
R6 = 10.0 kilo ohm


## Example 9.4, Page 412¶

In [4]:
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

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"

Designed Video Detector :
R1 = 10.0 kilo ohm
R2 = 1.05 kilo ohm
R3 = 10.0 kilo ohm
R4 = 4.3 kilo ohm
R5 = 2.7 kilo ohm
R6 = 330.0 ohm


## Example 9.5, Page 419¶

In [5]:
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]

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"

Designing Single Supply Inverting Schmitt trigger :
R1 = 40.0 kilo ohm
R2 = 66.7 kilo ohm
R3 = 100.0 kilo ohm
R4 = 2.2 kilo ohm


## Example 9.6, Page 422¶

In [6]:
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

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"

Designed On−Off Temperature Controller :
R1 = 31.7 kilo ohm
R2 = 5.0 kilo ohm
R3 = 32.3 kilo ohm
R4 = 2.0 kilo ohm
R5 = 6.2 kilo ohm
R6 = 10.0 kilo ohm
Rw = 17.2 kilo ohm
Feedback Resistance (Rf) = 750.0 kilo ohm