PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Motors & actuators

Kick start

MediumBudget $16Python · gpiozero

A DC motor on an L298N: IN1 GPIO5, IN2 GPIO6, ENA GPIO12. Run it forwards at 30 % speed — about 30 rpm — and keep it there.

Feed the driver's +12V and +5V terminals from the Pi's 5 V and join the grounds. On 5 V the bridge leaves the motor about 3 V: roughly 100 rpm at full speed, proportional to the PWM duty.

The catch: a geared motor needs about a quarter of its rated 6 V to break free, and 30 % of the 3 V the bridge gives is only 0.9 V — from rest it just hums (stall warning). Once it turns, it keeps turning at that voltage. So give it a kick: full speed for a moment (0.2 s is plenty), then drop to 30 %.

The test wants 25–35 rpm from 1 s on.

More in Motors & actuators