I needed to control a DC motor from my Raspberry Pi’s GPIO port as part of my time-lapse dolly project. I had to be able to turn the motor on for approximately 150ms which would in turn move the dolly along by 3mm.
Full article here:
Simple way to control 12V DC Motor using Raspberry Pi’s GPIO port and NPN transistor (Geeking About)
Tutorial : Control a DC motor with Raspberry Pi (My Robot Lab)