TEJ Electronics Course Book

A chaptered guide to circuits, components, digital logic, inputs, control systems, and measurement

Author

Technology Commons

Published

October 7, 2026

How to use this book

This is the main TEJ electronics book. It follows the curriculum sequence so students can move from basic measurements to circuits, components, digital logic, microcontroller inputs, and control systems.

Each chapter uses the same pattern: a simple idea, a familiar example, a schematic or block diagram, the parts of the system, the equations and units, a short GUESS example, and a check using measurement or simulation. The separate quick reference is a short printable extract for assignments and tests.

The diagrams show concepts and classroom-scale circuits. Confirm actual component data, logic voltage, current limits, pinout, polarity, and safety requirements before building.

Measurement and mathematical foundations

Engineering notation and SI prefixes

For a nonzero value, engineering notation uses \(a\times10^{3n}\) with \(1\leq |a|<1000\). The exponent is a multiple of three, so the value converts directly to an SI prefix. Write zero as \(0\).

Value Engineering form Prefix form
\(0.000\,047\ \mathrm{A}\) \(47\times10^{-6}\ \mathrm{A}\) \(47\ \mu\mathrm{A}\)
\(0.0047\ \mathrm{A}\) \(4.7\times10^{-3}\ \mathrm{A}\) \(4.7\ \mathrm{mA}\)
\(4700\ \Omega\) \(4.7\times10^3\ \Omega\) \(4.7\ \mathrm{k}\Omega\)
\(2\,200\,000\ \mathrm{Hz}\) \(2.2\times10^6\ \mathrm{Hz}\) \(2.2\ \mathrm{MHz}\)
Exponent Prefix Symbol
\(10^9\) giga \(\mathrm{G}\)
\(10^6\) mega \(\mathrm{M}\)
\(10^3\) kilo \(\mathrm{k}\)
\(10^0\) base unit -
\(10^{-3}\) milli \(\mathrm{m}\)
\(10^{-6}\) micro \(\mu\)
\(10^{-9}\) nano \(\mathrm{n}\)
\(10^{-12}\) pico \(\mathrm{p}\)

Choose the exponent that keeps the coefficient from \(1\) up to, but not including, \(1000\). For example, \(999\ \Omega\) stays \(999\ \Omega\), while \(1000\ \Omega\) becomes \(1\ \mathrm{k}\Omega\).

H01 Safety and lab practice

A safe electronics workflow begins with a prediction, a current-limited source, a power-off inspection, correct meter setup, and a deliberate decision to energize. Protection belongs near the source so a conductor fault does not leave an unprotected energized path.

A protected 9 V classroom circuit with a source, fuse, switch, resistor, and LED in one series path.
Check Evidence
source voltage and current limit
protection fuse rating and location
control switch starts open
load polarity, value, and power rating
measurement correct jack, function, range, and placement

Worked GUESS check

Step Entry
G \(V_S=9.0\ \mathrm{V}\)
G \(V_F=2.0\ \mathrm{V}\)
G \(R=330\ \Omega\)
U current, \(I\), in amperes
E \(I=(V_S-V_F)/R\)
S \(I=(9.0-2.0)/330\)
S \(I=0.021\ \mathrm{A}=21\ \mathrm{mA}\)

Casio entry

( 9.0 - 2.0 ) ÷ 330 =

Warning: Disconnect immediately for heat, smell, smoke, unstable connections, or uncertainty. Never use an ohmmeter on an energized circuit.

Application and links: Protected indicators, bicycle lights, and low-voltage controls. H01 notes, worksheet, simulation guide, lab, and slides are linked from the module page.

H02 Charge, current, voltage, and energy

Charge is an amount of electric charge. Current is the rate of charge flow. Voltage is energy transferred per unit charge. Energy records the total work transferred over time.

Quantity Relationship Unit
charge \(Q=It\) coulomb, \(\mathrm{C}\)
current \(I=Q/t\) ampere, \(\mathrm{A}\)
voltage \(V=W/Q\) volt, \(\mathrm{V}\)
energy \(E=Pt\) joule, \(\mathrm{J}\)

When it applies: Use these definitions to connect current and time, or power and operating time. Keep seconds with watts for joules. Use hours with watts for watt-hours.

Worked GUESS example

Step Entry
G \(I=0.25\ \mathrm{A}\)
G \(t=120\ \mathrm{s}\)
U charge, \(Q\), in coulombs
E \(Q=It\)
S \(Q=(0.25)(120)\)
S \(Q=30\ \mathrm{C}\)

Casio entry

0.25 × 120 =

Common mistake: Ampere-hours describe charge capacity, not energy, unless voltage is also considered.

Application and links: Battery capacity, USB loads, and vehicle accessories. Course notes.

H03 AC versus DC

Direct current keeps one reference polarity. Alternating current changes direction and usually changes magnitude with time. A waveform must include amplitude, period, frequency, and reference polarity.

Quantity Relationship Unit
period and frequency \(f=1/T\) hertz, \(\mathrm{Hz}\)
sine-wave RMS \(V_{\mathrm{RMS}}=V_P/\sqrt{2}\) volt, \(\mathrm{V}\)
peak-to-peak \(V_{PP}=2V_P\) volt, \(\mathrm{V}\)

Worked GUESS example

Step Entry
G \(T=20.0\ \mathrm{ms}\)
G \(T=20.0\times10^{-3}\ \mathrm{s}\)
U frequency, \(f\), in hertz
E \(f=1/T\)
S \(f=1/(20.0\times10^{-3})\)
S \(f=50.0\ \mathrm{Hz}\)

Casio entry

1 ÷ ( 20 EXP (-) 3 ) =

Warning: Classroom breadboards and handheld meters must not connect directly to mains. Use approved isolated low-voltage sources.

Application and links: Batteries supply DC. Wall adapters often rectify AC into DC. Alternators and audio signals produce changing waveforms. See All About Circuits.

H04 Schematic symbols and circuit anatomy

A schematic shows electrical relationships rather than physical layout. Nodes joined by an uninterrupted conductor share the same ideal voltage. A crossing without a junction dot does not automatically mean a connection.

Block Function
source supplies electrical energy
protection opens or limits an abnormal condition
control changes the intended operating state
load converts electrical energy
conductor completes the intended path

When it applies: Draw a proper schematic before simulation or physical construction. Label component references and values. Keep a separate wiring or breadboard layout when physical placement matters.

Worked check: Trace from the source through protection, control, load, and back to the source. If any intended series connection is open, current is zero.

Common mistake: A lamp symbol and LED arrows describe different devices. Use a proper LED symbol with a separate current-limiting resistor.

Application and links: Service manuals, PCB design, simulation, and troubleshooting. Related H01 downloads are on the electronics library.

H05 Multimeter fundamentals

The meter connection depends on the measured quantity. A voltmeter compares two nodes. An ammeter becomes part of the current path. An ohmmeter supplies its own test signal and therefore requires an isolated, de-energized circuit.

Measurement Placement State
voltage parallel energized if approved
current series energized after setup check
resistance or continuity across isolated part power off and discharged

Expected-reading example: In an open series circuit, current is \(0\ \mathrm{A}\). The open switch can have the full source voltage across it while intact components have zero current-produced drop.

Warning: Never place a current-configured meter directly across a source. Return the red lead from the current jack after the reading.

Application and links: Bench diagnosis, continuity checks, supply verification, and component screening. Use the H01 lab and measurement notes.

H06 Resistance and resistor identification

Resistance relates voltage to current and converts electrical energy into heat. A resistor selection needs resistance, tolerance, power rating, and a suitable package.

Relationship Use
\(R=V/I\) calculate required resistance
\(P=I^2R\) check resistor heating
\(G=1/R\) convert to conductance

Worked GUESS example

Step Entry
G \(V=5.0\ \mathrm{V}\)
G \(I=10.0\ \mathrm{mA}\)
G \(I=10.0\times10^{-3}\ \mathrm{A}\)
U resistance, \(R\), in ohms
E \(R=V/I\)
S \(R=5.0/(10.0\times10^{-3})\)
S \(R=500\ \Omega\)

Casio entry

5.0 ÷ ( 10.0 EXP (-) 3 ) =

Common mistake: The colour code gives nominal value and tolerance. It does not guarantee the resistor can dissipate the calculated power.

Application and links: Current limiting, bias networks, dividers, timing networks, and sensor interfaces. See the component index.

DC circuit foundations

H07 Ohm’s law

Ohm’s law describes the relationship among voltage, current, and resistance for a component or network under the stated operating conditions.

Ohm’s law triangle with voltage above current and resistance.
Symbol Meaning Unit
\(V\) potential difference volt, \(\mathrm{V}\)
\(I\) current ampere, \(\mathrm{A}\)
\(R\) resistance ohm, \(\Omega\)

Worked GUESS example

Step Entry
G \(V=12.0\ \mathrm{V}\)
G \(R=680\ \Omega\)
U current, \(I\), in amperes
E \(I=V/R\)
S \(I=12.0/680\)
S \(I=0.0176\ \mathrm{A}\)
S \(I=17.6\ \mathrm{mA}\)

Casio entry

12.0 ÷ 680 =

Common mistake: Do not apply one component’s voltage across a different component. Mark the two nodes that define each voltage.

Application and links: LED resistors, sensors, lamps, heaters, and conductors. Ohm’s law notes.

H08 Power and energy

Power is the rate of energy transfer. A design must keep every component below its voltage, current, and power limits with an appropriate margin.

\[P=VI=I^2R=\frac{V^2}{R} \qquad E=Pt\]

Worked GUESS example: A \(12.0\ \mathrm{V}\) lamp draws \(0.50\ \mathrm{A}\). \(P=(12.0)(0.50)=6.0\ \mathrm{W}\). In \(2.0\ \mathrm{h}\) it uses \(12\ \mathrm{Wh}\).

Casio sequence

12.0 × 0.50 =

Ans × 2.0 =

Warning: A component with the correct resistance can still overheat if its power rating is too low.

Application and links: Power supplies, battery runtime, wire heating, and resistor selection. Power and energy notes.

H09 Series circuits

Series components form one current path. The same current passes through every series component, while the source voltage divides among them.

Series circuit with one path and the same current through both resistors.

\[I_T=I_1=I_2 \qquad V_T=V_1+V_2 \qquad R_T=R_1+R_2\]

Worked GUESS example: \(R_1=220\ \Omega\) and \(R_2=330\ \Omega\) on \(9.0\ \mathrm{V}\). \(R_T=550\ \Omega\) and \(I_T=9.0/550=16\ \mathrm{mA}\).

Common mistake: Components are not in series when another branch leaves their shared node.

Application and links: Strings of components, current sensing, and voltage division. Use the basic-circuit worksheet from the electronics library.

H10 Parallel circuits

Parallel branches connect to the same two nodes, so every branch has the same voltage. Total current is the sum of branch currents.

Parallel circuit with separate branches and the same voltage across both resistors.

\[V_T=V_1=V_2 \qquad I_T=I_1+I_2 \qquad \frac{1}{R_T}=\frac{1}{R_1}+\frac{1}{R_2}\]

Worked GUESS example: \(R_1=1.0\ \mathrm{k}\Omega\) and \(R_2=2.0\ \mathrm{k}\Omega\) on \(10.0\ \mathrm{V}\). \(I_1=10\ \mathrm{mA}\), \(I_2=5.0\ \mathrm{mA}\), and \(I_T=15\ \mathrm{mA}\).

Common mistake: The equivalent resistance must be smaller than the smallest branch resistance.

Application and links: Household branches, vehicle accessories, computer loads, and multiple indicators. Use the parallel-load activity in the basic-circuit worksheet.

Network analysis

H11 Series-parallel circuits and Kirchhoff’s laws

Reduce only groups that are clearly series or parallel. Kirchhoff’s current law checks charge conservation at a node. Kirchhoff’s voltage law checks energy transfer around a closed loop.

Kirchhoff current law at a node and voltage law around a closed loop, with equations.

Method: mark nodes, identify series and parallel groups, reduce the network, solve total values, then expand back to branch values. Verify KCL and KVL at the end.

Worked check: If \(I_T=30\ \mathrm{mA}\) enters a node and \(I_1=12\ \mathrm{mA}\) leaves, then \(I_2=18\ \mathrm{mA}\).

Common mistake: A negative result often means the actual direction is opposite to the assumed reference. It does not automatically mean the calculation failed.

Application and links: Multi-load power distribution and troubleshooting. Related practice and answer keys are indexed in the electronics library.

H12 Voltage and current dividers

A voltage divider produces an unloaded fraction of the input voltage. Connecting a load changes the lower effective resistance and therefore changes the output.

\[V_{\mathrm{out}}=V_{\mathrm{in}}\frac{R_2}{R_1+R_2}\]

For two parallel branches:

\[I_1=I_T\frac{R_2}{R_1+R_2} \qquad I_2=I_T\frac{R_1}{R_1+R_2}\]

Worked GUESS example

Step Entry
G \(V_{\mathrm{in}}=5.0\ \mathrm{V}\)
G \(R_1=3.3\ \mathrm{k}\Omega\)
G \(R_2=2.2\ \mathrm{k}\Omega\)
U output voltage, \(V_{\mathrm{out}}\), in volts
E \(V_{\mathrm{out}}=V_{\mathrm{in}}R_2/(R_1+R_2)\)
S \(V_{\mathrm{out}}=(5.0)(2.2)/(3.3+2.2)\)
S \(V_{\mathrm{out}}=2.0\ \mathrm{V}\)

Casio entry

5.0 × 2.2 ÷ ( 3.3 + 2.2 ) =

Warning: A divider is not a regulated power supply. Load current can move the output far from the unloaded result.

Application and links: Potentiometers, sensor scaling, reference voltages, and biasing. See the common reference circuits in this handbook.

H13 Thevenin, Norton, and maximum power

This optional extension replaces a linear two-terminal network with a simpler equivalent. A Thevenin equivalent uses \(V_{TH}\) in series with \(R_{TH}\). A Norton equivalent uses \(I_N\) in parallel with \(R_N\).

\[V_{TH}=I_NR_{TH} \qquad R_N=R_{TH}\]

When it applies: Use equivalents to predict how different loads affect the same source network. Determine \(R_{TH}\) using the approved source-deactivation method for the circuit type.

Worked check: If \(V_{TH}=6.0\ \mathrm{V}\) and \(R_{TH}=1.0\ \mathrm{k}\Omega\), then \(I_N=6.0\ \mathrm{mA}\).

Warning: Maximum power transfer does not mean maximum efficiency. At the matching condition, the source resistance dissipates substantial power.

Application and links: Sensor networks, amplifier inputs, source modelling, and fault analysis. See All About Circuits network theorems.

Components and semiconductor circuits

H14 Conductors and protection

Conductor resistance causes voltage drop and heating. Protection must interrupt fault current before the conductor or connected equipment reaches an unsafe condition.

\[R=\rho\frac{L}{A} \qquad V_{\mathrm{drop}}=IR_{\mathrm{wire}} \qquad P_{\mathrm{loss}}=I^2R_{\mathrm{wire}}\]

Worked check: \(I=2.0\ \mathrm{A}\) through \(0.15\ \Omega\) of wiring gives \(V_{\mathrm{drop}}=0.30\ \mathrm{V}\) and \(P_{\mathrm{loss}}=0.60\ \mathrm{W}\).

Warning: Select fuses and conductors from approved equipment and manufacturer data. Never replace a fuse with a higher rating merely to stop nuisance opening.

Application and links: USB cables, vehicle branches, battery wiring, and PCB traces. H01 shows source-side protection.

H15 Batteries and sources

Series cells add voltage. Matched parallel cells can increase available ampere-hour capacity while keeping nominal voltage unchanged. Real sources have current, energy, temperature, and charging limits.

\[E_{\mathrm{Wh}}=VQ_{\mathrm{Ah}} \qquad t\approx\frac{Q_{\mathrm{Ah}}}{I_{\mathrm{A}}}\]

Worked check: A \(5.0\ \mathrm{V}\), \(2.0\ \mathrm{Ah}\) source stores a nominal \(10\ \mathrm{Wh}\). Actual runtime depends on conversion loss, load profile, cut-off voltage, and battery condition.

Warning: Use the correct charger and protection system for the battery chemistry. Do not assemble unmatched cells in parallel.

Application and links: Power banks, portable equipment, robotics, and backup supplies. Restricted battery references remain in the teaching Drive.

H16 Faults and troubleshooting

Troubleshooting compares expected and observed evidence. Begin with the symptom, inspect, confirm the source, divide the system into sections, and change one thing at a time.

Fault Typical evidence
open zero path current; voltage can appear across the break
short low unintended resistance; excessive current or source limiting
wrong value current or voltage differs consistently from prediction
intermittent reading changes with movement, heat, or vibration

Diagnostic sequence: observe, inspect, predict, measure safely, isolate, test with power off, repair, and verify normal operation.

Warning: Do not create destructive shorts as a classroom test. Treat a blown fuse as evidence of a fault, not the root cause.

Application and links: Repair, commissioning, quality control, and maintenance. Use the H01 open-fault activity.

H17 Magnetism and electromagnetism

Current produces a magnetic field. Changing magnetic flux can induce voltage. Coils store energy in a magnetic field and resist rapid changes in current.

\[E_L=\frac{1}{2}LI^2 \qquad v_L=L\frac{\Delta I}{\Delta t}\]

The finite-difference form uses a measured change over a time interval and does not require calculus.

Worked check: A \(0.10\ \mathrm{H}\) coil changes by \(0.50\ \mathrm{A}\) in \(0.020\ \mathrm{s}\). The average induced magnitude is \(2.5\ \mathrm{V}\).

Warning: Interrupting inductive current can produce a high voltage. Provide an appropriate suppression path.

Application and links: Speakers, solenoids, relays, motors, transformers, and ignition systems.

H18 Relays, solenoids, and motors

Electromagnetic actuators often draw more current than a logic output can provide. A transistor or driver board controls the load, while a diode or other suppressor manages inductive turn-off energy.

Device Electrical input Mechanical output
relay coil current contact state
solenoid coil current linear force or motion
DC motor voltage and current rotation and torque

Design check: use the load’s rated and stall current, driver limits, supply capability, and flyback protection. Separate classroom control signals from higher-energy power wiring.

Application and links: Locks, valves, fans, pumps, conveyors, and vehicle controls. Related motor-control material appears in C09.

H19 Capacitors and RC response

A capacitor stores energy in an electric field and opposes rapid voltage change. In a simple RC step response, one time constant reaches about \(63.2\%\) of the final change.

\[Q=CV \qquad E_C=\frac{1}{2}CV^2 \qquad \tau=RC\]

Worked GUESS example: \(R=10\ \mathrm{k}\Omega\) and \(C=100\ \mu\mathrm{F}\) give \(\tau=(10\times10^3)(100\times10^{-6})=1.0\ \mathrm{s}\).

Warning: Confirm polarity and voltage rating. Discharge stored energy safely before resistance measurements or handling.

Application and links: Timing, filtering, energy storage, reset circuits, and hardware debouncing.

H20 Inductors and LR response

An inductor stores magnetic-field energy and opposes rapid current change. A simple LR circuit has time constant \(\tau=L/R\).

\[E_L=\frac{1}{2}LI^2 \qquad \tau=\frac{L}{R}\]

Worked check: \(L=0.50\ \mathrm{H}\) and \(R=100\ \Omega\) give \(\tau=5.0\ \mathrm{ms}\).

Warning: Current can continue after the control device turns off. Provide a safe path and check the resulting release time.

Application and links: Relay coils, motor windings, filters, energy conversion, and ignition coils.

H21 Diodes and LEDs

A diode conducts primarily in one direction within its ratings. An LED requires correct polarity and an independent current-limiting element.

\[R=\frac{V_S-V_F}{I_{\mathrm{LED}}} \qquad P_R=I_{\mathrm{LED}}^2R\]

Worked GUESS example: For \(V_S=5.0\ \mathrm{V}\), \(V_F=2.0\ \mathrm{V}\), and \(I=10\ \mathrm{mA}\), \(R=300\ \Omega\). Choose a suitable standard value and recalculate actual current.

Warning: \(V_F\) varies with device, current, and temperature. Do not connect an LED directly across a stiff voltage source.

Application and links: Indicators, lighting, polarity protection, flyback paths, and rectification. See the H01 circuit.

H22 Rectifiers and power supplies

Rectifiers convert alternating polarity into one-direction current. Filtering reduces ripple, and regulation holds the output closer to a target despite load and input changes.

Stage Function
transformer or approved adapter isolation and voltage conversion
rectifier one-direction current
filter capacitor stores energy between peaks
regulator controls output voltage

Design check: verify diode current and reverse-voltage ratings, capacitor voltage and ripple-current ratings, regulator dissipation, and load current.

Warning: Use only approved isolated low-voltage classroom sources. Mains construction requires specialized equipment, training, and supervision.

Application and links: Wall adapters, bench supplies, chargers, and embedded systems.

H23 Transistor as a switch

A small control signal can switch a larger load current through a BJT, MOSFET, or driver board. A low-side switch places the switching device between the load and ground.

Reference circuits including an NPN low-side driver with a flyback diode.

\[R_B=\frac{V_{\mathrm{drive}}-V_{BE}}{I_B} \qquad I_B\geq\frac{I_C}{\beta_{\mathrm{forced}}}\]

Warning: Confirm pinout, device limits, switching loss, ground reference, and flyback protection. GPIO pins do not drive motors directly.

Application and links: Relays, motors, solenoids, lamps, and higher-current indicators.

H24 555 timer

The 555 timer compares capacitor voltage with internal thresholds to create delays or oscillation.

\[t_{\mathrm{mono}}\approx1.1RC\]

\[f_{\mathrm{astable}}\approx\frac{1.44}{(R_A+2R_B)C}\]

Worked check: \(R=100\ \mathrm{k}\Omega\) and \(C=10\ \mu\mathrm{F}\) give \(t\approx1.1\ \mathrm{s}\).

Warning: Check the timer version, supply range, output-current capability, capacitor polarity, and actual threshold tolerances.

Application and links: Delays, flashers, pulse generation, missing-pulse detection, and simple control.

H25 AC impedance, resonance, and filters

Reactance describes frequency-dependent opposition. Resonance occurs when inductive and capacitive effects balance in an idealized network.

\[X_C=\frac{1}{2\pi fC} \qquad X_L=2\pi fL \qquad f_0=\frac{1}{2\pi\sqrt{LC}}\]

Worked check: \(C=100\ \mathrm{nF}\) at \(1.0\ \mathrm{kHz}\) gives \(X_C\approx1.59\ \mathrm{k}\Omega\).

Warning: Real components include resistance, tolerance, voltage limits, current limits, and parasitic effects.

Application and links: Audio, communication, sensor filtering, power conversion, and interference control.

H26 Amplifiers and op-amps

An amplifier uses a power source and a control signal to produce a larger or better-conditioned output. Negative feedback can set a predictable closed-loop gain.

\[A_V=\frac{V_{\mathrm{out}}}{V_{\mathrm{in}}}\]

For an ideal non-inverting op-amp stage:

\[A_V=1+\frac{R_F}{R_G}\]

Worked check: \(R_F=9.0\ \mathrm{k}\Omega\) and \(R_G=1.0\ \mathrm{k}\Omega\) give \(A_V=10\).

Warning: Output cannot exceed the available supply range. Check input common-mode range, output swing, bandwidth, and load current.

Application and links: Sensor conditioning, audio, comparators, filters, and closed-loop control.

Digital logic

L01 Logic gates

Digital logic represents defined voltage ranges as logic states. A gate performs a Boolean operation on one or more inputs. A small bubble on a symbol means inversion.

Large standard symbols for NOT, AND, OR, XOR, NAND, NOR, and XNOR logic gates.
Gate Boolean form Output is 1 when
NOT \(Y=\overline{A}\) input is 0
AND \(Y=AB\) every input is 1
OR \(Y=A+B\) at least one input is 1
XOR \(Y=A\oplus B\) inputs differ
NAND \(Y=\overline{AB}\) AND would be 0
NOR \(Y=\overline{A+B}\) every input is 0
XNOR \(Y=\overline{A\oplus B}\) inputs match

Warning: Logic symbols do not define safe voltage. Check the device family, supply voltage, input thresholds, and output-current limits.

L02 Truth tables

A truth table lists every possible input combination. For \(n\) inputs, make \(2^n\) rows. Count in binary from all zeros to all ones, changing the rightmost bit every row.

\(A\) \(B\) AND OR XOR NAND NOR XNOR
0 0 0 0 0 1 1 1
0 1 0 1 1 1 0 0
1 0 0 1 1 1 0 0
1 1 1 1 0 0 0 1

Three-input, two-output template

Count \(A\) \(B\) \(C\) Output 1 Output 2
0 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1

Common mistake: The Count column is a row-order check. It is not a logic input or output.

L03 Full-adder example

A full adder accepts input bits \(A\), \(B\), and \(C_{\mathrm{in}}\). It produces a sum bit \(S\) and carry bit \(C_{\mathrm{out}}\).

\[S=A\oplus B\oplus C_{\mathrm{in}}\]

\[C_{\mathrm{out}}=AB+C_{\mathrm{in}}(A\oplus B)\]

Count \(A\) \(B\) \(C_{\mathrm{in}}\) \(S\) \(C_{\mathrm{out}}\)
0 0 0 0 0 0
1 0 0 1 1 0
2 0 1 0 1 0
3 0 1 1 0 1
4 1 0 0 1 0
5 1 0 1 0 1
6 1 1 0 0 1
7 1 1 1 1 1

Test case: 011 means \(A=0\), \(B=1\), and \(C_{\mathrm{in}}=1\). The result is \(S=0\) and \(C_{\mathrm{out}}=1\).

Application and links: Arithmetic logic, counters, and processors. Continue to stable physical inputs before connecting switches to logic or microcontrollers.

Digital inputs and microcontroller interfacing

D01 Digital voltage levels and logic states

A digital input does not measure an abstract 0 or 1. It measures voltage and compares that voltage with device-specific thresholds. Values below \(V_{IL(\max)}\) read low. Values above \(V_{IH(\min)}\) read high. The region between those limits is not guaranteed.

System example Typical logic supply Interface rule
many classic Arduino boards \(5\ \mathrm{V}\) confirm the exact board and processor
Raspberry Pi GPIO \(3.3\ \mathrm{V}\) inputs are 3.3 V tolerant, not general 5 V inputs
micro:bit and many modern MCUs \(3.3\ \mathrm{V}\) check pin data before connection

Warning: A 5 V power pin beside a GPIO header does not make the GPIO 5 V tolerant. Use an approved divider, buffer, or level shifter when voltage domains differ.

Application and links: Digital sensors, switches, encoders, and logic outputs. See the official Raspberry Pi GPIO documentation.

D02 Switches as inputs and floating inputs

A switch can connect an input to a rail, but the open switch leaves no defined path unless another component establishes the idle state. A high-impedance input can then respond to leakage, nearby signals, static charge, or a hand approaching the wire.

An unconnected GPIO input marked incorrect because it has no defined voltage.
Switch position Electrical connection Pin voltage Logic state Interpretation
open, no pull resistor undefined unpredictable ? invalid
closed to ground ground near \(0\ \mathrm{V}\) 0 defined
closed to supply supply near \(V_{CC}\) 1 defined

Common mistake: A simulator may display one stable value for a floating input. The physical input remains undefined.

D03 External pull-down resistor

A pull-down resistor connects the input weakly to ground. The input reads 0 while the switch is open. Closing the switch connects the input strongly to \(V_{CC}\) and produces 1.

A switch connects a GPIO input to VCC while an external resistor pulls the open input to ground.
Switch Electrical connection Pin voltage Logic Meaning
open through \(R_{PD}\) to ground about \(0\ \mathrm{V}\) 0 inactive
closed directly to \(V_{CC}\) about \(V_{CC}\) 1 active

The input draws almost no current. When the switch closes, the resistor is not placed directly across the source in this topology because both resistor ends rise toward \(V_{CC}\). The resistor still establishes a defined open-switch state.

Application: Active-high pushbuttons and sensors that connect an input to the positive rail.

D04 External pull-up resistor

A pull-up resistor connects the input weakly to \(V_{CC}\). The input reads 1 while the switch is open. Closing the switch connects the input to ground and produces 0.

A resistor pulls a GPIO input to VCC while a switch connects the input to ground when pressed.
Switch Electrical connection Pin voltage Logic Meaning
open through \(R_{PU}\) to \(V_{CC}\) about \(V_{CC}\) 1 inactive
closed directly to ground about \(0\ \mathrm{V}\) 0 active

When the switch closes, current through the resistor is limited to approximately \(I=V_{CC}/R_{PU}\). The resistor prevents the switch from shorting the source.

Active-low interpretation

The pressed state is active at logic 0, so the signal may be written \(\overline{\mathrm{BUTTON}}\), /BUTTON, or BUTTON_N according to the project convention.

Worked GUESS check: A \(10\ \mathrm{k}\Omega\) pull-up on \(5.0\ \mathrm{V}\) carries \(0.50\ \mathrm{mA}\) while the switch is pressed.

D05 Internal microcontroller pull-ups

Many microcontrollers can connect a built-in resistor from an input pin to the device supply. The external circuit still behaves like a pull-up: connect the switch between the input and ground, then interpret a pressed switch as low.

Equivalent circuit for a software-enabled pull-up resistor inside a microcontroller.

Example Arduino configuration:

pinMode(buttonPin, INPUT_PULLUP);
bool pressed = digitalRead(buttonPin) == LOW;

Use an external resistor when the internal value is too weak or poorly specified, when the line is long or noisy, when a defined state must exist during reset, or when the interface requires a different voltage or timing value. Confirm the specific processor data.

The official Arduino digital-pin documentation explains that an unconnected input can change randomly and that INPUT_PULLUP enables the internal resistor.

D06 Contact bounce and debouncing

Mechanical contacts can open and close several times during one physical press. A fast digital input may interpret one press as many events. Debouncing can use time-based software, a state machine, an RC network with a suitable threshold input, or a dedicated debounce circuit.

An RC network filters rapid transitions from a switch before the GPIO input.

\[\tau=RC\]

Worked GUESS check: \(R=10\ \mathrm{k}\Omega\) and \(C=100\ \mathrm{nF}\) give \(\tau=1.0\ \mathrm{ms}\). This is a starting calculation, not proof of reliable operation.

Warning: A slow edge can spend time between valid logic thresholds. Use a Schmitt-trigger input or another approved method where clean transitions are required.

D07 GPIO voltage, current, and input protection

An input-protection network can limit fault current and clamp moderate transients, but it does not make incompatible voltage levels safe by itself. Start with the receiving device’s absolute maximum ratings and input thresholds.

A digital input with a series resistor and upper and lower clamp diodes.
Check Question
voltage compatibility Will high and low fall inside guaranteed input ranges?
absolute maximum Can any fault exceed the allowed pin voltage?
clamp current Does the series resistor keep current within device limits?
power sequencing Can an external signal feed an unpowered device?
environment Are long wires, static, or inductive loads present?

Warning: Do not imply universal 5 V tolerance. Raspberry Pi documentation identifies its general-purpose pins as 3.3 V GPIO. Confirm every board and shield separately.

D08 Circuits culminating project

Complete the circuits strand before beginning the separate microcontroller strand. Build a small logic system with stable switch inputs, at least two logic functions, indicators, and an output-driver stage where the load exceeds logic-gate capability.

A pull-down switch drives one input of an AND gate while the other input is a separate logic signal.

Required evidence cycle: Predict, calculate using GUESS, draw the schematic, simulate or verify, build or test, compare expected and observed results, diagnose one fault or limitation, then explain and reflect.

Possible systems: access interlock model, two-button game, alarm logic, bicycle-light controller, or miniature conveyor permissive circuit.

Assessment: mathematical reasoning, schematic quality, verification evidence, safe construction, troubleshooting, design decisions, and communication.

Control systems and motion control

C01 Control-system anatomy

A control system uses an input and a controller to influence a process or plant. The output describes the result. A disturbance changes the process without being requested. In a feedback system, a sensor returns the measured output so the controller can compare it with the setpoint.

Open-loop, closed-loop, PID, and CNC reference block diagrams.

\[e=r-y\]

Symbol Meaning
\(r\) setpoint or reference
\(y\) measured output
\(e\) error
\(u\) controller output

Application: thermostats, cruise control, motor drives, robotics, and CNC machines.

C02 Open-loop control

An open-loop controller does not measure whether the process reached the intended result. It can be simple and predictable when the load and environment remain consistent, but it cannot automatically correct a disturbance.

Examples: timed motor operation, fixed PWM, toaster timers, simple conveyors, and stepper systems without position feedback.

Prediction activity: Sketch expected output for a motor commanded to \(60\%\) PWM. Add a disturbance that increases load at \(t=5\ \mathrm{s}\). The command stays fixed while actual speed can fall.

Design change: Add a speed sensor and explain what new information becomes available. This changes the architecture to closed loop.

C03 Closed-loop feedback

A closed-loop controller measures output and calculates error. Negative feedback applies a correcting action intended to reduce the error.

\[e=r-y\]

Worked check: A temperature setpoint is \(24.0^\circ\mathrm{C}\) and the measured value is \(21.5^\circ\mathrm{C}\). The error is \(+2.5^\circ\mathrm{C}\), so a heating controller should increase its command.

Evidence: Plot setpoint and measured output on the same time axis. Mark rise time, overshoot, steady-state error, or cycling when those features apply.

Application: Thermostats, cruise control, regulated power supplies, and servo position systems.

C04 On-off control and hysteresis

On-off control applies full output in one state and zero output in the other. A single threshold can cause rapid switching when noise or thermal lag moves the measured value around the setpoint. Hysteresis uses separate turn-on and turn-off thresholds.

For heating with setpoint \(r\) and half-band \(h\):

  • turn on when \(y<r-h\)
  • turn off when \(y>r+h\)
  • keep the previous state inside the band

Worked check: With \(r=22^\circ\mathrm{C}\) and \(h=1^\circ\mathrm{C}\), heat turns on below \(21^\circ\mathrm{C}\) and turns off above \(23^\circ\mathrm{C}\).

Investigation: Compare the cycling frequency with \(h=0\), \(0.5\), and \(1.0^\circ\mathrm{C}\) using the same simulated room.

C05 Proportional control

Proportional control makes the command proportional to present error.

\[u=K_Pe\]

Worked check: If \(K_P=20\%\) output per degree and \(e=2.0^\circ\mathrm{C}\), then \(u=40\%\) before applying output limits.

Increasing \(K_P\) often speeds the response and reduces steady-state error, but excessive gain can cause overshoot or oscillation. Output saturation limits the command to what the actuator can deliver.

Investigation: Use one simulated process and compare low, medium, and high \(K_P\). Record rise time, overshoot, and final error.

C06 Integral, derivative, and PID control

Integral action responds to accumulated error and can remove steady-state error. Derivative action responds to how quickly error changes and can reduce overshoot, but measurement noise can make derivative action unstable. PID combines all three actions.

For a classroom spreadsheet or sampled simulation:

\[u_k=K_Pe_k+K_I\sum_{j=0}^{k}e_j\Delta t+K_D\frac{e_k-e_{k-1}}{\Delta t}\]

Mode Main benefit Main limitation
P simple, fast correction steady-state error can remain
PI removes persistent error windup and added overshoot
PD anticipates rapid change noise sensitivity
PID combines the three actions more tuning and protection required

Concept checks: Integral windup occurs when error continues accumulating while the output is saturated. Anti-windup limits or pauses that accumulation. Derivative filtering reduces the effect of noisy measurements.

Manual tuning investigation: Start with all gains at zero. Increase \(K_P\) until the response is useful. Add a small \(K_I\) to remove remaining error. Add \(K_D\) only if the simulation and measurement quality support it. Compare graphs after each change.

Safety: Tune in simulation or data analysis before physical implementation. Keep actuator limits and safe shutdown independent of the software controller.

C07 Sequential control and state machines

A state machine describes what the system is doing now, which inputs permit a transition, and which outputs belong to each state. Include reset and fault states rather than treating them as afterthoughts.

State Outputs Transition condition
idle motor off start and guards safe
run motor command active stop, limit, or timer done
complete indicator on reset
fault outputs safe fault cleared and reset approved

Application: Elevators, vending machines, traffic lights, games, and production sequences.

Design check: Every state needs a defined response to stop, fault, and reset inputs.

C08 Safety controls and interlocks

Safety controls use normally closed stop circuits, guard or door interlocks, limit switches, and defined fault states so a broken wire tends to stop operation rather than hide the fault.

Fail-safe principle: Loss of the healthy signal should move the classroom model toward the safe state.

Warning: Classroom circuits demonstrate principles only. Certified industrial safety functions require approved components, risk assessment, validated architecture, documentation, and qualified supervision.

Evidence: Draw normal, stop, guard-open, and wire-break states. Explain which energy source each control removes or inhibits.

C09 Motor and motion control

Motion systems combine power electronics, motors, sensors, and command signals. A logic output usually controls a transistor, MOSFET, H-bridge, servo interface, stepper driver, or motor-control board rather than the motor directly.

Method Main signals Typical feedback
DC motor direction and PWM encoder or speed sensor
hobby servo command pulse internal position feedback
stepper driver step and direction often open loop; optional encoder
H-bridge direction and PWM current, speed, or position as designed

Checks: supply voltage, running and stall current, driver rating, thermal path, flyback or recirculation path, direction logic, and stop behaviour.

C10 CNC as a control system

A CNC system connects CAD geometry, CAM toolpaths, G-code, a controller, motor drives, axes, feedback or step counts, limit and home switches, spindle or tool control, and the physical process. Work coordinates relate the programmed part to the actual setup.

Layer Role
CAD defines geometry
CAM selects tools and creates toolpaths
G-code expresses machine motion and functions
controller plans and coordinates motion
drives and motors move the axes
machine and process create the physical result

Open-loop stepper systems assume commanded steps produced motion. Closed-loop servo systems measure motion and correct error. Both need homing, limits, interlocks, and an emergency-stop strategy appropriate to the machine.

LinuxCNC supports open-loop stepper and closed-loop servo architectures and provides motion planning, I/O control, HAL connections, and G-code interpretation. Use simulation before a supervised machine test. See the official LinuxCNC architecture overview.

Cross-link tooling, materials, CAD, CAM, laser cutting, and shop-safety resources from the existing Teaching Materials collection instead of duplicating downloads.

C11 Control-systems and CNC culminating project

Choose one pathway: simulated thermostat with hysteresis, motor-speed investigation, servo position system, stepper axis with homing and limits, elevator state machine, vending-machine controller, logic game, miniature conveyor, CNC subsystem model, or supervised LinuxCNC configuration and machine test.

Required engineering evidence

  1. System block diagram and state or control description.
  2. Expected-response prediction.
  3. Sample data or simulation with setpoint and measured output over time.
  4. Identification of rise time, overshoot, steady-state error, or cycling where relevant.
  5. One design change and evidence showing whether performance improved.
  6. Fault, limit, and safe-state analysis.
  7. Written engineering conclusion.

Comparison requirement: Use the same simulated process to compare open loop, on-off control, on-off with hysteresis, proportional control, and PI or PID control.

Boundary: A physical PID build is optional. LinuxCNC machine operation requires suitable equipment, an approved setup, and direct supervision.

Calculator procedures and measurement reference

R01 Casio fx-991ES PLUS C procedures

Task Key sequence Check
general calculation MODE 1 (COMP) standard arithmetic mode
scientific entry coefficient, ×10ˣ, exponent use the dedicated negative-sign key
engineering display calculate, then ENG each press changes exponent by 3
reuse result begin with operator or insert Ans keeps the displayed result
fixed decimals SHIFT MODE, 6, digits changes display rounding
scientific display SHIFT MODE, 7, digits controls displayed significant digits
normal display SHIFT MODE, 8, 2 keeps small values in decimal form longer
solve MODE 1, equation in \(X\), SHIFT CALC may return one of several roots
table MODE 7, enter \(f(X)\), start, end, step use for trend checking
base conversion MODE 4, choose DEC, HEX, BIN, or OCT checks hand conversions

Discipline: Keep the full calculator result through intermediate work. Round once, report units, and include a complete answer sentence.

Official reference: Casio fx-570ES PLUS and fx-991ES PLUS User’s Guide.

R02 Measurement and evidence cycle

Use the same cycle throughout the curriculum:

  1. Predict the direction and approximate magnitude.
  2. Calculate using GUESS.
  3. Draw a proper schematic or block diagram.
  4. Simulate or verify.
  5. Build or test where appropriate.
  6. Compare expected and observed results.
  7. Diagnose a fault or limitation.
  8. Explain and reflect.
Evidence category Successful work shows
mathematical reasoning and GUESS correct relationships, units, precision, and conclusion
schematic quality standard symbols, labels, values, junctions, and readable layout
simulation or verification correct construction, measurements, comparison, and limitations
physical construction safe practice, organized wiring, and pre-power checks
testing and troubleshooting expected readings, evidence-based diagnosis, and verification
design decisions criteria, trade-offs, and justified changes
documentation clear tables, graphs, images, captions, and engineering conclusion

The quick reference contains the compact formulas. The electronics library contains notes, staged slides, assignments, simulations, labs, and restricted teacher materials.

References and source boundaries

Copyrighted textbook material remains in restricted Google Drive. This public handbook contains original explanations and diagrams with links to open or official sources.

CC BY-SA 4.0 · Created by Andrew Andrade · andrewandrade.ca · Source: github.com/mrandrewandrade

Please share, modify and redistribute. If you change this file, do not remove: CC BY-SA 4.0. Original Source: andrewandrade.ca and add your own name + links. Sharing is caring!