Level 4 · Motion · project 7 of 8 · 20 min · ●●●○○

Dial-a-Spin

Dial-a-Brightness with a motor instead of an LED. Twist the knob and watch the fan speed slide from full spin to a slow crawl.

new here? Start with First Light — one battery, one resistor, one LED. It teaches the loop, LED direction, and why the 220 Ω resistor matters.

What you need

you'll learn: Ohm's law · Transistor switching · Circuits are loops

Circuit map

The circuit you'll build, running on the Workbench right now.

simulating…

If it doesn't work

The boring ways this circuit actually breaks — check these first before you unwire everything.

  • Knob does nothing — fan always at full speed. You wired the pot's two OUTER legs (a fixed 10 kΩ). Use the middle (wiper) leg + ONE outer leg — that's what varies as you turn the knob.
  • Knob does nothing — fan always stopped. The 1 kΩ base safety isn't wired between the wiper and the transistor base, so the base is floating no matter where the wiper is. Trace the loop: + → outer leg → wiper → 1 kΩ → base.
  • Fan runs the same speed everywhere except the very end of the knob. You're seeing the 'wasted range' at low pot values where the transistor is already saturated. That's real physics — the first 40 % of the knob's travel is deep saturation. The speed starts changing after that.
  • Transistor is too hot to touch after a minute. E-B-C pins scrambled. Flat face toward you, legs left-to-right are Emitter, Base, Collector. Backwards transistors dump nearly all their power as heat instead of driving the motor.
  • Fan won't start from full stop at high knob positions. That's static friction — motors need a small kick to start. Give the blade a nudge with a finger. The transistor's mid-travel drive is enough to keep it going but not always enough to break stiction.
  • Battery gets warm. Diode wired forward across the motor (banded end away from +). Flip it — it should be reverse-biased while the motor is running, invisible until the transistor snaps off.

What you're building

Dial-a-Brightness let you fade an LED from bright to almost dark by twisting a knob. This project does the same thing to a fan: twist the knob one way and the motor spins full-speed; twist the other way and it slows down until it's just barely turning. No switch — as long as the battery is on, the fan is doing something. The knob decides what.

The parts you already own do all the work. The pot is a knob-shaped resistor. Slide it into the transistor's base line — the same place the 1 kΩ base resistor lived in Handheld Fan — and turning the knob starves or feeds the transistor's base current. That base current, times β, is how much current the transistor lets through to the motor.

The big idea: base current commands motor current

The 2N2222's rule from Level 3 was I_C ≤ β × I_B. Whichever is smaller — β × I_B or "how much the load wants" — wins. In every L4 project before this one, β × I_B was way bigger than the motor asked for; the transistor sat deep in saturation and the motor got its full 143 mA. Here the pot lets you crank β × I_B down until it's smaller than what the motor wants — and once you cross that line, the transistor stops being a switch and starts being an amplifier. It passes exactly what the base commanded, no more.

That's the two-personality trick of a transistor:

  • Saturation (deep on): I_B big enough that β × I_B ≥ what the load wants. Transistor drops V_CE(sat) ≈ 0.2 V, load runs at full current. This is Handheld Fan at rest.
  • Active / linear region: I_B smaller. β × I_B < what the load wants. Transistor passes exactly β × I_B, V_CE floats up to whatever it needs to. This is where the motor slows down.

Level 6's 555 timer keeps the transistor in saturation and pulses it on and off fast (PWM) — a totally different way to control fan speed. This project is the "hold it in the middle" way. Both are valid; both are used in the real world.

Do the math

Same battery, same motor coil, same 0.7 V transistor wake-up. Only the base current changes as the knob turns. With the pot in series with the 1 kΩ base safety, base current is

I_base = (4.5 − 0.7) V ÷ (1 kΩ + R_pot) = 3.8 V ÷ (1 kΩ + R_pot)

And the transistor's collector current cap is β × I_base ≈ 200 × I_base.

  • Knob all the way down (pot ≈ 0 Ω): I_base = 3.8 mA. Cap = 760 mA. Way over the motor's 143 mA appetite → deep saturation → motor at 143 mA. Full spin.
  • Knob at 25 % (pot ≈ 2.5 kΩ): I_base ≈ 1.1 mA. Cap ≈ 220 mA. Still over 143 mA → still saturated → motor at 143 mA. Full spin. The first quarter of the knob's travel does nothing visible because the transistor was already saturated with room to spare.
  • Knob just past 40 % (pot ≈ 4.3 kΩ): I_base ≈ 0.72 mA. Cap ≈ 143 mA. Transistor teeters on the edge of saturation — same amount as the motor wants. Any further and it drops into active region.
  • Knob at half (pot ≈ 5 kΩ): I_base ≈ 0.63 mA. Cap ≈ 126 mA < 143 mA → active region. Motor at 126 mA. V_CE floats up to (4.5 − 126 mA × 30 Ω) ≈ 0.7 V — no longer near V_CE(sat).
  • Knob at 75 % (pot ≈ 7.5 kΩ): I_base ≈ 0.45 mA. Motor at ≈ 89 mA. V_motor ≈ 2.7 V. Fan noticeably slower.
  • Knob at max (pot ≈ 10 kΩ): I_base ≈ 0.35 mA. Motor at ≈ 69 mA. V_motor ≈ 2.1 V — roughly half of full-speed voltage → about half the RPM. The fan barely moves air, but the blade still turns.

Notice that the first 40 % of knob travel does nothing you can see. That's the "wasted" range where the transistor was already saturated with plenty of headroom. If it bothered you, you could shrink the base safety resistor (say to 220 Ω) — but then, at the zero end of the knob, base current would be 17 mA. Fine for the 2N2222 (which handles up to ~200 mA base), but pointlessly wasteful.

Why the 1 kΩ safety is still there

Fair question — the pot already has resistance. Yes, but only most of the time. At one extreme of the knob's travel the pot is basically 0 Ω, and without the 1 kΩ safety the base current would be 4.5 V ÷ 0 Ω — which the 2N2222's base junction would turn into "as much as the battery can push", and that ends with a burnt transistor. The 1 kΩ safety resistor keeps I_base under ~4 mA at the worst case — comfortable for the 2N2222 forever.

Same idea as the 220 Ω "defensive part" in Dial-a-Brightness, sized here for the transistor's base rather than the LED.

The heat story

Here's the subtle part of the physics. When the transistor is saturated (knob at low end), it dissipates almost no heat: V_CE × I_C = 0.2 V × 143 mA ≈ 30 mW. That's the Handheld Fan number.

But at knob halfway (V_CE ≈ 0.7 V, I_C = 126 mA), heat = 88 mW — three times the saturated case. At knob = 75 %, V_CE ≈ 1.8 V, I_C = 89 mA → 160 mW. At knob max, V_CE = 2.4 V, I_C = 69 mA → ~170 mW.

The 2N2222 is rated for 625 mW of dissipation, so nothing's in danger — but you will feel the transistor warm up as you hold the knob mid-travel. That warmth is where the "wasted" motor power went. A saturated transistor is thermally cheap; a linear one runs hot. This is exactly why big motor controllers use PWM (fast on-off pulsing) instead of analog dimming: it keeps the transistor in saturation, out of the hot linear region.

Build it

If your Handheld Fan is still on the board, this is a two-part swap: remove the push button and put the pot in its place. Same base resistor. Same motor + diode. Same transistor.

Fresh build:

  1. Power rails: battery + to a top row, battery to a bottom row.
  2. The knob lane: battery + → one outer leg of the pot.
  3. The pot's middle leg (the wiper) → 1 kΩ safety → transistor Base.
  4. The transistor: flat face toward you, legs left-to-right are Emitter, Base, Collector. Emitter → rail.
  5. Motor + flyback diode in parallel between the + rail and the transistor's collector. Cathode (banded end) of the diode on the + side. Same placement as First Spin and every L4 project.
  6. Twist the knob. The fan speeds up and slows down.

Tiny reliability tip (from Dial-a-Brightness): bridge the pot's unused outer leg to the wiper with a short jumper. If the wiper ever loses contact for an instant (dust, an old pot), the base line still sees the full 10 kΩ instead of an open circuit — the fan slows to a crawl rather than glitching off. Real electronics ships with this trick.

What "in the middle" earns you

The interesting knob position is somewhere around 60 %. The transistor is out of saturation and the motor is running at roughly 90 mA at 2.7 V — audibly slower than full speed, still spinning healthily, and the transistor is dissipating about 160 mW. Rest a finger on the flat face of the 2N2222 and you'll feel it warm.

That warmth is a real thing about analog electronics: whenever you're between "fully on" and "fully off", you're spending power as heat. The pot doesn't feel this heat (the pot only sees the tiny base current); the transistor pays the bill.

What this pattern opens up

  • Level 5 replaces the pot with an Arduino pin's PWM output — same base-side control, but pulsed instead of held mid-range, so the transistor stays in saturation and runs cool.
  • Level 7 replaces the pot with a program. Turn the fan on and off, ramp its speed, tie its speed to a temperature reading.
  • Level 9 wires two of these — one per wheel — to give a robot per-wheel speed control.

Every one of those is this circuit with the knob upgraded.

🧠 Your challenge

No single right answer. That's the point.

  • Predict the "wasted range." With the 1 kΩ base safety, at what pot position does the transistor first drop out of saturation? (Set β × I_B = 143 mA to find the border. I_B ≈ 0.72 mA, so 3.8 V ÷ 0.72 mA ≈ 5.3 kΩ total base resistance → R_pot ≈ 4.3 kΩ, or about 43 % of the knob's travel. Roughly the first 40 % of the twist doesn't do anything.)
  • Shrink the safety. Swap the 1 kΩ for a 220 Ω and redo the math. Where does the saturation border move to now? (3.8 V ÷ 0.72 mA ≈ 5.3 kΩ still, minus 220 Ω, R_pot ≈ 5.1 kΩ. The border barely moves — but now the maximum base current at pot ≈ 0 is 17 mA, and the pot's got the whole travel to itself instead of sharing with a hefty base resistor.)
  • Feel the temperature. Hold the knob at ~60 % for 30 seconds, then release it and touch the 2N2222's flat face. Warm? Now hold it at either end (0 % or 100 %) for the same time. Which is hotter? Why? (Middle is hottest — V_CE × I_C is maximum there. Both ends the transistor is in saturation (V_CE tiny) or barely conducting (I_C tiny). This is the whole reason PWM exists.)
  • Two-motor dial. Wire a second motor + diode in parallel with the first. Now the transistor's cap has to feed 286 mA worth of motor. At what knob position do BOTH motors saturate? (Need β × I_B ≥ 286 → I_B ≥ 1.43 mA → 3.8/1.43 ≈ 2.66 kΩ → R_pot ≤ 1.66 kΩ or the first 17 % of travel. Above that, both motors slow together.)
  • Pot as an "off switch"? With a 10 kΩ pot alone, the fan never truly stops (it just gets very slow). Add a slide switch in series with the pot — flip it off to break the base line entirely. Now the knob dials speed and the switch is a hard on/off. What's the fan doing when the switch is on and the knob is at max? (≈ 70 mA — spinning slowly. Switch off: 0 mA. Two independent controls.)

For grown-ups: safety notes

  • Battery-safe throughout. 4.5 V and up to 150 mA won't harm you even in direct hand contact.
  • The transistor gets warm mid-travel. That's normal — the physics says so. Somewhere around the middle of the knob's range, V_CE × I_C peaks at about 170 mW. Warm to the touch, never hot enough to burn. If it feels hot within seconds of turning on, check E-B-C leg order (flat face toward you, legs left-to-right are Emitter, Base, Collector) — backwards transistors dump much more of their power as heat.
  • Diode polarity matters. Cathode (banded end) toward battery +. Reversed, it shorts the battery through itself the instant the transistor turns on.
  • Fingers, hair, and paper blades don't mix well. Even at half-speed the motor's shaft still spins fast enough to grab loose hair. Tie hair back, keep loose sleeves clear.
  • The pot is always in the loop. There's no "off" position of the knob — even at max, ~0.35 mA is flowing through the base line and 70 mA through the motor. If you want the fan genuinely off, pull the battery. Fresh AAs will run this fan for many hours regardless of knob position, so leaving it on isn't dangerous, just wasteful.
  • Pot bodies are metal on many types. If you're building on a metal surface, put a bit of paper under the breadboard so nothing shorts.
  • Never wire this to mains. All parts are 4.5 V-safe.

Checked against

Keep building