Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

← All Learn guides

LEARN · DEEP GUIDE

Electronics Theory

Understand the physical circuits behind the labs

Charge and electric fields

An embedded circuit is a physical system before it is a program. A command can request that a pin switch HIGH, but electrons, fields, materials, and the supply determine what happens next. Start with charge: a property of matter that participates in electrical interactions. Electrons carry negative charge; protons carry positive charge. A body can be electrically neutral overall while containing enormous amounts of both. Neutral does not mean it contains no charged particles.

Charge is conserved. In an ordinary circuit, an LED does not consume electrons as fuel. Charge moves through the circuit while energy changes form. A battery supplies energy through chemical processes and helps maintain a potential difference; it does not continuously create new electrons for each component. Keeping charge and energy distinct prevents the misconception that current gradually disappears as it passes through a sequence of loads.

An electric field describes the electrical force per unit positive test charge at a location. In the relation F=qE\mathbf F=q\mathbf E, qq is charge in coulombs and E\mathbf E is field in newtons per coulomb. A negative charge feels force opposite the field direction. The field is a spatial quantity; current is a rate of charge transport. A circuit can have an electric field and a voltage difference while essentially no steady conduction current crosses an open gap.

In a metal, mobile electrons respond to the field while interacting with the material. Their net drift can be slow even though changes in electrical influence propagate through the circuit much faster. Turning on an LED does not require one particular electron to travel all the way from a battery terminal to the LED first. A full electromagnetic description involves fields in and around conductors; the circuit model condenses that description into voltages and currents when its assumptions are appropriate.

Voltage and reference nodes

Electric potential organizes electrical potential energy per unit charge. Voltage is a potential difference between two points. For a charge moved between them, ΔU=qΔV\Delta U=q\Delta V, where energy is in joules, charge in coulombs, and voltage in volts. One volt is one joule per coulomb. The sign of the energy change depends on charge sign and direction of movement; avoid treating voltage as a packet of energy flowing down a wire.

If a board pin is described as 3.3 V, a reference is implicit: usually that board's ground node. A meter with its black probe on ground and red probe on the pin measures the difference between those points. Move the black probe to a different node and the reading changes. Negative voltage means the red-probe point is below the chosen black-probe reference, not that the meter has discovered a different species of electricity.

Circuit ground is a chosen reference node and often a return connection. It is not necessarily Earth and is not an infinite sink that makes current disappear. Earth ground is a physical connection used in particular protection and reference arrangements. A battery-powered breadboard can have circuit ground without an Earth connection.

Two nonisolated devices exchanging logic signals normally need a defined reference relationship. A signal of 3.3 V relative to one board's ground does not specify its voltage relative to another floating ground. Connect the intended common reference when the interface requires it, and consider where load current returns. Galvanically isolated interfaces are a different design and must preserve their isolation boundary.

Technical reference: electric potential and potential difference.

LED current loopConcept diagram
output pinseries resistorLED anode/cathodeground returnI → same series current

Trace source to resistor to LED to return and back through source; mark voltage across components and current along the branch.

Resistor and LED share series current; energy changes form while charge is conserved.

Diagram labels

output pin · series resistor · LED anode/cathode · ground return

Active-low buttonConcept diagram
supplypull-upD2 inputswitch (shown released)ground

Released switch leaves resistor biasing input toward compatible logic supply; closed switch connects input to return.

Pressed means LOW for this connection; the bias path is not software debouncing.

Diagram labels

supply · pull-up · D2 input · switch · ground

Current and closed paths

Current measures charge crossing a surface per time. For a constant flow, I=Q/tI=Q/t; more generally, I=dQ/dtI=dQ/dt. One ampere is one coulomb per second. A current of 10 mA is 0.010 A. This is a rate, not a count of electrons stored inside a component.

Conventional current points in the direction positive charge would move. In a metal, the electrons' drift is opposite that direction. Standard circuit diagrams use conventional current consistently, so a resistor's current arrow need not be reversed merely because the mobile carriers are electrons. In semiconductors and electrolytes, the carrier picture can be more varied than mobile metal electrons.

For steady conduction, a closed path lets charge circulate through the source and load. Opening a switch interrupts that path. An ideal open circuit carries no current through its open branch. An ideal short connects points with negligible impedance, which can demand very large current if placed across a source. Real sources and wires have resistance and current limits; those real limitations determine the fault current and heating.

In a series path, steady current through every element is equal because charge is not accumulating indefinitely between them. The voltage drops can differ because the energy transfer per unit charge differs. A resistor and LED can carry the same 8 mA while having different voltages across them and dissipating different powers.

Energy and power

Power is energy transfer per time. If charge crosses a component with voltage VV while current is II, electrical power is P=VIP=VI under the chosen sign convention. Volts times amperes gives watts, or joules per second. A 5 V load drawing 0.20 A receives 1.0 W. Over 60 seconds at that constant power it receives 60 J.

With the passive sign convention, current enters the terminal marked positive. Positive VIVI means the element absorbs power; negative power means it delivers power. A source can therefore deliver the energy absorbed by several loads. Energy can become heat, light, mechanical work, chemical energy, or stored field energy. Charge circulates; energy changes form.

A source marked “5 V, 2 A” normally describes a regulated voltage and a current capability under specified conditions. It does not force 2 A into every connected load. A suitable load draws the current required by its characteristics. A short or excessive load can exceed the capability, causing limiting, voltage collapse, heating, or shutdown. Current capability cannot compensate for an incorrect supply voltage.

The board's USB input, regulator, GPIO output, and external motor supply have different current paths and limits. A motor needing hundreds of milliamperes must not be connected directly to a GPIO just because both use a familiar voltage. The pin controls a driver; the driver and supply carry load current.

Resistance and Ohm's law

Resistance relates voltage and current for a resistive element. An ideal linear resistor follows V=IRV=IR, with VV across the resistor, II through it, and RR in ohms. One ohm is one volt per ampere. For a 1000 Ω\Omega resistor with 5 V across it, I=5/1000=0.005I=5/1000=0.005 A, or 5 mA. Units make the scale visible and can expose an error of a thousand.

At a material level, resistivity describes a material's opposition to conduction. For a uniform conductor in an appropriate model, R=ρL/AR=\rho L/A, so a longer wire has more resistance and a larger cross-sectional area has less. Temperature and material conditions can change resistivity. Conductance is the reciprocal G=1/RG=1/R, measured in siemens.

Ohm's law is a constitutive model, not a universal rule that every component has one fixed resistance. An LED has a nonlinear current-voltage curve; a capacitor's current depends on changing voltage; a transistor's behavior depends on control and operating region. Calculating V/IV/I at one operating point does not prove the component remains an ideal resistor at another point.

Substituting V=IRV=IR into P=VIP=VI gives P=I2RP=I^2R and P=V2/RP=V^2/R for an ohmic resistor. The forms answer different design questions. At fixed current, increasing resistance increases dissipation. At fixed voltage, increasing resistance reduces it. There is no contradiction because the quantity held fixed changed.

A 220 Ω\Omega resistor across 5 V would draw approximately 22.7 mA and dissipate about 0.114 W. Its power rating, ambient temperature, and derating guidance matter. A resistor's resistance value alone does not specify how much heat it can tolerate. Tolerance also matters: a nominal 1 kΩ\Omega resistor with 5% tolerance need not measure exactly 1000 Ω\Omega.

Nodes, branches, and conservation

A node is a set of connection points treated as electrically common in the circuit model. A branch joins nodes through one or more elements. Draw nodes by connectivity, not by proximity on a breadboard. Two adjacent sockets can be disconnected, while distant sockets joined by a wire belong to the same node.

Kirchhoff's current law says the algebraic sum of currents entering and leaving a node is zero in the lumped model that accounts for the relevant currents. It follows from charge conservation when indefinite accumulation at that node is excluded or represented through circuit elements. If 12 mA enters a junction and 4 mA leaves one branch, 8 mA must leave the other branch under those assumptions.

Kirchhoff's voltage law says the signed sum of voltage rises and drops around a closed loop is zero in the usual lumped-circuit approximation. It expresses the energy accounting for a charge returning to the same point. With significant externally changing magnetic flux, induced electromotive force requires appropriate treatment; the simple electrostatic-potential argument alone is insufficient. For short-wire low-voltage DC breadboard analysis, the ordinary lumped form is usually the useful starting model.

Choose current arrows and voltage polarities, then keep them consistent. A negative solved current means actual current is opposite the assumed arrow. It does not mean the conservation law failed. Consistent signs turn a circuit drawing into equations rather than a collection of guesses.

Series and parallel circuits

Elements are in series when the same branch current must pass through them without splitting between them. Ideal series resistances add because their voltage drops add: Req=R1+R2+⋯R_{eq}=R_1+R_2+\cdots. With 1 kΩ\Omega and 2 kΩ\Omega in series across 6 V, the current is 2 mA. Their drops are 2 V and 4 V, which account for the 6 V source.

Elements are in parallel when they connect across the same pair of nodes. They have equal voltage while currents divide according to branch characteristics. For ideal resistors, 1/Req=1/R1+1/R2+⋯1/R_{eq}=1/R_1+1/R_2+\cdots. Two equal 1 kΩ\Omega branches have an equivalent resistance of 500 Ω\Omega. Each can carry 5 mA across 5 V, giving 10 mA total.

The total parallel resistance is less than the smallest positive branch resistance because adding a conducting path increases total conductance. That statement assumes ordinary positive resistors. “Current takes the path of least resistance” is an incomplete shortcut: current flows through all conducting branches according to their characteristics. It does not automatically choose one branch and ignore the others.

Two components physically laid out end-to-end are not necessarily series, and two side-by-side components are not necessarily parallel. Trace the nodes. A measurement probe or extra jumper can create a new branch and invalidate a previous assumption of series current.

Sources, loads, and loaded dividers

An ideal voltage source holds its terminal voltage regardless of load current. A real source has regulation limits, internal impedance, and finite available energy. A simple source model is an ideal voltage source in series with resistance. If a 5 V source has 0.5 Ω\Omega series resistance and supplies 1 A, 0.5 V is lost in that series path. The load sees 4.5 V in this simplified steady model.

A voltage divider uses two series resistors. For an unloaded midpoint measured relative to the lower node, Vout=VinR2/(R1+R2)V_{out}=V_{in}R_2/(R_1+R_2), where R2R_2 is the lower resistor. This follows from the common current I=Vin/(R1+R2)I=V_{in}/(R_1+R_2) and Vout=IR2V_{out}=IR_2. Equal values divide a 5 V input to 2.5 V under those assumptions.

Connecting a load from midpoint to ground changes the lower resistance to R2∥RLR_2\parallel R_L. With two 10 kΩ\Omega resistors and a 10 kΩ\Omega load, the lower equivalent is 5 kΩ\Omega, and the output becomes about 1.67 V. The original 2.5 V result no longer applies. A divider is therefore a signal-scaling device, not a general regulated supply for motors or arbitrary modules.

A Thevenin equivalent describes a linear network at two terminals as an ideal voltage source in series with a resistance. For the unloaded 10 kΩ/10 kΩ divider, its equivalent voltage is 2.5 V and its equivalent resistance is 5 kΩ: suppressing the ideal supply source joins the two resistor ends to the same reference, leaving them in parallel from the midpoint. A 10 kΩ load then gives 2.5 × 10/(5 + 10) ≈ 1.67 V. This is another way to predict loading without pretending the midpoint is an ideal source.

High-value divider resistors save steady current but increase source impedance. An ADC often charges a small internal sampling capacitor during acquisition. Excessive source impedance can prevent settling within the allotted time. The correct resistor range depends on the ADC documentation and sample schedule. A DC meter reading alone does not prove dynamic acquisition accuracy.

Make the changed lower branch visibleConcept diagram
VinR1midpoint / VoutR2load (RL)reference

R1 joins Vin to midpoint; R2 and load both join midpoint to reference.

Loaded lower resistance is R2 parallel RL, not the unloaded R2.

Diagram labels

Vin · R1 · midpoint · R2 · load · reference

Breadboards and physical connectivity

A solderless breadboard provides groups of internally connected sockets. In a common layout, short groups of five sockets run on each side of the central channel, and longer rails run along the edges. The channel separates the two sides for integrated circuits. Rail continuity can be interrupted halfway along a board; colored stripes do not guarantee continuous internal metal.

Use a disconnected circuit and continuity mode to establish the actual board's groups. Connectors and jumpers do not become correct because their colors look right. A resistor whose two legs occupy the same node is bypassed electrically. An LED wired directly across supply without the intended series resistance remains unprotected even if the resistor is nearby.

Tactile switches often have pairs of internally common legs. Orientation determines whether a jumper spans the actual switch contacts or merely connects two legs already joined. Map the button with a meter before building a complicated input circuit. This test distinguishes a contact arrangement mistake from a software polarity mistake.

Keep rails and returns legible. A ground rail shared by high-current motor return and delicate sensor return can introduce voltage disturbances; even a continuous rail is not an ideal zero-impedance node at all frequencies. Breadboards are useful for low-current experiments but have contact and parasitic limitations that matter for high current or fast signals.

Diodes and LEDs

A semiconductor diode has a strongly direction-dependent current-voltage behavior. At a conceptual level, a PN junction's carrier distribution and barrier change under applied bias. Forward bias permits appreciable current; reverse bias ordinarily produces much less until limits or breakdown mechanisms become important. An LED emits light through semiconductor carrier recombination while operating in forward conduction.

An LED's forward voltage depends on its material, current, and temperature. It is not a universal 2 V constant. A useful preliminary model takes a forward drop from the relevant specification and uses a series resistor to set a conservative current. With a 5 V source, assumed 2 V LED drop, and target 8 mA, R=(5−2)/0.008=375 ΩR=(5-2)/0.008=375\ \Omega. Choosing a standard 390 Ω\Omega value gives approximately 7.7 mA under that model.

The resistor dissipates approximately (3 V)2/390 Ω=0.023(3\text{ V})^2/390\ \Omega=0.023 W. Real supply tolerance, LED curve, output voltage drop, and resistor tolerance change the result. That calculation is a design estimate with assumptions, not a measured guarantee. Select a safe current supported by the device and driving circuit; brightness is not an excuse to exceed a pin's limits.

An LED on a GPIO can be wired so HIGH sources current through it or so LOW sinks current through it. Active-high and active-low LED behavior depend on connection. Reverse voltage limits also matter; reversing an LED is not a general-purpose way to make a safe open circuit. A protective diode serving an inductive load has a different role from an indicator LED.

Knob to ADC to PWMConcept diagram
  1. 5 V/GNDbounds →
  2. pot wiper A0sample →
  3. ADC codescale →
  4. mappingselect →
  5. D9 duty cyclecurrent-limited branch →
  6. LED
HIGHLOWaverage for a suitable loadtime →

PWM changes time spent HIGH, while pulse levels stay fixed. The pin is switching; it is not a DAC output.

Wiper voltage is sampled/quantized to a code; integer mapping selects PWM duty; pulses drive a current-limited LED branch.

ADC code is not volts; PWM pin is pulsed rather than a continuously variable voltage.

Diagram labels

5 V/GND · pot wiper A0 · ADC code · mapping · D9 duty cycle · LED

Buttons, floating inputs, and pull resistors

A digital input interprets a voltage using thresholds. Because it normally draws little current, an unconnected input does not establish its own dependable level. Coupled fields, leakage, capacitance, or a person's hand can move its voltage. “Nothing connected” is not the same as “zero volts.”

A pull-up connects the input weakly toward its positive logic supply; a pull-down connects it weakly toward ground. A switch provides a much lower-impedance path when closed. With a 10 kΩ\Omega pull-up to 5 V and a switch to ground, released means approximately 5 V and pressed means approximately 0 V. When pressed, about 0.5 mA flows through the resistor and switch in the ideal calculation.

This is active-low logic: the physically asserted condition maps to a LOW electrical level. It is neither wrong nor unusual. In code, turn it into pressed = (digitalRead(pin) == LOW) before applying higher-level decisions. The pull resistor sets a default state; debouncing addresses transient switching. They solve different problems.

The resistor must be strong enough relative to leakage and noise while not drawing excessive current when opposed by the switch. Internal pull-up values are typically ranges and depend on the device. A pull-up tied to 5 V can overvoltage a 3.3 V input. Its weak current does not automatically make an incompatible voltage acceptable.

Potentiometers and analog signals

A potentiometer has a resistive track with two ends and a movable wiper. Connecting the ends to a permitted reference supply and ground makes the wiper an adjustable divider output. Rotation changes the resistances above and below it. Ideally, the wiper voltage moves between the endpoint voltages while the total track resistance stays approximately fixed.

A three-terminal divider connection differs from a two-terminal variable resistor connection. For an ADC input, the divider model is usually the relevant one. The ADC's allowed input range still applies; connecting the track to a motor supply can destroy an input even if the wiper is currently turned down.

An analog signal varies over a continuous range in the model. A digital system samples and represents it with finite values. Electrical noise, contact irregularity, supply variation, and ADC conversion behavior mean a stationary potentiometer can produce several nearby codes. A software deadband or averaging policy should address a defined observation problem, rather than assuming every change is a real physical movement.

Capacitors and RC behavior

A capacitor stores energy in an electric field associated with separated charge. For an ideal linear capacitor, Q=CVQ=CV, where capacitance CC is measured in farads. Its current-voltage relation is I=C dV/dtI=C\,dV/dt with consistent polarity. A changing voltage requires charge to move; a larger capacitance requires more charge for the same voltage change.

The ideal relation implies that instantaneous voltage change would require an unbounded current impulse. Real sources and components limit the current, so voltage evolves over time. A capacitor is not literally a device that “blocks all current”: during charging and discharging, branch current flows. At steady DC an ideal capacitor's voltage stops changing and its current is zero, while real devices can have leakage.

For an ideal resistor charging a capacitor from a voltage step, the time constant is τ=RC\tau=RC. Ohms times farads gives seconds. With 10 kΩ\Omega and 10 μ\muF, τ=0.10\tau=0.10 s. After one time constant, the voltage has covered about 63% of the change toward its final value; after several time constants it is much closer. It does not abruptly finish at one time constant.

Stored energy is E=12CV2E=\tfrac12 CV^2. That energy remains available after the source is disconnected. Voltage rating, polarity for polarized types, equivalent series resistance, and leakage affect real use. A reversed electrolytic or overvoltage capacitor does not become safe because the circuit is powered through USB.

Decoupling places suitable capacitance near a device's supply connections to supply brief current changes through a short local path. It reduces disturbances associated with distribution impedance. A large capacitor far away and a smaller capacitor close to a chip can have different high-frequency effectiveness because leads and traces add inductance. Capacitors help a properly designed supply network; they do not repair an undersized supply under sustained overload.

Inductors and flyback

An inductor stores magnetic field energy. With a consistent passive polarity, V=L dI/dtV=L\,dI/dt, where inductance is measured in henries. Changing current requires a voltage. The stored energy is E=12LI2E=\tfrac12 LI^2. An ideal inductor's current cannot jump instantaneously under finite voltage, just as an ideal capacitor's voltage cannot jump instantaneously under finite current.

A relay coil or motor winding is inductive. When its switch opens, the existing current still needs a path while the stored magnetic energy is released. If no controlled path exists, voltage can rise until some unintended path conducts, potentially damaging the switching transistor. The problem is the energy and current transition, not simply “the motor contains a mysterious reverse battery.”

For a DC coil controlled by a low-side switch, a common flyback diode is placed across the coil so it is reverse-biased during normal energizing and conducts the circulating coil current after turn-off. Its polarity, current capability, voltage rating, and energy handling matter. A plain diode can slow current decay and therefore relay release. Faster clamps and motor-driver recirculation arrangements serve other requirements.

Do not indiscriminately place a diode across a bidirectional motor driven by an H-bridge as though it were a single-polarity coil. The driver has switching and recirculation paths that must support both current directions. Follow the driver's documented topology.

Transistors and MOSFET drivers

A transistor lets a control signal influence a larger current or voltage behavior. A BJT uses base drive with junction behavior; a MOSFET uses gate-to-source voltage to control a channel. Both can be used for switching or amplification, but their biasing, limits, and useful operating models differ. A GPIO is a control source, not a universal power switch for every load.

In a common NPN low-side BJT switch, the load connects to the collector and the emitter to return. The base-emitter junction needs controlled current, usually through a resistor from the control output. In the active region, collector current relates to base current through a gain that varies with device and conditions. Switching designs instead provide adequate base drive for the intended saturated on-state using the device documentation; a headline typical gain is not a guaranteed switch design rule. A first base-current estimate is (Vdrive − VBE) / Rbase, with the output voltage and junction drop treated as operating-point assumptions. The GPIO must be able to provide that current within its own limits. A larger load may require a different transistor or driver rather than an arbitrarily smaller base resistor.

In a common N-channel low-side MOSFET arrangement, the load connects from positive supply to drain, source connects to the return, and the gate receives the control signal relative to source. Turning it on lets load current return through the channel. The load supply can differ from the controller supply, provided the control/reference and ratings are designed correctly.

Gate threshold voltage indicates the onset of a specified small conduction condition. It is not the voltage at which the transistor is guaranteed to have a low on-resistance for a large load. A logic-level device needs an on-resistance specification at the actual available gate voltage, such as 3.3 V or 5 V where documented. Selecting by threshold alone can produce a hot transistor that only partly turns on.

The gate behaves capacitively, so switching requires charging and discharging gate charge. Static gate current is small, but fast transitions can demand substantial transient drive. A gate resistor can control ringing and current peaks; a pull-down can keep the gate in a defined off state while the MCU resets. Component values must fit switching speed and noise requirements, not be copied blindly.

In an on-state approximation, conduction loss is P≈I2RDS(on)P\approx I^2R_{DS(on)}. A 1 A current through 0.1 Ω\Omega yields about 0.1 W, whereas 3 A yields about 0.9 W. On-resistance varies with temperature and gate drive; switching losses also matter. Thermal path and safe operating conditions must be checked. A transistor's maximum current headline is not a promise that a small breadboard package can carry it indefinitely.

Trace on-current and turn-off recirculationConcept diagram
Switch ON

positive supply → DC coil → drain → source/return

The gate is driven relative to source/return. The flyback diode is reverse-biased.

Switch OFF · recirculation

drain → flyback diode → positive supply → DC coil → drain

Diode anode at drain; cathode at positive supply. Stored coil energy drives this temporary loop.

On path is supply to coil to drain/source to return; diode is reverse-biased on and provides a loop when the switch opens.

Diode polarity and gate-source reference must be explicit; this is a unidirectional low-side coil topology.

Diagram labels

positive supply · DC coil · drain · source/return · gate · flyback diode

Relays, motors, and H-bridges

A relay uses an energized coil to move contacts. The coil circuit and switched contact circuit are different electrical paths. Mechanical contact separation can provide galvanic isolation when the complete design and ratings preserve it, but a relay module may share controller references in its input circuitry. A marketing label or optocoupler on a board does not establish isolation of every connection.

Contacts have ratings for voltage, current, load type, and switching conditions. A DC inductive load can be harder to interrupt than a similar steady resistive load. The coil needs appropriate drive and flyback handling. Low-voltage education here does not provide a mains-wiring procedure.

A DC motor converts electrical input into mechanical motion through electromagnetic interaction. Rotating motion produces back electromotive force that opposes the applied voltage. Near startup or stall, rotational back EMF is small, so winding resistance and the drive circuit can permit much more current than during ordinary free running. Design the driver and supply around relevant startup/stall behavior, not just the pleasant unloaded current.

An H-bridge uses switching paths that can apply either polarity across a motor. It permits direction changes and, depending on the driver, braking and recirculation behavior. Switching both devices in one leg on simultaneously can short the supply through the bridge. Integrated drivers commonly provide controlled timing and protection, but their current, thermal, and supply requirements still need verification.

Motor PWM usually changes switching duty while the electrical and mechanical system smooths some of the resulting behavior. Torque, speed, and supply current are not necessarily linear functions of duty. Winding inductance, load torque, friction, back EMF, driver losses, and current regulation all matter. A PWM number in code is a request to a physical system, not a calibrated speed unit.

Digital thresholds and level shifting

Digital HIGH and LOW are voltage ranges interpreted by a receiver. A datasheet typically distinguishes guaranteed low input, guaranteed high input, and an intermediate region that should not be relied on. Output-high and output-low voltages also depend on loading. A nominal 3.3 V label alone does not prove every 3.3 V output meets every 5 V receiver's required high threshold.

Input tolerance and logic recognition are separate questions. A 5 V output may be recognized as HIGH by a 3.3 V receiver but still exceed its maximum allowed input voltage and damage it. Conversely, a 3.3 V output may be electrically safe for a 5 V input but fail its guaranteed high requirement. Verify both conditions.

A level shifter adapts signaling between voltage domains. Its topology must suit the signal direction, speed, drive style, and interface. An open-drain I2C translator is not automatically appropriate for a fast push-pull SPI clock. A passive resistor divider can scale one unidirectional signal under defined impedance and timing conditions but does not solve every bidirectional interface.

Absolute maximum ratings indicate stress limits; recommended operating conditions indicate intended use. Running a pin at an absolute maximum current is not a sensible ordinary design target. Aggregate port and package limits can constrain several pins even when each individual load looks modest.

ADC sampling and quantization

An ADC samples an input and maps it to a discrete code. An ideal NN-bit converter has 2N2^N codes. A 10-bit result runs from 0 through 1023. A nominal quantization interval is approximately the input full-scale range divided by 1024, while formulas using 1023 commonly map endpoint codes to displayed endpoint voltages. These are related conventions, not interchangeable physical guarantees about an exact converter's transition points.

Resolution describes code granularity. Accuracy concerns closeness to the true input; precision or repeatability concerns the spread of repeated results. More bits do not automatically remove offset, gain error, nonlinearity, reference error, or noise. If the assumed 5 V reference is actually 4.8 V, a calculation using 5.0 V adds systematic scale error.

Sampling rate controls when measurements occur. Rapid input changes can be missed or aliased when sampling is inadequate. Low-pass filtering before conversion can limit out-of-band content; averaging after conversion cannot reconstruct frequencies already aliased into the samples. For a slowly turned potentiometer, settling and noise may dominate; for a waveform measurement, sample timing and bandwidth become central.

On a multiplexed ADC, changing channels can require settling. High source impedance and the prior channel's voltage can affect the first conversion. Read the target's acquisition guidance instead of assuming every Arduino-like analogRead has identical electrical behavior. Never exceed the permitted pin range while experimenting with code resolution settings.

Distinguish code resolution from accuracyConcept diagram
input voltage / reference range →code intervalsat each sample time

A staircase maps allowed voltage intervals to codes at specified sample times.

Show finite quantization, and annotate that offset/reference/noise are separate errors.

Diagram labels

input voltage · code intervals · reference range · sample time

PWM and delivered power

Pulse-width modulation switches between levels with a repeated period. Duty cycle D=ton/TD=t_{on}/T is the fraction spent on, and frequency f=1/Tf=1/T is cycles per second. A 1 kHz waveform has a 1 ms period. At 25% duty it is on for 0.25 ms per cycle and off for 0.75 ms.

The arithmetic average of an ideal 0-to-5 V waveform is 1.25 V at that duty. The actual pin is nevertheless switching between its output levels. A suitable low-pass filter can produce a smoother average voltage, with ripple and load dependence. Without that filter, an ADC or oscilloscope can observe pulses rather than a continuous 1.25 V source.

For a fixed resistor switched across 5 V, the on-state power is 25/R25/R. Average power at duty DD is approximately D 25/RD\,25/R, assuming negligible switching effects. Squaring the average voltage would incorrectly predict D2 25/RD^2\,25/R. Heating depends on the average of squared voltage, not the square of average voltage. That distinction explains why an average-voltage analogy has limits.

An LED's average light output approximately follows average current under suitable conditions, and human vision integrates sufficiently rapid flashing while responding nonlinearly to brightness. A perceived half-bright level therefore need not correspond to half the PWM number. The LED still needs current limiting during on pulses; duty reduction does not license arbitrary peak current.

Timer hardware produces PWM without the CPU manually executing every edge. Shared timers can couple PWM pins or interact with timing libraries. Frequency and resolution tradeoffs depend on the peripheral and framework. Use the board documentation before changing timer configuration, especially when millis, servos, or other libraries rely on it.

Measuring a circuit

A multimeter measures through a physical connection that becomes part of the circuit. In voltage mode it presents relatively high input impedance and connects across the two nodes of interest. In current mode it routes current through an internal shunt and must be inserted in series with the intended branch. Placing a current-mode meter directly across a supply can create a low-resistance short, blow a fuse, or damage equipment.

Resistance and continuity modes inject a test stimulus. Disconnect power and consider capacitors and parallel paths before using them. Measuring a resistor still connected among other components can report the network's effective path rather than the resistor alone. Continuity indicates a path under the meter's threshold conditions, not guaranteed low impedance at every relevant frequency or current.

Not every meter has every measurement mode. The Fluke 101 named in the source notes, for example, is not a general current-measurement substitute merely because it is a multimeter; verify the actual model's inputs and functions. Learn the correct connection from the instrument manual, not from a generic photograph.

Start diagnosis by stating a predicted measurement. For a pull-up button, measure input-to-ground voltage released and pressed. If both read near ground, examine wiring and switch orientation before rewriting the edge-detection code. For an LED, verify supply, resistor voltage, and polarity. A voltage across the resistor estimates branch current with I=V/RI=V/R without breaking that branch for an ammeter.

Instrument resolution, range, loading, calibration, and bandwidth limit conclusions. A handheld meter may display an averaged quantity on PWM rather than pulse amplitude. A stable number can conceal a transient brownout. Select the instrument and measurement method to answer the actual question.

An oscilloscope displays voltage versus time, making pulse width, ringing, and brief supply dips visible. A trigger aligns repeated events so the waveform can be inspected rather than sliding past randomly. Probe bandwidth and sample rate constrain what can be observed. The probe reference is a physical electrical connection: an ordinary grounded bench scope can connect its ground clip to protective earth. Do not attach that clip to an arbitrary circuit node and assume it is an isolated meter lead. The instrument and circuit must support the intended connection.

Supplies, noise, and practical limits

Regulation attempts to keep voltage within bounds as load and input change. A linear regulator dissipates roughly (Vin−Vout)I(V_{in}-V_{out})I under a simple steady model. Supplying 5 V at 0.2 A from 12 V requires about 1.4 W dissipation in that conversion path before other details. A physically small regulator can become hot even though the output current sounds modest.

Brownout is supply voltage falling below an operating threshold. A motor start or radio current burst can cause reset if the source, cable, connector, or regulator cannot sustain the demand. A board that repeatedly restarts may be running correct logic on inadequate power. Log reset reasons where supported and measure the supply at the board, not only at the unloaded adapter.

USB ports and cables have negotiation, current, and voltage-drop constraints. A charge-only cable can power a board while providing no data connection. A cable carrying high current can lose significant voltage along its resistance. Do not assume a laptop USB port, board regulator, and external supply are freely interchangeable or can be tied together without considering backfeeding and the board's power-selection design.

Noise becomes meaningful relative to a signal and a receiver's margin. Long wires couple disturbances, switching loads generate rapid current changes, and shared return impedance can move local reference voltages. Short return paths, appropriate decoupling, separation of noisy load currents from sensor paths, and suitable interface wiring improve the physical conditions the software sees.

A circuit model should be as simple as the question permits but as detailed as the failure requires. Ideal wires may suffice for a steady LED calculation. Their resistance and inductance matter when a motor resets the controller. A divider's static formula may suffice for a meter; acquisition impedance matters for an ADC. Strong circuit literacy means recognizing when an assumption stopped matching the observation.

Equation and unit reference

RelationMeaning and condition
I=dQ/dtI=dQ/dtCharge transfer rate, amperes
ΔU=qΔV\Delta U=q\Delta VPotential-energy change, joules
V=IRV=IRIdeal linear resistor relation, volts/amps/ohms
P=VIP=VIElectrical power with consistent polarity
P=I2R=V2/RP=I^2R=V^2/RResistor dissipation under the ohmic model
Rs=∑RiR_s=\sum R_iSeries resistors with the same current
1/Rp=∑1/Ri1/R_p=\sum 1/R_iParallel resistors across the same nodes
Vo=ViR2/(R1+R2)V_o=V_iR_2/(R_1+R_2)Unloaded divider
I=C dV/dtI=C\,dV/dt, τ=RC\tau=RCIdeal capacitor and first-order RC timing
V=L dI/dtV=L\,dI/dtIdeal inductor relation
D=ton/TD=t_{on}/T, f=1/Tf=1/TDuty fraction and repetition frequency

Symbols alone do not identify a valid model. Each calculation needs defined nodes, a current path, component behavior, and operating conditions. The glossary supplies quick reminders; the explanations above supply the assumptions needed to use them.