Page 1 of 1

Lego + Pi (Beginner)

Posted: Thu Jan 02, 2014 8:27 pm
by Skybluecam
So I am a COMPLETE beginner to the Pi (got one for Christmas) and I would like to build a lego robot with it. Nothing complicated, just RC control. How would I connect the Pi to a lego power functions motor? (I don't want to use BrickPi). Thanks in advance for your help :)

Re: Lego + Pi (Beginner)

Posted: Thu Jan 02, 2014 11:12 pm
by Skybluecam
Ps I would like to use python to code, I have experience in that. I was thinking of using an arduino L298n motor driver- would this work?

Re: Lego + Pi (Beginner)

Posted: Wed May 21, 2014 8:19 pm
by williamhbell
You should be able to use another microprocessor chip to do this. The code at ... d_analog.c
explains how LEGO devices work.

Re: Lego + Pi (Beginner)

Posted: Thu May 22, 2014 9:13 am
by Ravenous
Skybluecam wrote:I was thinking of using an arduino L298n motor driver- would this work?
I think the Power Functions motors are just ordinary motors, that is they have no special electronics built in. (Unlike the Mindstorms, etc.) So the L298 or any driver like that should work.

Trouble is how to make the connections. The wires are terminated with a special Lego brick. You could buy one of the extension leads that joins to that brick, and cut it in half. That would give two wires to connect to, without having to modify the motor.

I think there are articles out there on the net where people have worked out which two wires connect to the motor, but poking around with a 6-9V battery should establish that.

EDIT: I found an example, using one of the larger XL power functions motors, can't quite see from the photos but it looks like he just cut a connector off and connected the wire to his breadboard: ... spberry-pi