Download and extract the reader ZIP archive (a compressed collection of files). Links labelled “reader ZIP; extract …” download this archive; after extraction, open the named file. The archive includes full-size Portable Network Graphics (PNG) images, editable diagrams, complete code and worksheets.
A transistor output can fall when you connect a heavier load. Before calling the whole change a “0.7 V transistor drop,” measure the bias divider, base and emitter separately. This experiment separates movement of the source node from the drop in a base-feed resistor and the voltage across the base–emitter junction.
Scope: this is a proposed low-voltage bench experiment with a host-checked offline analyzer. The table and graph are explicitly constructed examples, not measurements or predictions for a particular transistor. No physical build or target firmware execution is claimed.
What the circuit does
A bipolar junction transistor (BJT) controls collector current through a base–emitter junction. NPN describes an n-type, p-type, n-type semiconductor structure: the n regions have electrons as majority carriers and the p region has holes. These are not three permanently charged terminals. The terminals are base (B), collector (C) and emitter (E).
Here the collector joins the positive supply and the load joins the emitter. This common-collector arrangement is also called an emitter follower: the emitter voltage responds to the base voltage, with a base–emitter difference that depends on operating conditions. It is not a voltage regulator. The load’s energy comes mainly from the collector supply; the base source still supplies current. The emitter arrow points away from the base for an NPN device and indicates conventional current direction.
Direct current (DC) means a steady direction rather than an alternating waveform. A volt (V) measures voltage, an ampere (A) current, and an ohm (Ω) resistance. One kilohm (kΩ) is 1,000 Ω; one milliampere (mA) is 0.001 A, one microampere (µA) 0.000001 A, and one millivolt (mV) 0.001 V. A watt (W) is a unit of power, the rate of energy transfer. All node voltages below use the same reference, G0.
Parts and a finite operating envelope
| Reference | Part or value | Purpose |
|---|---|---|
| Q1 | onsemi 2N3904BU, straight-lead TO-92-3, Case 135AN | Common-collector transistor; verify the actual manufacturer’s package |
| R1, R2 | Two 2.2 kΩ, 1% or better, at least 0.25 W | Bias divider; keep these same two parts throughout |
| Rb | 1 kΩ or 47 kΩ, 1% or better, at least 0.25 W | Interchangeable base-feed resistance |
| RL | 1 kΩ or 330 Ω, 1% or better, at least 0.25 W | Interchangeable emitter load; the 1 kΩ load is a separate part from Rb |
| J1 | Removable insulated jumper | Open the base feed for the unloaded-divider control, with power off |
| Source | One isolated regulated bench supply, 5.00 V setting, 20 mA current limit | Feeds both collector and divider; verify its settings and warm-up requirements |
| Meter | Keysight 34461A digital multimeter (DMM), fixed 10 V DC range, explicitly selected high-input-resistance mode (>10 GΩ) | Move only the voltage HI probe between nodes; input LO stays on G0 |
| Construction | Breadboard or terminal fixture, short jumpers, labelled test points | Keep connections and probe reference repeatable |
The current onsemi 2N3904T family page lists 2N3904BU as Active. Its 2N3904/D data sheet, October 2024 revision 3 identifies pin 1 as emitter, 2 as base and 3 as collector. The BU package is Case 135AN; do not borrow a generic TO-92 pinout, a lead-formed view, or the older 2N3904G Case 29 outline. Check the real part and drawing before insertion.
Use only the 4.75–5.25 V source envelope. Even the loose bound 5.25/(330 × 0.99) is about 16.1 mA through RL; its power is below 85 mW. The largest possible isolated voltage across the 1 kΩ feed would dissipate under 28 mW; either 2.2 kΩ divider resistor remains under 13 mW. Healthy-fixture supply demand is below the 20 mA limit. These calculations justify the chosen small resistors; they are not measurements.
The transistor’s 40 V collector–emitter and 200 mA continuous-current absolute maxima are far above this fixture, but absolute maxima are not normal operating targets. At 25 °C its stated package dissipation limit is 625 mW. A verified 20 mA source limit at 5.25 V supplies at most about 105 mW to the whole circuit, a conservative upper energy-rate bound for any one part. Allow for the supply limit’s tolerance; stop if it current-limits or a part warms unexpectedly. Never deliberately reverse-bias the base–emitter junction or substitute a motor, relay or unknown powered load.
Connections

emitter-follower-reader/assets/emitter-follower-circuit.svg.| Net | Every connection |
|---|---|
| VS | Supply positive → R1 top and Q1 collector pin 3 |
| VD | R1 bottom → R2 top and Rb input |
| VB | Rb output → J1 → Q1 base pin 2 |
| VE | Q1 emitter pin 1 → RL top |
| G0 | Supply negative → R2 bottom, RL bottom and meter input LO |
Put the red lead in the voltage HI socket and black in input LO; use voltage mode, never a current socket across these nodes. Keep the black connection fixed. Do not connect a second power source or a controller’s 5 V output. A diagram is a connection map, not a breadboard scale drawing: check hidden breadboard strips and distinguish a dotted junction from the unjoined red crossing.
Predict the divider, then measure its unloaded value
With no current taken from the divider, the nominal bias is Vnom = VS × R2/(R1 + R2). Equal nominal resistors give 2.500 V from 5.000 V. Their Thevenin resistance—the effective source resistance seen looking back into a deactivated ideal voltage source—is R1 ∥ R2 = 1.1 kΩ. Base current can therefore move VD before any drop in Rb is considered.
Two separate 1% resistors can instead give a ratio from 0.495 to 0.505. At 5 V that is 2.475–2.525 V, a possible 25 mV departure from nominal. Calling every difference from 2.500 V “loading sag” would mix ratio tolerance with the effect being tested.
Record V0, the actual unloaded-divider voltage, before and after the run with J1 open. Rb then has no path to the base. Q1’s floating base is not a guaranteed OFF command; do not use VE in this control. RL stays fitted, and the current-limited supply remains the only source. The control concerns VD only. Turn the source off and confirm VS below 50 mV before touching J1; after restoring it, verify the complete connection map again.
For a stable common reference state, the useful decomposition is:
VE = V0 − (V0 − VD) − (VD − VB) − (VB − VE).
- V0 − VD is divider loading sag relative to the measured unloaded control.
- VD − VB is the base-feed resistor drop.
- VB − VE is VBE, the base–emitter junction voltage.
If you start from the nominal bias instead, retain the additional term Vnom − V0: VE = Vnom − (Vnom − V0) − (V0 − VD) − (VD − VB) − VBE. Do not hide that ratio/control difference inside a transistor drop. These equations are bookkeeping identities; summing shared-node terms back to VE is not an independent validation of the transistor or uncertainty model.
Meter loading and sequential readings
The 34461A data sheet distinguishes the selectable high-resistance input from the ordinary 10 MΩ mode. Select fixed 10 V DC and verify >10 GΩ mode; do not assume a reset, function change or automatic setup preserves it. Use a number of power-line cycles (NPLC) integration setting of 10 or 100, automatic zero correction on, 90-minute warm-up and the applicable calibration/temperature conditions. No remote-control commands are used here.
On the one-year 10 V specification, within 5 °C of calibration temperature, the instrument contribution is ±(0.0035% of reading + 0.0005% of range). At 5 V this is 0.225 mV. It is a specification with conditions, not an accuracy certificate for an uncalibrated meter or the whole fixture. The data sheet states its uncertainty coverage using k = 2. Conditional interval arithmetic does not turn that coverage into a 100% guarantee; document the chosen coverage and any additional margin.
At 25 °C, >10 GΩ plus the documented input-bias-current limit permits a conservative 1 nA observer-current allowance over this voltage envelope. For a forward-operating, settled follower, the largest base-source resistance is at most about 48.6 kΩ (47 kΩ + 1.1 kΩ with tolerance). Its corresponding perturbation allowance is under 50 µV. The divider and emitter points have smaller passive bounds. This is a conditional DC observer model; leakage, input protection, unstable operation or a different mode require a new budget. Ordinary 10 MΩ loading can instead move the weakly fed base by millivolts, so do not copy the high-resistance budget to another meter.
The analyzer’s uncertainty entries must cover voltages of the same settled reference circuit with the measuring probes removed. Include instrument error, loading displacement, rounding and time variation. For illustration, 0.225 mV instrument error + 0.050 mV loading allowance + an independently justified 0.725 mV allowance for resolution, repeat spread and drift gives a 1 mV total bound. The last allowance is not supplied by the data sheet. Verify it for the actual run or enlarge the total; a repeated endpoint alone cannot rule out an excursion between readings.
Read in both directions, for example VD, VB, VE, VB, VD, with VS bracketed. Keep elapsed settling time and handling consistent. Use the unloaded V0 controls to build an interval spanning the run, not an invented constant 2.500 V. If a meter mode, source behavior, leakage or temporal bound cannot be qualified, leave bounds_scope as unqualified. The software then withholds both base-feed and load-resistor current estimates for measured rows. It does not certify a budget because a checkbox was changed to qualified.
Run four configurations and restore the first
- Warm up the source and meter with the output disabled, following their manuals. Set and verify 5.00 V, the 20 mA limit, voltage terminals, range and input-resistance mode. Keep the work dry and away from drafts; do not warm Q1 with your fingers.
- With the source off, build and inspect the circuit. Fit Rb = 1 kΩ and RL = 1 kΩ. Open J1, enable the source and obtain the initial unloaded VD control V0 and VS. Disable the output, confirm VS below 50 mV, then close J1.
- Enable configuration A. Wait at least 60 seconds and check repeated readings. If they still drift appreciably, extend the settling time and use the same qualified rule for every case; do not force a steady-state interpretation. Record bracketed VS, VD, VB and VE, reading times, spread and temperature in your notes.
- Disable, verify discharge and change only RL to 330 Ω: configuration B. Repeat the sequence and record the same nodes. Never hot-swap Rb, RL or J1.
- With power off and discharged, use Rb = 47 kΩ, RL = 1 kΩ for C, then Rb = 47 kΩ, RL = 330 Ω for D. Repeat the same observation and qualification procedure.
- Restore Rb = 1 kΩ and RL = 1 kΩ for
A_restore, with power off for the change. Repeat A’s reading sequence. Finally open J1 only after disabling/discharging and repeat the unloaded V0 control. - Build conservative total voltage bounds from the observations and assumptions. If restored A intervals do not overlap initial A, do not attribute differences between configurations solely to the resistor change. Overlap is a consistency check, not proof that drift was absent.
| Config | Rb | RL |
|---|---|---|
| A | 1 kΩ | 1 kΩ |
| B | 1 kΩ | 330 Ω |
| C | 47 kΩ | 1 kΩ |
| D | 47 kΩ | 330 Ω |
| A_restore | 1 kΩ | 1 kΩ |
Constructed example: keep the terms separate
The following rounded values are deliberately constructed to exercise the calculation. All rows use VS = 5.000 V and V0 = 2.500 V. They are not a fitted device model, a data-sheet guarantee or a recorded bench result. The nominal divider/current relation agrees only to the shown rounding; the example has no claimed fixed current gain.
| Config | VD / V | VB / V | VE / V | V0−VD / V | VD−VB / V | VBE / V |
|---|---|---|---|---|---|---|
| A | 2.487 | 2.475 | 1.825 | 0.013 | 0.012 | 0.650 |
| B | 2.462 | 2.427 | 1.747 | 0.038 | 0.035 | 0.680 |
| C | 2.490 | 2.067 | 1.422 | 0.010 | 0.423 | 0.645 |
| D | 2.477 | 1.490 | 0.824 | 0.023 | 0.987 | 0.666 |

emitter-follower-reader/assets/constructed-voltage-decomposition.svg.Compare C with D: VE falls by 0.598 V. The divider-sag term grows by 0.013 V, the Rb term by 0.564 V and VBE by 0.021 V. The largest center contribution is the feed-resistor term, not a 0.598 V change of the base–emitter junction. With 1 mV bounds per voltage, the analyzer can still distinguish the large feed-drop change; it must evaluate the smaller changes with their intervals too.
Infer a current only when the subtraction supports it
In the unprobed reference fixture, Rb has one destination: Q1’s base. Then IB = (VD − VB)/Rb. During an actual VB reading, the meter also takes current: that is why the common-reference loading bound matters. A permanently connected base load would require another branch term; this analyzer does not silently correct an extra unknown load.
For VD = d ± ud and VB = b ± ub, the signed drop interval is [(d − ud) − (b + ub), (d + ud) − (b − ub)]. Divide by the positive Rb interval, including its tolerance. If the result includes zero, the direction and nonzero size are unresolved. Keep negative endpoints; clipping to zero invents information. An interval wholly negative conflicts with this forward-current fixture and calls for checking wiring, probe signs, row order or back-powering.
VE/RL is the load-resistor current, not a general measurement of collector current. Do not divide it by an unresolved base current to announce a transistor gain. Beta (β), the DC collector-current/base-current ratio at a stated operating point, is not estimated by this analyzer; no beta is entered, fitted or certified.
Reader files and complete offline code
Reader ZIP includes both editable diagrams and full PNGs, this article and standalone preview, the blank worksheet, two constructed data sets, complete analyzer/tests and README. Fill the blank worksheet — reader ZIP; extract emitter-follower-reader/observations-blank.csv; its empty numeric cells are intentional and are refused until filled. Keep source_kind=measured for your readings. Use qualified only after documenting the total-bound assumptions. Constructed example — reader ZIP; extract emitter-follower-reader/constructed-example.csv and wider constructed bounds — reader ZIP; extract emitter-follower-reader/constructed-wide-bounds.csv remain labelled separately.
The command-line program uses only Python’s standard library and was checked on CPython 3.9.6. It accepts the exact worksheet header, five named configurations, plain finite decimal fields and at most 128 KiB. Rational arithmetic keeps input decimal bounds exact; displayed decimal endpoints round outward. It rejects duplicate/configuration-mismatched rows, missing bounds, unsupported tolerances and supply intervals outside the fixture. Its comparisons are withheld when restoration is missing or outside bounds. This is worksheet analysis, not data acquisition or device control.
python3 code/follower_analyzer.py constructed-example.csv
python3 code/follower_analyzer.py constructed-wide-bounds.csv
python3 -m unittest discover -s tests -v
Complete analyzer: code/follower_analyzer.py
#!/usr/bin/env python3
"""Offline worksheet analyzer; no instrument control, beta fit or physical certification.
Every voltage interval must cover the SAME settled, probes-removed reference
circuit, including meter perturbation, non-simultaneous sampling and drift.
Measured data with unqualified bounds cannot produce either current estimate.
"""
import argparse
import csv
import io
import json
import re
from dataclasses import dataclass
from decimal import Decimal, localcontext, ROUND_FLOOR, ROUND_CEILING
from fractions import Fraction as F
from pathlib import Path
MAX_BYTES = 131072
HEADER = ['config', 'rb_ohm', 'rl_ohm', 'vs_v', 'v0_v', 'vd_v', 'vb_v',
've_v', 'u_vs_v', 'u_v0_v', 'u_vd_v', 'u_vb_v', 'u_ve_v',
'resistor_tol', 'source_kind', 'bounds_scope']
CONFIGS = {'A': (1000, 1000), 'B': (1000, 330), 'C': (47000, 1000),
'D': (47000, 330), 'A_restore': (1000, 1000)}
def number(text):
if not isinstance(text, str) or not re.fullmatch(
r'-?(?:0|[1-9][0-9]{0,5})(?:\.[0-9]{1,6})?', text):
raise ValueError('Use finite plain decimals, at most six fractional digits')
return F(text)
@dataclass(frozen=True)
class Interval:
lo: F
hi: F
def __post_init__(self):
if self.lo > self.hi:
raise ValueError('Reversed interval')
def __sub__(self, other):
return Interval(self.lo - other.hi, self.hi - other.lo)
def __truediv__(self, other):
if other.lo <= 0:
raise ValueError('Divisor must be strictly positive')
values = [a / b for a in (self.lo, self.hi)
for b in (other.lo, other.hi)]
return Interval(min(values), max(values))
def out(self):
def endpoint(x, rounding):
with localcontext() as ctx:
ctx.prec = 12
ctx.rounding = rounding
return str(Decimal(x.numerator) / Decimal(x.denominator))
return {'lo': endpoint(self.lo, ROUND_FLOOR),
'hi': endpoint(self.hi, ROUND_CEILING)}
def interval(row, key):
value, error = number(row[key]), number(row['u_' + key])
if error < 0 or error > F('0.1'):
raise ValueError('Total voltage bound must be from zero to 0.1 V')
return Interval(value - error, value + error)
def sign_state(x):
if x.lo > 0:
return 'positive_conditional'
if x.hi < 0:
return 'inconsistent_forward_fixture'
return 'indeterminate'
def analyze(row):
if set(row) != set(HEADER):
raise ValueError('Unexpected or missing worksheet fields')
config = row['config']
rb, rl = number(row['rb_ohm']), number(row['rl_ohm'])
if config not in CONFIGS or (rb, rl) != CONFIGS[config]:
raise ValueError('Configuration does not match the four-case fixture')
tolerance = number(row['resistor_tol'])
if not 0 <= tolerance <= F('0.01'):
raise ValueError('Use the at-most-one-percent resistors in this fixture')
kind, scope = row['source_kind'], row['bounds_scope']
if kind not in ('constructed', 'measured') or scope not in (
'assumed', 'unqualified', 'qualified'):
raise ValueError('Unknown data or bound scope')
volts = {k: interval(row, k) for k in
('vs_v', 'v0_v', 'vd_v', 'vb_v', 've_v')}
if volts['vs_v'].lo < F('4.75') or volts['vs_v'].hi > F('5.25'):
raise ValueError('Supply interval leaves the 4.75–5.25 V fixture envelope')
if any(number(row[k]) < 0 or number(row[k]) > F('5.25')
for k in ('v0_v', 'vd_v', 'vb_v', 've_v')):
raise ValueError('Node center outside the fixture envelope')
expected_v0 = Interval(volts['vs_v'].lo * (1 - tolerance) / 2,
volts['vs_v'].hi * (1 + tolerance) / 2)
if max(expected_v0.lo, volts['v0_v'].lo) > min(expected_v0.hi, volts['v0_v'].hi):
raise ValueError('Unloaded divider conflicts with equal nominal divider resistors')
if volts['vb_v'].hi < volts['ve_v'].lo:
raise ValueError('Base below emitter: stop and inspect the forward fixture')
terms = {'divider_sag_V': volts['v0_v'] - volts['vd_v'],
'feed_drop_V': volts['vd_v'] - volts['vb_v'],
'vbe_V': volts['vb_v'] - volts['ve_v'],
'output_V': volts['ve_v']}
current = terms['feed_drop_V'] / Interval(
rb * (1 - tolerance), rb * (1 + tolerance))
qualified = kind == 'constructed' or scope == 'qualified'
return {'config': config, 'source_kind': kind, 'bounds_scope': scope,
'scope': 'conditional common-reference intervals; not hardware truth',
**{k: v.out() for k, v in terms.items()},
'feed_current_A': current.out() if qualified else None,
'feed_current_state': sign_state(current) if qualified else
'withheld_unqualified_bounds',
'load_resistor_current_A': (volts['ve_v'] / Interval(
rl * (1 - tolerance), rl * (1 + tolerance))).out() if qualified else None,
'node_intervals_V': {k: v.out() for k, v in volts.items()}}
def from_output(x):
return Interval(F(x['lo']), F(x['hi']))
def delta(first, second, term):
difference = from_output(second[term]) - from_output(first[term])
state = 'positive' if difference.lo > 0 else (
'negative' if difference.hi < 0 else 'indeterminate')
return {'first': first['config'], 'second': second['config'],
'term': term, 'second_minus_first': difference.out(), 'state': state}
def read_csv(data):
if not isinstance(data, bytes) or len(data) > MAX_BYTES:
raise ValueError('Worksheet must be UTF-8 bytes no larger than 128 KiB')
try:
text = data.decode('utf-8')
except UnicodeDecodeError as exc:
raise ValueError('Worksheet is not UTF-8') from exc
try:
reader = csv.DictReader(io.StringIO(text), strict=True)
if reader.fieldnames != HEADER:
raise ValueError('Header/order must match observations-blank.csv exactly')
rows = list(reader)
except csv.Error as exc:
raise ValueError('Malformed CSV') from exc
if not rows or len(rows) > 5:
raise ValueError('Use one to five nonblank configuration rows')
if len({x.get('config') for x in rows}) != len(rows):
raise ValueError('Duplicate configuration')
for row in rows:
analyze(row)
return rows
def report(rows):
results = [analyze(row) for row in rows]
if len({r['source_kind'] for r in results}) != 1:
raise ValueError('Do not mix constructed and measured rows')
if len({r['config'] for r in results}) != len(results):
raise ValueError('Duplicate configuration')
by_id = {r['config']: r for r in results}
restoration = 'missing'
if 'A' in by_id and 'A_restore' in by_id:
a, b = by_id['A']['node_intervals_V'], by_id['A_restore']['node_intervals_V']
overlaps = all(max(from_output(a[k]).lo, from_output(b[k]).lo) <=
min(from_output(a[k]).hi, from_output(b[k]).hi) for k in a)
restoration = ('overlap_only_not_proof_of_stability' if overlaps else
'outside_bounds')
comparable = restoration == 'overlap_only_not_proof_of_stability' and all(
r['source_kind'] == 'constructed' or r['bounds_scope'] == 'qualified'
for r in results)
comparisons = []
if comparable:
for first, second in [('A', 'B'), ('C', 'D'), ('A', 'C'), ('B', 'D')]:
if first in by_id and second in by_id:
comparisons.extend(delta(by_id[first], by_id[second], term)
for term in ('divider_sag_V', 'feed_drop_V',
'vbe_V', 'output_V'))
return {'scope': 'conditional worksheet analysis; no beta or physical certification',
'restoration': restoration, 'rows': results, 'comparisons': comparisons,
'warning': 'Overlapping bounds do not prove absence of drift. Bounds '
'must include observer loading and sequential readings of one reference state.'}
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('worksheet', type=Path)
args = parser.parse_args()
try:
with args.worksheet.open('rb') as stream:
data = stream.read(MAX_BYTES + 1)
result = report(read_csv(data))
except (OSError, ValueError) as exc:
parser.exit(2, 'Refused: ' + str(exc) + '\n')
print(json.dumps(result, indent=2))
if __name__ == '__main__':
main()
Complete behavior tests: tests/test_analyzer.py
import unittest,sys,io,csv,subprocess,tempfile
from pathlib import Path
sys.path.insert(0,str(Path(__file__).resolve().parents[1]/"code"))
try:
import follower_analyzer as m
except ImportError:
m=None
def row(**kw):
d=dict(config="A",rb_ohm="1000",rl_ohm="1000",vs_v="5.000",v0_v="2.500",vd_v="2.487",vb_v="2.475",ve_v="1.825",u_vs_v="0.001",u_v0_v="0.001",u_vd_v="0.001",u_vb_v="0.001",u_ve_v="0.001",resistor_tol="0.01",source_kind="constructed",bounds_scope="assumed")
d.update(kw);return d
class Behavior(unittest.TestCase):
def setUp(self):self.assertIsNotNone(m,"analyzer implementation missing")
def test_feed_current_not_fixed_beta(self):
x=m.analyze(row());self.assertEqual(x["feed_current_state"],"positive_conditional");self.assertLess(float(x["feed_current_A"]["lo"]),0.000012);self.assertGreater(float(x["feed_current_A"]["hi"]),0.000012)
def test_zero_crossing_not_clamped(self):
x=m.analyze(row(u_vd_v="0.02",u_vb_v="0.02"));self.assertEqual(x["feed_current_state"],"indeterminate");self.assertLess(float(x["feed_current_A"]["lo"]),0)
def test_negative_difference_is_inconsistent(self):
self.assertEqual(m.analyze(row(vb_v="2.510"))["feed_current_state"],"inconsistent_forward_fixture")
def test_unqualified_measurement_withholds_current(self):
x=m.analyze(row(source_kind="measured",bounds_scope="unqualified"));self.assertIsNone(x["feed_current_A"]);self.assertEqual(x["feed_current_state"],"withheld_unqualified_bounds")
def test_qualified_measurement_is_still_conditional(self):
x=m.analyze(row(source_kind="measured",bounds_scope="qualified"));self.assertIn("conditional",x["feed_current_state"])
def test_source_outside_fixture_refused(self):
with self.assertRaises(ValueError):m.analyze(row(vs_v="6.0"))
def test_nonfinite_and_exponent_refused(self):
for v in ["nan","inf","1e6","-inf","9"*80]:
with self.subTest(v=v):
with self.assertRaises(ValueError):m.analyze(row(vd_v=v))
def test_missing_bound_refused(self):
with self.assertRaises(ValueError):m.analyze(row(u_vb_v=""))
def test_negative_bound_refused(self):
with self.assertRaises(ValueError):m.analyze(row(u_vb_v="-0.1"))
def test_fixture_identity_mismatch_refused(self):
with self.assertRaises(ValueError):m.analyze(row(config="C",rb_ohm="1000"))
def test_blank_and_duplicate_csv_refused(self):
for rows in [[],[row(),row()]]:
buf=io.StringIO();w=csv.DictWriter(buf,fieldnames=m.HEADER);w.writeheader();w.writerows(rows)
with self.assertRaises(ValueError):m.read_csv(buf.getvalue().encode())
def test_csv_extra_field_refused(self):
b=(",".join(m.HEADER)+",extra\n").encode()
with self.assertRaises(ValueError):m.read_csv(b)
def test_oversized_csv_refused(self):
with self.assertRaises(ValueError):m.read_csv(b"x"*(m.MAX_BYTES+1))
def test_restoration_failure_blocks_comparison(self):
r=[row(),row(config="A_restore",ve_v="1.700")];x=m.report(r);self.assertEqual(x["restoration"],"outside_bounds");self.assertEqual(x["comparisons"],[])
def test_missing_restore_not_called_pass(self):
self.assertEqual(m.report([row()])["restoration"],"missing")
def test_changed_vbe_difference_can_be_indeterminate(self):
a=m.analyze(row());b=m.analyze(row(config="B",rl_ohm="330",vd_v="2.462",vb_v="2.427",ve_v="1.747",u_vb_v="0.02",u_ve_v="0.02"));x=m.delta(a,b,"vbe_V");self.assertEqual(x["state"],"indeterminate")
def test_mixed_source_types_refused(self):
with self.assertRaises(ValueError):m.report([row(),row(config="A_restore",source_kind="measured",bounds_scope="qualified")])
def test_outward_rounding_encloses_third(self):
from fractions import Fraction
x=m.Interval(Fraction(1,3),Fraction(1,3)).out()
self.assertLessEqual(Fraction(x["lo"]),Fraction(1,3));self.assertGreaterEqual(Fraction(x["hi"]),Fraction(1,3))
def test_valid_restore_keeps_conditional_label(self):
x=m.report([row(),row(config="A_restore")]);self.assertEqual(x["restoration"],"overlap_only_not_proof_of_stability");self.assertIn("conditional",x["scope"])
def test_invalid_utf8_refused(self):
with self.assertRaises(ValueError):m.read_csv(b"\xff")
def test_reversed_base_emitter_nodes_refused(self):
with self.assertRaises(ValueError):m.analyze(row(ve_v="2.700"))
def test_unloaded_divider_outside_one_percent_ratio_refused(self):
with self.assertRaises(ValueError):m.analyze(row(v0_v="3.000"))
def test_beyond_bom_resistor_tolerance_refused(self):
with self.assertRaises(ValueError):m.analyze(row(resistor_tol="0.05"))
def test_unclosed_header_maps_to_value_error(self):
try:m.read_csv(b'"config,rb_ohm\n')
except Exception as exc:self.assertIsInstance(exc,ValueError)
else:self.fail("malformed header accepted")
def test_unclosed_header_cli_controlled_refusal(self):
with tempfile.TemporaryDirectory(dir=Path(__file__).parent) as td:
p=Path(td)/"bad.csv";p.write_bytes(b'"config,rb_ohm\n')
r=subprocess.run([sys.executable,m.__file__,str(p)],capture_output=True,text=True)
self.assertEqual(r.returncode,2);self.assertEqual(r.stdout,"");self.assertTrue(r.stderr.startswith("Refused:"));self.assertNotIn("Traceback",r.stderr)
def test_unqualified_measured_withholds_load_current(self):
self.assertIsNone(m.analyze(row(source_kind="measured",bounds_scope="unqualified"))["load_resistor_current_A"])
def test_qualified_and_constructed_load_current_remains_numeric(self):
for r in [row(),row(source_kind="measured",bounds_scope="qualified")]:
x=m.analyze(r);self.assertIsNotNone(x["load_resistor_current_A"]);self.assertGreater(float(x["load_resistor_current_A"]["lo"]),0)
if __name__=="__main__":unittest.main()
The host suite exercises interval signs, indeterminate subtraction, unqualified bounds, missing/failed restoration, outward rounding and refused inputs. It does not prove a circuit was built, a meter was calibrated, the uncertainty entries cover reality, or a target program ran.
Fault checks
- VS below setting or current-limit indicator on: disable and inspect rail shorts, values and terminal mapping before interpreting any row.
- Unloaded V0 far from the equal-divider tolerance interval: inspect R1/R2 values, J1 opening and G0. Do not cure a wrong divider by changing a transistor parameter.
- VB below VE beyond bounds, or an all-negative feed drop: stop; verify Q1’s actual pinout, node labels, probe polarity, source connections and the forward-fixture assumptions.
- Output near the supply: inspect collector/emitter reversal or an unintended connection. A transistor that appears to respond with swapped terminals is not verified correct.
- Only weak-feed rows look different after a meter setup change: verify input-resistance mode and rebuild the loading budget. Do not call it a change in transistor beta.
- Restored A disagrees: examine handling, temperature, source drift, breadboard contact and elapsed settling time. Keep the records; suspend causal comparison rather than choosing convenient readings.
Challenge and worked answer
Keep constructed A’s center values VD = 2.487 V and VB = 2.475 V, but assign each a total bound of 0.010 V. Rb is 1 kΩ ±1%. Can you report a positive 12 µA base current?
Answer
No. The drop spans −0.008 to +0.032 V. Dividing by 990–1010 Ω gives an interval approximately −8.081 to +32.324 µA, rounded outward. Zero is included, so the positive current is indeterminate under those bounds. “12 µA” is only the center calculation. Better justified observations may narrow the interval; removing its negative part cannot.
For the original C-to-D constructed comparison, most output loss is instead assigned to the feed-resistor term. That conclusion follows from several separate node observations and their qualified bounds, not from treating the transistor as a fixed diode drop or assuming a universal gain.
Related experiments and references
For another topology, see the common-emitter partial-bypass experiment. For a closed-loop buffer, compare MCP6002 input loading and output error. Neither substitutes its own assumptions for this common-collector DC fixture.
- onsemi current 2N3904T family and exact BU ordering row; lifecycle is checked for the selected suffix.
- onsemi 2N3904/D revision 3, especially pin identity, Case 135AN and specified test conditions. Typical curves are not a guarantee of this experiment’s voltages.
- Keysight Truevolt data sheet, 34461A DC specifications and measurement characteristics. Recheck the operating guide for the actual firmware’s high-resistance setting.