Slightly unusual one. I’m building a training rig for our apprentices: a small Lego Technic conveyor with a colour sensor at the end, so they can see a “line” on a Hermetry board (parts counted, conveyor running, a jam alarm) without touching a real machine. Raspberry Pi 4 runs the show and publishes to v1/telemetry.
Motors I have: four old Power Functions motors (two M, two L, the 9 V ones) and my son’s set with the newer motors that have the flat connector.
First attempt was a BC337 transistor from a GPIO pin with one PF M motor on the Pi’s 5 V pin, flyback diode included. The motor twitched once and the Pi rebooted. Second attempt the same. I’m an automation engineer so I know better than to drive motors off a logic supply, but at Lego scale I thought I’d get away with it.
What do people use for these? I’d like speed control and ideally some position feedback for a “jam” signal.