Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bjt-lab-analyzer

A small toolkit for analysing bipolar-junction-transistor (BJT) measurements and designing a common-emitter (WE) amplifier, written for an analog electronics lab course (AGH WFiIS, exercises A-8 and P-4). It ingests CSV sweeps exported from a Digilent Analog Discovery 2 / WaveForms curve tracer and turns them into gain/resistance figures and plots, plus computes E24 resistor values for a target amplifier design.

Features

  • Input & transfer characteristics (I_B = f(V_BE), I_C = f(V_BE)): extracts β, transconductance g_m, and input resistance r_be.
  • Output characteristics (I_C = f(V_CE) family of curves): estimates Early voltage V_A and output resistance r_ce per curve.
  • Amplifier design: given a target gain/bandwidth spec, computes bias point and component values (R1, R2, RC, RE1, RE2, Ci, Co), snapped to the nearest E24 value, plus a Bode plot of the resulting frequency response.
  • Operating-point verification: compares theoretical vs. measured V_B/V_C/V_E/I_C after the circuit is built.

Example output

Input & transfer characteristics Output characteristics Bode plot
input/transfer output bode

Installation

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Usage

bjt_lab.py is the main entry point and covers the whole workflow:

python bjt_lab.py                            # interactive menu
python bjt_lab.py --bjt-input  input.csv     # §1a/1b: input & transfer characteristics
python bjt_lab.py --bjt-output output.csv    # §1c: output characteristic
python bjt_lab.py --design 9                 # §2: amplifier design for variant 9
python bjt_lab.py --design 9 --beta 280      # ...using a measured beta instead of the table value
python bjt_lab.py --all-variants             # summary table for all 10 amplifier variants

Sample WaveForms CSVs are in examples/data; try e.g.

python bjt_lab.py --bjt-input  examples/data/fictional_input_transfer.csv
python bjt_lab.py --bjt-output examples/data/1c.csv

(1a.csv/1b.csv are raw single-sweep traces exported separately, with different column names/header offsets than bjt_lab.py expects — scripts/beta_from_separate_csv.py is a starting-point template for that case; adjust its column names/skiprows to match your export, as noted in its comments.)

WaveForms CSV exports may prefix the data with a few #-commented metadata lines — bjt_lab.py detects and skips these automatically, and auto-detects which columns are V_BE/I_B/I_C/V_CE by header name.

scripts/

Smaller standalone calculators kept for quick, no-argument interactive use; bjt_lab.py supersedes all of them but they're handy on their own:

  • quick_amplifier_design.py — amplifier design only, prompts for a variant number (1-10).
  • quick_operating_point_check.py — operating-point verification only, prompts for measured voltages and actual component values.
  • beta_from_separate_csv.py — computes β(DC) and β(AC) from two separate CSV exports (one with I_B vs V_BE, one with I_C vs V_BE) instead of one combined file.

License

MIT, see LICENSE.

About

BJT lab data analysis & common-emitter amplifier design toolkit (β, gm, r_be, Early voltage, E24 component sizing) — AGH WFiIS analog electronics lab (A-8/P-4)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages