Ein eher ungewöhnliches Thema. Ich baue einen Schulungsaufbau für unsere Auszubildenden: ein kleines Lego-Technic-Förderband mit einem Farbsensor am Ende, damit sie eine „Linie“ auf einer Hermetry-Platine sehen können (gezählte Teile, laufendes Förderband, ein Stau-Alarm), ohne eine echte Maschine zu berühren. Ein Raspberry Pi 4 steuert alles und veröffentlicht auf v1/telemetry.Motoren habe ich: vier alte Power-Functions-Motoren (zwei M, zwei L, die mit 9 V) und den Satz meines Sohnes mit den neueren Motoren mit dem flachen Stecker.Der erste Versuch war ein BC337-Transistor an einem GPIO-Pin mit einem PF-M-Motor am 5-V-Pin des Pi, inklusive Freilaufdiode. Der Motor hat einmal kurz gezuckt, und der Pi hat neu gestartet. Der zweite Versuch verlief genauso. Ich bin Automatisierungsingenieur und weiß eigentlich, dass man Motoren nicht von einer Logikversorgung betreibt, aber im Lego-Maßstab dachte ich, es würde schon gehen.Was nehmen die Leute dafür? Ich hätte gerne eine Drehzahlregelung und idealerweise eine Positionsrückmeldung für ein „Stau“-Signal.
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.