Level 4 · Motion · project 12 of 13 · 25 min · ●●●○○

Dusk Fan

Sunrise Fan's mirror image — the room gets DARK and the fan spins. A bedside cooling breeze that starts as the lights go out.

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

You'll make a bedside fan that starts at dusk
You'll learn linear-region drive vs saturation
Watch for flyback diode across the motor, banded end toward +

What you need

🔧 Try before wiring →

you'll learn: Voltage dividers · Transistor switching · Ohm's law

Circuit map

The circuit you'll build, running on the Workbench right now — shown with the lights off.

simulating…

If it doesn't work

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

  • Fan doesn't spin when the room darkens. Check divider first — 10 kΩ on TOP, LDR on BOTTOM (opposite of Sunrise Fan). Then 2N2222 pins E-B-C flat-face-forward. Then diode band faces +. In near-total darkness the middle-node voltage should sit around 1 V; anything under 0.7 V means the divider is wired backwards.
  • Fan spins in daylight, not in the dark. Divider is flipped. Swap the LDR and the 10 kΩ so the 10 kΩ sits on top and the LDR on bottom. That's the Automatic Night Light wiring.
  • Fan buzzes but the blade barely turns. Motor is starving. Static friction from a fresh assembly needs a nudge; flick the blade with your finger. Also check batteries — a tired pack drops to under 3.5 V and the linear-mode drive already runs at ~65 mA, so voltage sag matters here more than in Sunrise Fan.
  • Transistor case gets hot. Base 1 kΩ missing, or wired between + rail and base instead of between divider midpoint and base. Trace: middle node → 1 kΩ → base. Nothing else on the base leg.
  • Diode gets warm. Diode is either wired in series with the motor, or flipped. It goes ACROSS the motor with the banded end (cathode) toward +. Reversed diodes short + through the motor to the collector when the motor runs.
  • Fan runs at random times. LDR is picking up flickering ambient light (moving shadows, a rotating fan, a candle). Move the sensor into a spot with steadier lighting, or point it away from the flickering source.

What you're building

Sunrise Fan pointed at the wrong end of the day. Take everything from Automatic Night Light — 10 kΩ on top of the divider, LDR on bottom, 1 kΩ base resistor, 2N2222 — and swap the LED + 220 Ω on the output for a motor plus a flyback diode. Sunset now starts a breeze on your desk.

Cover the sensor: fan spins. Open the shade or shine your lamp on it: fan coasts to a stop. A ceiling fan that ignores you all day and starts up when you turn the lights off for bed.

Same trick you've seen four times by now: one brain, many mouths. The night-light's dark-triggered brain, the sunrise-fan's motor mouth. If your Automatic Night Light is still on the breadboard, this is a two-minute change: pull the 220 Ω and the LED, drop in the motor and 1N4001. Everything left of the transistor stays exactly where it was.

Reuse from Level 3 (the "brain")

  • Voltage divider: 10 kΩ on top, LDR on bottom (~1 kΩ bright, ~100 kΩ dark). Middle voltage rises as the room darkens.
  • Base resistor: 1 kΩ between the divider's middle node and the transistor's base. Same polite base current Automatic Night Light used.
  • 2N2222: turns on when the base sits above ~0.7 V. β ≈ 200.

New at Level 4 (the "mouth")

  • DC motor: ~30 Ω coil, spins from ~30 mA up.
  • 1N4001 flyback diode: cathode (banded end) toward battery +, anode to the motor's low side (transistor collector). Reverse-biased and invisible while the motor runs; catches the coil's inductive kick the instant the transistor turns off.

Compare to Sunrise Fan: the output half is the same, the divider is flipped. LDR moved from top to bottom, so the trigger inverted. Same components, opposite behaviour. Real product-design decisions often come down to one part swap like this.

Do the math

Dark room (LDR ≈ 100 kΩ on bottom, 10 kΩ on top):

If nothing pulled current at the middle node, the divider would sit near 4.5 × (100 ÷ 110) ≈ 4.1 V. In reality, the base junction clamps it. Solving KCL at the middle node with the base held at 0.7 V, the middle settles around 1.04 V — much lower than the theoretical 4.1 V because the top 10 kΩ can't source much current.

  • Base drive: I_base = (1.04 − 0.7) ÷ 1 kΩ ≈ 0.34 mA.
  • Collector current: β × I_base ≈ 200 × 0.34 = ≈ 68 mA. The transistor is not in deep saturation this time — the 10 kΩ top resistor throttles the base drive, so the motor sits in the transistor's linear region.
  • Motor speed: 68 mA is well above the motor's ~30 mA start threshold, so the coil turns. The blade spins at roughly half the speed you saw in Handheld Fan (~143 mA). The breeze is real but gentle — an "on but easy" motor.

Bright room (LDR ≈ 1 kΩ on bottom):

  • Divider open-circuit middle: 4.5 × (1 ÷ 11) ≈ 0.41 V — below the 0.7 V wake-up line, so the base junction never conducts.
  • Transistor off. Motor idle. Battery drain measured in microamps.

Why the fan is gentler than Sunrise Fan

Look at where the sensor lives:

Sunrise Fan (bright triggers) Dusk Fan (this — dark triggers)
Top resistor LDR (≈ 1 kΩ when firing) 10 kΩ (fixed)
Bottom resistor 10 kΩ LDR (≈ 100 kΩ when firing)
Middle voltage ≈ 2.5 V clamped by base ≈ 1.04 V clamped by base
Base current ~1.8 mA ~0.34 mA
Collector current ~350 mA capable (saturated) ~68 mA (linear region)
Motor current ~143 mA (full speed) ~65 mA (roughly half speed)

The top resistor is what feeds the base. Sunrise Fan is bright-fires because its top resistor gets small (≈ 1 kΩ LDR) when the sensor sees light — so it can shove plenty of current into the base. Dusk Fan is dark-fires because its top resistor is always 10 kΩ, and even a fully-open bottom leg can only pull so hard through that.

That's not a bug — it is a design property. Bright-triggered fans saturate hard and spin at full speed. Dark-triggered fans in this topology hum along in the transistor's linear region. Both do the job; the second is quieter, cooler-running, and easier on batteries.

Build it

If your Automatic Night Light is still on the breadboard, keep the sensing half and replace only the output lane: pull the 220 Ω and the LED; drop in the motor + 1N4001.

Fresh build:

  1. Power rails: battery + to a top row, battery − to a bottom row.
  2. The sensing half (from Automatic Night Light): battery + → 10 kΩ → middle row → LDR → battery −.
  3. The base link: middle row → 1 kΩ → transistor Base.
  4. The transistor: flat face toward you, Emitter to − rail, Collector to a fresh row A.
  5. The motor lane: motor between the + rail and row A. Either lead works — DC motors don't have a polarity, just spin direction.
  6. Flyback diode across the motor: cathode (banded end) in the + rail row, anode in row A. Exactly the placement from First Spin and Sunrise Fan.
  7. Point the LDR at a lamp: fan is idle. Cup your hand over the LDR: the blade starts turning within a second and speeds up as the shade deepens.

If the fan doesn't turn even in near-total darkness, work backward from the collector: verify the diode's band faces +, then swap the LDR for a plain 10 kΩ on the bottom of the divider (that fakes a "very dark" state and should spin the motor). If that works, the LDR itself is your suspect (bad contact in the breadboard, or an LDR with a very small dark-resistance).

Where to place it

  • Bedside table pointed away from a windowsill: the fan starts when you turn off the lamp for the night and stops with sunrise. Fresh AAs last for weeks of nightly cycles.
  • Reading nook lamp: a "reading air" fan that comes on with your book light off, so the room doesn't get stuffy while you read without a fan running the rest of the day.
  • Bathroom night light replacement: turn off the overhead, and the fan clears the mirror after a shower without you doing anything.

The pattern for every level from here on

You've now built the same brain wired to four different mouths:

  • Brain: LDR-on-bottom (dark triggers) →
    • LED lane → Automatic Night Light
    • Buzzer lane → Cookie Jar Alarm
    • Both lanes together → Dusk Chorus
    • Motor lane → this project

That is the pattern that scales: swap the divider to invert the trigger (LDR to the top for Sunrise), swap the output half to change what the trigger does. Level 5's servo, Level 7's Arduino pin, and Level 9's motor driver each drop into this same collector slot.

🧠 Your challenge

No single right answer. That's the point.

  • Flip the trigger. Swap the LDR and the 10 kΩ (LDR to top, 10 kΩ to bottom) — the Sunrise Fan brain. What does the fan do now? (Answer: fires when it's bright, saturates hard at ~143 mA — full speed. You've rebuilt Sunrise Fan by hand and can feel the difference: full spin instead of gentle turn.)
  • Predict the fade. Cover the LDR gradually with a sheet of paper. Does the motor jump on suddenly or fade in? Why? (Fade in — as the LDR climbs from 1 kΩ toward 100 kΩ, the middle-node voltage crosses 0.7 V somewhere partway through, and the transistor drifts through its analog region. The blade speeds up smoothly with darkness.)
  • Add an override switch. Put a slide switch in the motor lane (between the + rail and the motor). Now you can force the fan off regardless of light — an "away" or "guest" switch for daytime.
  • LED companion. Fan a second lane off the collector: a 220 Ω and a red LED, in parallel with the motor. Now the fan and a small indicator light both turn on together at dusk — the same "one brain, two mouths" trick as Dusk Chorus, this time with a motor as the noisy mouth. Does the LED steal enough current to weaken the motor? (A little — the LED lane at ~10 mA is small next to the motor's 65 mA. Motor drops to ~55 mA — still visibly spinning.)
  • Sun trigger + fan trigger together. Wire this whole circuit and a Sunrise Fan side by side, sharing the battery pack. Both fans are silent during the "civil twilight" period between sunrise and sunset. One runs at night, one runs during the day, and you have a round-the-clock cooling desk with automatic hand-off. Draw the schematic first.
  • Swap 10 kΩ for 1 kΩ on top. Predict first: what happens to the bright-room state? (Middle rises to 4.5 × (1 ÷ 2) = 2.25 V — well above 0.7 V — so the fan spins in daylight too. You lose the dark-trigger. Same lesson Automatic Night Light asks in its own challenges.)

For grown-ups: safety notes

  • Battery-safe throughout — 4.5 V and ~70 mA won't shock you. The transistor might get slightly warm during long-running dark states because it's dissipating in the linear region (not the low-loss saturated region); a fingernail on the case should still be comfortable. If it's hot enough to be uncomfortable, disconnect and check that the 1 kΩ base resistor is actually there.
  • Diode orientation matters. Cathode (banded end) toward battery +. Reversed, the diode conducts continuously with the motor running and will heat up fast. Disconnect and flip it if you see it warming.
  • Transistor orientation matters. Flat face toward you, legs left-to-right are Emitter, Base, Collector. Wired backwards, the 2N2222 might work for a while but will run hot.
  • The paper fan blade is the fastest-moving part in this project (~2,000–3,000 RPM at this reduced current, vs 6,000 in Handheld Fan). Still fast enough to tangle long hair — tie it back — but well below anything that could hurt skin.
  • Don't leave this by an open window at night. Wind gusts through the LDR can occasionally toggle the fan on and off if the sensor sits near a moving curtain shadow. Position the LDR so it sees the room's ambient light, not shifting local shadows.
  • The 1N4001 is rated for 1 A continuous. The coil-decay pulse from a 65 mA motor is measured in microamps and lasts a few microseconds. The diode outlives everything else in the circuit.
  • Never wire this to mains. All parts are 4.5 V-safe.

Checked against

Keep building