Basic Electricity and Magnetism for Motors and Sensors
Robots and spacecraft run on electricity: batteries feed motors, and sensors turn the physical world into voltages. This topic covers charge, Coulomb's law, electric fields and potential, current, Ohm's law and power, resistor networks and voltage dividers, capacitors and RC time constants, magnetic forces on currents, induction (Faraday's law), and how these become DC motors (τ = K i, back-EMF = K ω) and sensors (Hall effect, strain-gauge bridges, magnetometers). In the research exercise you model a robot-joint DC motor's electrical and mechanical dynamics and show that maximum power comes at half the no-load speed, with only 50% efficiency.
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.
Pushing charges around
Electric charge comes in two kinds, positive and negative; opposites attract. A battery pushes charges around a loop of wire: the push is the voltage (volts), the flow is the current (amperes), and anything that resists the flow has resistance (ohms). Moving charges also make magnetism. Put a current-carrying wire in a magnet’s field and it gets pushed sideways. That push is what spins every electric motor.
Inside a robot's DC motor: torque, speed, power and efficiency
speed 192 rad/s (1833 rpm) · current 2.00 A · mechanical power 19.2 W of 24.0 W drawn · efficiency 80% · max power 30.0 W at 120 rad/s
Current makes torque (τ = K i), and spinning makes a back-voltage (K ω) that opposes the supply. At stall there is no back-EMF, so the current is huge and the motor just heats up. With no load it spins until back-EMF almost equals the supply. Halfway between, it delivers the most power but wastes half as heat; robots run motors well above that speed (through gearboxes) for efficiency. A Hall-effect sensor or encoder measures the speed for control.
Why engineers care
Every robot joint, drone propeller and rover wheel is driven by an electric motor. Every IMU, magnetometer, encoder and force sensor turns physics into a voltage. Sizing batteries and wires, protecting electronics from current spikes, and choosing motors and gearboxes all need these basics. Spacecraft also use magnetic torquers that push against Earth’s magnetic field.
📝 Quick check (Level 0)
0/3 answered
1. Current is measured in…
2. A current-carrying wire in a magnetic field feels…
3. Opposite charges…
Level 1: Beginner
★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.
Charges, fields and potential
Coulomb’s law:F=kq1q2/r2, with k≈8.99×109 N·m²/C². Two 1 µC charges 10 cm apart push with 0.90 N.
The electric field is force per unit charge, E=F/q. The potential (voltage) is energy per unit charge, so 1 V = 1 J/C.
Circuits
Ohm’s law:V=IR. Power:P=VI=I2R=V2/R.
Resistors in series add: R=R1+R2. In parallel, 1/R=1/R1+1/R2.
A voltage divider gives Vout=VinR2/(R1+R2). That’s how many sensors’ resistance changes become voltages.
📝 Quick check (Level 1)
0/3 answered
1. Current through 4 Ω across 12 V:
2. 6 Ω in parallel with 3 Ω:
3. Power drawn at 12 V and 3 A:
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 35 minUndergraduate students and practising engineers.
Capacitors and time constants
A capacitor stores charge: Q=CV. Charging through a resistor follows v(t)=V(1−e−t/RC), reaching 63% after one time constant τ = RC and essentially full after 5τ. RC circuits filter sensor noise (a10-5) and set timing.
Magnetism and induction
Force on a current:F=IL×B; for a perpendicular wire, F = BIL. Lorentz force:F=q(E+v×B).
Faraday’s law: a changing magnetic flux induces a voltage, E=−dΦ/dt. This drives generators, transformers and a motor’s back-EMF.
The DC motor
A brushed DC motor has torque τ=Ki and back-EMF e=Kω (the same K in SI units). Its equations are
Ldtdi=V−Ri−Kω,Jdtdω=Ki−bω−τload.
Stall torque is KV/R and no-load speed is V/K. Torque falls linearly with speed between the two.
The electrical time constant is L/R and the mechanical one is JR/K2. The current responds first; the speed follows.
Sensors
Strain gauges change resistance in proportion to strain (gauge factor ≈ 2). A Wheatstone bridge turns that into a few millivolts.
Hall sensors measure magnetic field, used in encoders, current sensing and compasses. Magnetometers measure Earth’s field for heading and for spacecraft attitude.
🐍 Exercise 1: circuits and sensors
Implement series and parallel resistance, a voltage divider, RC charging (formula and simulation), a quarter Wheatstone bridge for a strain gauge, and Coulomb's law. Check the 63% time-constant rule and the bridge's millivolt output.
📝 Quick check (Level 2)
0/3 answered
1. RC time constant of 1 kΩ and 10 µF:
2. A DC motor's back-EMF is proportional to…
3. At stall, a DC motor's current is…
Level 3: Advanced
★★★★☆ Advanced⏱ 35 minGraduate level, with full derivations and proofs.
Steady-state motor speed
Set the derivatives to zero: V=Ri+Kω and Ki=bω+τ. Eliminating i gives ω=(KV−Rτ)/(K2+Rb). ∎ With b = 0 this is the linear torque–speed line.
Maximum power
With τ=K(V−Kω)/R, the power is P=τω=(K/R)(Vω−Kω2). It peaks where V=2Kω, at half the no-load speed, with Pmax=V2/(4R). There, Pelec=VI=V2/(2R), so efficiency is 50%. ∎
RC charging
Cv˙=(V−v)/R has solution v=V(1−e−t/RC): separable, first order (a9-1). ∎
📝 Quick check (Level 3)
0/3 answered
1. Where does an ideal DC motor deliver maximum mechanical power?
2. Efficiency at maximum power:
3. The mechanical time constant of a DC motor is…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.
A robot-joint motor, simulated
The motor has R = 1.2 Ω, L = 0.5 mH, K = 0.05 N·m/A and J = 2 × 10⁻⁵ kg·m². At 12 V:
Spin-up: it settles at 239 rad/s (2281 rpm). Current spikes to 9.0 A (near the stall value V/R = 10 A) and falls to 0.05 A at speed.
Time constants: τ_e = 0.42 ms is much shorter than τ_m = 9.6 ms. The simulated speed reaches 63% at 9.6 ms.
Torque and power: stall torque is 0.50 N·m. Maximum mechanical power is 30.0 W at 120 rad/s, where efficiency is 50%. A 0.2 N·m load slows the motor to the speed predicted by the torque–speed line.
Real robot designs gear down a fast, efficient motor to get torque at the joint, limit inrush current electronically, and model winding heating, which limits continuous torque far below stall (Hughes and Drury, 2019).
🐍 Exercise 2 (research): DC motor dynamics
Simulate a DC motor's coupled electrical and mechanical equations. Check the steady speed, the two time constants and the inrush current, then map the torque–speed, power and efficiency curves and verify maximum power at half the no-load speed.
Electromagnetism in AI, robotics and aerospace
Actuation: brushed, brushless (BLDC) and stepper motors; field-oriented control; current loops at tens of kHz inside every servo.
Sensing: encoders, Hall sensors, strain-gauge force/torque sensors, magnetometers; noise and filtering (a10-5).
Spacecraft: magnetorquers for momentum dumping (a13-7), solar-array power, and harnesses designed to minimize magnetic disturbance.
Energy: battery internal resistance and I²R losses set drone endurance and peak power.
References
D. Halliday, R. Resnick, J. Walker (2018). Fundamentals of Physics, 11th ed. Wiley.
A. Hughes, B. Drury (2019). Electric Motors and Drives, 5th ed. Newnes.
P. Horowitz, W. Hill (2015). The Art of Electronics, 3rd ed. Cambridge.
J. Fraden (2016). Handbook of Modern Sensors, 5th ed. Springer.
An RC circuit driven by a step V charges as V(1 − e^(−t/RC)).
Practice
Show:
Level 0
Problem 1Level 0
SI unit of current?
The ampere.
Problem 2Level 0
Ohm’s law: V = I × ____.
Resistance.
Problem 3Level 0
A motor converts electrical energy into ____ energy.
Mechanical.
Level 1
Problem 4Level 1
Current (A) through 4 Ω across 12 V?
3 A.
Problem 5Level 1
6 Ω in parallel with 3 Ω (Ω)?
2 Ω.
Problem 6Level 1
Power (W) at 12 V and 3 A?
36 W.
Problem 7Level 1
RC time constant (ms) of 1 kΩ and 10 µF?
10 ms.
Level 2
Problem 8Level 2
Divider output (V): 12 V across 10 kΩ (top) and 5 kΩ (bottom)?
12⋅5/15=4.
Problem 9Level 2
Force (N) on 0.1 m of wire carrying 2 A across a 0.5 T field?
BIL = 0.1 N.
Problem 10Level 2
No-load speed (rad/s) of an ideal motor with K = 0.05 at 12 V?
V/K = 240.
Problem 11Level 2
Stall torque (N·m) with K = 0.05, R = 1.2 Ω, V = 12 V?
KV/R = 0.5.
Problem 12Level 2
Force (N) between two 1 µC charges 10 cm apart?
≈ 0.899 N.
Problem 13Level 2
Output (mV) of a 5 V quarter bridge with a gauge factor 2 gauge at 500 µε (≈ V·GF·ε/4)?
5⋅2⋅5×10−4/4=1.25 mV.
Level 3
Problem 14Level 3
Derive a DC motor’s steady-state speed under load.
V = Ri + Kω and Ki = bω + τ give ω = (KV − Rτ)/(K² + Rb). ∎
Problem 15Level 3
Show that maximum power occurs at half the no-load speed.
P = (K/R)(Vω − Kω²) peaks at ω = V/(2K). ∎
Problem 16Level 3
Solve the RC charging equation.
Separate variables in C v̇ = (V − v)/R to get v = V(1 − e^(−t/RC)). ∎
Problem 17Level 3
Mechanical time constant (ms) for J = 2 × 10⁻⁵ kg·m², R = 1.2 Ω, K = 0.05?
JR/K2=9.6 ms.
Level 4
Problem 18Level 4
Maximum mechanical power (W) of the exercise-2 motor at 12 V?
V2/4R=30 W.
Problem 19Level 4
Efficiency (%) at that operating point?
50%.
Problem 20Level 4
Electrical time constant L/R (ms) for L = 0.5 mH, R = 1.2 Ω?
≈ 0.42 ms.
Coding practice
🐍 Code 1 (Level 1): Ohm's law
I = V/R.
🐍 Code 2 (Level 1): parallel resistors
1/R = Σ 1/Rᵢ.
🐍 Code 3 (Level 2): RC charging
V(1 − e^(−t/RC)).
🐍 Code 4 (Level 2): force on a wire
F = BIL.
🐍 Code 5 (Level 2): motor limits
No-load speed V/K and stall torque KV/R.
Topic test
A timed test drawn at random from this topic's question bank. Each attempt gets new questions. For a longer test across the whole chapter, see the chapter test, or mix topics in the question bag.
Basic Electricity and Magnetism for Motors and Sensors: topic test
10 questions, drawn at random from a bank of 16. Every attempt is different.
⏱ Time limit: 15 minutes. The test submits itself when time runs out.
Levels covered: 0, 1, 2, 3, 4. No hints or solutions until you submit.