Relay + fan
The relay + fan kit is a high-trigger relay module with a fan already connected through its contacts, both taking their power from the same 5 V feed. It costs $15 and is for control loops that move air: cooling a room, ventilation, or the fan half of a thermostat. Wire vcc to 5 V, gnd to ground and sig to a GPIO — sig high means the fan is running.
What's inside
| Part | Qty | Price each |
|---|---|---|
| Relay module | 1 | $4 |
| Fan | 1 | $6 |
| Total | 2 | $10 |
- The relay module is the switch: its coil draws about 72 mA from 5 V and its contacts carry the fan's current, so no load current flows through the GPIO.
- The fan is the load; in the simulator it mixes its room with outdoor air while it runs.
| Exposed pin | Inside the kit |
|---|---|
| vcc | relay:DC+ |
| gnd | relay:DC- |
| sig | relay:IN |
vcc feeds the relay coil and the switched loop (DC+ → COM → NO → fan+ → fan− → DC−), so it must be 5 V; gnd closes both circuits. sig is the relay's control input and is high-trigger: a 3.3 V GPIO pin is enough to turn it on.
Wiring it in circuit.py
from wiring import *
pi = Pi()
cooler = kits.RelayFan()
pi.V5 >> cooler.vcc # relay coil and switched supply are both 5 V
cooler.gnd >> pi.GND
pi.GPIO17 >> cooler.sig # high = fan onDriving it in main.py
from gpiozero import OutputDevice
from time import sleep
fan = OutputDevice(17, active_high=True, initial_value=False)
while True:
fan.on()
sleep(1)
fan.off()
sleep(1)Why buy the kit
Loose parts cost $4 + $6 = $10.00, against $15 — $5.00 for the coil feed, the contact loop and the load return soldered and tested. On a breadboard a relay kit means four extra jumper wires and a real chance of mixing COM and NC, which makes the load run when you want it off. The relays primer covers the wiring in full if you build it yourself.
Simulator vs real hardware
- The contacts model the real delays: about 10 ms to close and 5 ms to open after
sigchanges, so the fan follows the input with a tiny lag. - On the board the fan is a 5 V, 100 mA stand-in; its effect on a room uses the rated power from the inspector, scaled by (V ÷ 5 V)², and a fan pulls its zone towards outdoor temperature rather than "making cold".
- The relay's high-trigger input turns on above 1.8 V; it cannot dim or set speed, so on/off is all the control you get.
Further reading
- gpiozero: OutputDevice — the plain digital output used to drive a relay input, with
active_highfor low-trigger modules.