Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@officialcjunior
Created July 21, 2020 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save officialcjunior/e9a3aea6210f1c00921c3e2c137e3719 to your computer and use it in GitHub Desktop.
Save officialcjunior/e9a3aea6210f1c00921c3e2c137e3719 to your computer and use it in GitHub Desktop.
A simple python script to calculate voltages and currents when using voltage divider bias. Can be useful when trying to find the DC Load Line. Here, I went with hardcoding the values, as passing by arguments can be difficult in unfortunate times.
#0.7 for Silicon and 0.3 for Germanium diodes
vbe=0.7
vcc=
vbb=
re=
rc=
rb= #*10**3
#put rb=0, if rb isn't there. same for all
b=
#beta ^^
#r1=100
#r2=25
#rth=r1*r2/(r1+r2)
#eth=r2*vcc/(r1+r2)
#vbb=eth
ib=(vbb-vbe)/(rb+(b+1)*re)
ic=ib*b
ie=ib+ic
vce=vcc-ic*(rc+re)
vce2=vcc-ie*(rc+re)
print("ib =", ib, "\nic=",ic, "\nvce (with ic) = ",vce,"\nvce (with ie) = ", vce2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment