Un sujet un peu inhabituel. Je construis un banc de formation pour nos apprentis : un petit convoyeur Lego Technic avec un capteur de couleur au bout, afin qu’ils puissent voir une « ligne » sur une carte Hermetry (pièces comptées, convoyeur en marche, alarme de bourrage) sans toucher à une vraie machine. Un Raspberry Pi 4 gère l’ensemble et publie sur v1/telemetry.Moteurs disponibles : quatre anciens moteurs Power Functions (deux M, deux L, les 9 V) et le jeu de mon fils avec les nouveaux moteurs à connecteur plat.Première tentative : un transistor BC337 piloté par une broche GPIO, avec un moteur PF M alimenté sur la broche 5 V du Pi, diode de roue libre incluse. Le moteur a eu un sursaut, puis le Pi a redémarré. Deuxième tentative, même résultat. Je suis ingénieur en automatisme, je sais qu’il ne faut pas alimenter des moteurs depuis une alimentation logique, mais à l’échelle Lego je pensais m’en tirer.Qu’utilisez-vous pour ce type de montage ? J’aimerais un contrôle de vitesse et, idéalement, un retour de position pour un signal de « bourrage ».
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.