Jupyter Electronics Lab

Python
Jupyter
circuits
simulation
engineering preparation
A simulation-first electronics pathway students can complete before physical components and kits are available.

Learning goals

  • I can use a notebook to calculate circuit behaviour and check my equations.
  • I can distinguish a hand calculation, numerical model, circuit simulation, and physical measurement.
  • I can preserve code, graphs, checks, and tables as reproducible engineering evidence.
  • I can prepare useful model results now and add measurements later without restarting the investigation.

Why Jupyter comes before the hardware

Physical components, instruments, soldering time, and kits may not be available at the same moment for every student. Jupyter provides meaningful engineering work while students wait. It can repeat calculations, sweep component values, solve systems, model change over time, analyze data, and expose assumptions.

Jupyter does not prove that a circuit was wired correctly or that hardware is safe. Until a physical test occurs, describe results as calculated, modelled, or simulated, never measured.

ImportantThe evidence ladder

Calculate by hand → Model in Jupyter → Simulate the circuit → Measure when available → Compare → Verify

Each layer answers a different question. Agreement builds confidence; disagreement creates a troubleshooting investigation.

Start-now pathway

Stage Notebook What students do now What hardware can add later
Foundation review Notebook 8 Compare small resistor, capacitor, LED, transistor-switch, and op-amp models and name each limitation. Identify real parts, ratings, polarity, pinout, and measured behaviour.
0. Python first steps Notebook 0 Run cells, use simple variables and types, select list items, and change one number in a small array. No hardware is needed.
1. Python and NumPy foundations Notebook 1 Use Jupyter cells, named quantities, lists, functions, arrays, filters, plots, documentation, and assertions in a resistor investigation. Compare one calculated result with a meter reading when hardware is available.
2. Circuit networks Notebook 2 Solve series, parallel, and mixed circuits and verify KCL, KVL, and power. Build one network and compare measured and calculated values.
3A. Two-loop bridge Notebook 3A Derive both signed loop equations, build the matrix, and compare numerical and symbolic solutions. Compare with the released Question 4 answer; no physical lab is required.
3. Coupled equations Notebook 3 Diagnose seeded errors, repair a plausible wrong answer, inspect residuals, and investigate a changed parameter. Compare with a multi-loop circuit when suitable equipment is available.
4. Relationships and design Notebook 4 Sweep values, graph relationships, and test a design range. Test selected points rather than every possible value.
5. Experimental evidence Notebook 5 Import provided CSV data and compare prediction with evidence. Replace or extend the dataset with approved measurements.
6. Independent investigation Notebook 6 Define a question, criterion, model, test, and pass/fail check. Validate the most important assumption physically.
7. RC, op-amps, and calculus Notebook 7 Model RC response, slope, accumulated area, ideal integration, and ideal differentiation. Compare with a simulator, teacher demonstration, ordinary op-amp, or optional XL741 build.

Students do not need to wait for Notebook 7 until an XL741 is soldered. The notebook deliberately supports a complete model-and-simulation submission with the physical column marked not available.

Standard notebook assignment

Every technical notebook submission should contain:

  1. named variables with units;
  2. the smallest working calculation;
  3. at least one independent assertion, residual, conservation check, or limiting case;
  4. a graph or table with labels and units where needed;
  5. one changed parameter and the rerun output;
  6. clear labels separating calculated, modelled, simulated, and measured values; and
  7. the downloaded .ipynb file, reopened and run from the first cell.

Do not add a required reflection, prediction paragraph, written recap, or definition rewrite unless the teacher explicitly asks for it.

Read the documentation before asking for the fix

Coding lessons deliberately include two kinds of faults:

  • an error that stops the program and produces a message;
  • a plausible wrong answer that runs without an error but fails a units, residual, conservation, or limiting-case check.

The sequence always starts from success and increases gradually: run known-good code, repair one incorrect keyword, diagnose an array-shape error, and finally find a silent unit error that produces a believable result.

Use this routine before asking for line-by-line help:

  1. Reproduce: run the smallest cell that still shows the problem.
  2. Read: copy the exact error message, or state which verification check failed.
  3. Inspect: print the relevant values, types, shapes, and units.
  4. Research: try help(function_name), function_name?, or an exact-phrase web search containing the library and function name. Prefer the official documentation.
  5. Repair: change the smallest possible part of the code and explain the documented requirement behind the change.
  6. Verify: restart the kernel, run from the first cell, and use an independent check to show that the result is now trustworthy.
NoteRequired debugging evidence

Submit the original symptom, the search terms used, the documentation source, the requirement you found, the repair, and the verification result. Copying a finished solution without this evidence does not complete the debugging task.

Use Find Documentation and Ask for Programming Help for the full pandas, official-documentation, Stack Overflow, minimal-example, and teacher-help protocol.

A repeatable class cycle

Day 1: understand and calculate

Read the matching electronics notes, draw or interpret the schematic, identify variables and units, and complete one representative hand calculation.

Day 2: model and verify

Run the working notebook, change only the assigned values, and add an independent check.

Day 3: investigate

Sweep one component or condition across a justified range. Use a graph to identify a pattern, threshold, trade-off, or sensitive region.

Day 4: simulate or analyze evidence

Compare the numerical model with a circuit simulator or a supplied dataset. Record differences without forcing them to agree.

Day 5: verify and prepare for hardware

Finish the evidence table, run every check, and identify the physical measurement to add when equipment is available.

RC and XL741 investigation without a kit

Notebook 7 provides the complete start-now route:

  • calculate \(\tau=RC\) and check the 63.2% charging point;
  • graph capacitor voltage and rate of change;
  • approximate a derivative with finite differences;
  • approximate an integral with accumulated rectangles;
  • model ideal op-amp integrator and differentiator outputs;
  • change the time step and test numerical convergence;
  • document real op-amp limits that the ideal model omits;
  • prepare an evidence table for a later simulation or physical test.

If only one XL741 kit is available, the teacher can assemble it gradually and use it as a later class demonstration. Students can contribute predicted values and test plans from their notebooks, then add shared demonstration data with its source clearly labelled. If kits are available to individuals, the same notebook becomes their pre-lab and analysis record.

What the available XL741 kit adds

The photographed XL741 v2.0 assembly guide identifies a genuinely discrete circuit: thirteen 2N3904 NPN transistors, seven 2N3906 PNP transistors, two BAT85 diodes, eleven resistors, and a 33 pF ceramic compensation capacitor. That makes the kit useful after students have studied resistors, capacitors, diodes, transistors, and feedback.

The guide’s suggested first functional test is a unity-gain voltage follower using \(+15\) V and \(-15\) V supply rails, with the input kept within \(\pm13\) V. Notebook 7 now includes that ideal pre-lab sweep. It deliberately does not claim to be a transistor-level simulation of the XL741.

Assembly is a substantial optional activity rather than a requirement for the whole class. It includes many polarity- and orientation-sensitive parts, repeated solder joints, inspection, terminal hardware, and a controlled dual-supply power-up. Use the current manufacturer documentation and a teacher-approved current-limited supply for any build. The photographed manual remains a planning reference and is not republished here.

Assessment boundary

A strong simulation-only notebook can demonstrate modelling, programming, mathematical reasoning, verification, and communication. It cannot demonstrate soldering, safe instrument placement, physical troubleshooting, or measured agreement. Grade those hardware outcomes only when students have a genuine opportunity to perform them.

Submission check

  • Restarting and running all cells completes without an unexpected error.
  • Inputs and outputs have units.
  • Assertions and residual checks pass.
  • Seeded faults include the error or failed check, search terms, documentation evidence, repair, and verification.
  • Graphs and tables are readable and labelled with units.
  • Claims use calculated, modelled, simulated, or measured accurately.
  • Optional hardware absence is stated honestly, not treated as missing student work.
  • The downloaded notebook reopens successfully.

Next steps

Begin with the step-by-step JupyterLite instructions, complete Python First Steps, and only then continue to Python and NumPy Foundations. To start the browser workspace directly, click OPEN JUPYTERLITE NOW, use Upload Files, and double-click the downloaded .ipynb notebook. Use the local Jupyter pathway when a school computer permits installation or the investigation needs packages and files beyond the browser environment.

Help improve this lesson (optional)

If something got in the way, tell the teacher which step or word was unclear, what you still do not know how to do, and one change that would help the next student. If you can fix the wording, diagram, screenshot, or starter code, show the teacher. A useful fix may be added to the course website and credited to you.