PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Motors & actuators

Warm up

EasyBudget $18Python · gpiozero

Switch a heater through a relay module whose input is on GPIO17: off at first, on from 1 s and stays on.

The heater draws 100 mA — six times what a GPIO may give — so its current must flow through the relay's contacts: 5 V → COM, NO → heater +, heater − → ground. The relay's coil takes 5 V on DC+ (DC− to ground); Relay("high") closes when IN is high.

The pre-wired relay + heater kit costs more than the budget: buy the relay and the heater separately and wire them.

More in Motors & actuators