Unit 01 · Phase 1 · Electrical foundations
Systems, units and notebook
Mission: Make this rover stop before the box, without you pressing stop.
The interactive version of this unit needs JavaScript. Below are its steps as text.
Steps
1. Watch the problem
Choose a prediction (or skip it), then press Drive. Nothing has been added to the rover yet.
Why it matters: The wheels kept turning because nothing on the rover could notice the box. Pressing Drive only started the motor, and nothing ever changed that.
2. Give it a way to notice
An “eye” is now on the rover’s front. Press Drive and watch its number in the dark bar under the drawing.
Why it matters: The eye reports how far away the box is, always with a unit, like “85 cm”. A part that produces a reading about the world is a sensor. A reading is only information: nothing used it, so the rover still hit the box.
3. Give it a rule
An orange stop line is on the floor, 20 cm from the box. The rule is: if the reading is at or below the line, stop; otherwise keep going. Press Drive. Each further press moves the line (40 cm, then 10 cm) and drives again.
Why it matters: On every check the rover compares its reading with the line and chooses a command: GO or STOP. A part that compares a reading with a target and chooses a command is a controller. So far the model pretends the command reaches the wheels by itself. Step 4 asks how it really gets there.
4. Find the motor’s energy
The rover’s cover is open: a battery, a small driver board and a motor are inside. The first press wires the motor straight to the controller’s command output. Press Drive, then press again to power the motor from the battery through the driver.
Why it matters: A controller’s output carries information: a small signal saying GO or STOP, far too weak to spin a motor. A driver sits in between: the small command tells it when to let energy from the battery flow to the motor, which turns the wheels. That is two jobs on two paths: information (blue) and power (red). Never wire a motor directly to a controller output.
5. Run the loop yourself
Press Run one check. Each press does one round: read, compare, command, move. Here the rover checks every 0.5 s, so it moves 10 cm between checks. Keep pressing until it stops, at your own pace.
Why it matters: Moving changes the distance. So the next reading changes, and the next decision can change too. What the rover did comes back as its next input: that is feedback. The chain becomes a loop: sensor → controller → driver → motor → changed distance → sensor.
6. Draw a boundary
The rover is parked on the 20 cm line and the floor ahead is slippery. Press Show boundary to outline the rover only. Press again to outline the rover, floor and box together.
Why it matters: A system boundary is a line you choose around what your model includes. With the rover alone inside, the floor and box are outside influences. Include the floor and you must also describe its grip; the physical world stays the same. The boundary helps you say which interactions are inside the model and which arrive from outside.
7. Same distance, different numbers
The rover is parked on the 20 cm line. Press Show in m. Each further press writes the same gap in another unit (mm, then cm). Watch the number and the rover.
Why it matters: A unit says what kind of quantity a number measures and the size of one step. The metre (m) and the second (s) are SI units; a centimetre is one hundredth of a metre. Converting changes the number you write, never the distance: 0.2 m × 100 cm per m = 20 cm. A bare “20” can’t be checked or compared.
8. How often does it check?
First read the empty graph: horizontal is time in seconds (s), vertical is distance to the box in centimetres (cm). Each dot will be one reading. Press Drive and record (checks every 0.25 s). Further presses try every 1 s, every 2 s, then 0.25 s with a sensor that reads 30 cm too far.
Why it matters: Each dot is one reading taken at one moment. Between dots the rover kept moving, but the controller only knew the last, older reading. Checking a changing quantity at intervals is sampling; how often you check is the sample rate. Check too rarely and the world can change more than your rule expects.
9. Park it: one fixed distance
While driving, the distance really changed. Now the rover is parked and the gap is fixed. Press Show next reading to step through a worked example, one line at a time. These numbers are SIMULATED and are never copied into your notebook.
Why it matters: In Step 8 you sampled while the rover moved, so the readings changed mostly because the distance changed. Here you take a repeated measurement of one gap that does not change, so any spread comes from the measuring itself. What differs is the question: “how does it change over time?” versus “how consistent is my measuring?”
10. Set up your real measurement
At your desk, pick two fixed marks that won’t move (a desk edge and a small piece of tape). Use any ruler you already have and note its smallest marked step. Open the Notebook tab below and fill in endpoints, instrument, resolution and prediction. Then press Show my setup.
Why it matters: A fixed reference point and a stated resolution make your method repeatable. Then whatever spread remains comes from things you can name: placement, viewing angle, rounding.
11. Take five real readings
In the Notebook tab, choose your reading unit first. Place the ruler, read it and type Trial 1. Lift the ruler away completely, place it again, then read Trial 2; repeat to Trial 5. Type only what you actually read. Then press Plot my readings.
Why it matters: The mean is the centre of your five values. The range is largest minus smallest: the spread you actually saw. Both carry the readings’ unit.
12. What five numbers can’t tell you
Press Show the full picture to see the whole system named. Press again to slide every reading by the same 2 mm offset and watch the range. Then write your explanation in the Notebook tab, in your own words.
Why it matters: A small range means consistent, not correct. A shared offset moves every reading by the same amount, so neither the range nor more repeats can reveal it, just like the biased sensor in Step 8. A range of 0 is a valid result: your readings matched at this ruler’s resolution; it does not mean zero uncertainty. Recap name: the motor is an actuator, a part that turns energy into physical action.
Go deeper
The idea in one line
A robot connects sensing, decision and action in a physical environment. A system boundary says what belongs inside your design and what influences it from outside. Measurements carry units and uncertainty.
Units, conversion and graph axes
20 cm = 20 × 0.01 m = 0.2 m = 200 mm speed = 20 cm/s → in 0.25 s the rover moves 20 cm/s × 0.25 s = 5 cm mean = (r1 + r2 + r3 + r4 + r5) ÷ 5 range = largest − smallest
An axis always says its quantity and unit. The sampling graph starts at 0 cm and 0 s; the trial graph may zoom its vertical axis to show a small spread, and says so when it does.
Sampling a fast-changing signal (aliasing)
Sample an ideal 1 Hz signal, sin(2πt), at 1 sample per second and every dot lands at the same value: the wave disappears. At or below two samples per cycle, samples can hide a wave or suggest a slower one. This is aliasing, and it returns in Units 03 and 04. Sample rate alone is not a complete measurement design.
samples: t = 0, 1/rate, 2/rate, … y = sin(2π × 1 Hz × t) rate = 1 sample/s → y = 0, 0, 0, … (the wave is hidden)
What the controller really knows (state estimate)
The controller never sees the true distance. It sees readings and forms a best current guess, a state estimate. A biased or stale reading makes a sensible rule act on a wrong estimate, as Step 8’s what-if showed.
Inside the chassis: signal pins and supply rails
On real boards the controller’s outputs are general-purpose input/output (GPIO) pins. They carry logic-level signals, not motor current. The sensor and controller often run from a logic supply rail, while the motor runs from a separate motor supply through the driver; they usually share a common reference (ground). This unit’s drawing is conceptual, not a wiring plan.
Limits of this unit’s rover model
- Constant speed of 20 cm/s and instant stops: no braking distance or inertia (Unit 05 replaces this).
- No wheel slip, no sensor noise and no delay other than the check interval.
- The game moves in exact 10 cm steps and reads exact distances.
- It teaches cause and effect. It doesn’t predict a real rover.
Watch and read (optional, never prerequisites)
- Stanford CS223A Introduction to Robotics, Lecture 1 (archived course): a selected overview; later lectures need matrix algebra.
- MIT 6.002 Circuits and Electronics (archived): useful before Unit 02.
- Arduino documentation: the official reference for later hardware study.
- Video question to answer in your own words: what can five measurements reveal about one distance?
How this unit is designed
The step order follows general recommendations in the U.S. Institute of Education Sciences practice guide Organizing Instruction and Study to Improve Student Learning (Pashler et al., 2007): alternate worked examples with problems, put words next to the graphics they describe, ask questions before teaching, and ask why-questions. That research did not test this page, and this page makes no claim about learning results. The drafting look is inspired by Learn Arduino; no code or art was copied.