Skybluecam
Posts: 2
Joined: Thu Jan 02, 2014 8:21 pm

Lego + Pi (Beginner)

Thu Jan 02, 2014 8:27 pm

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 :)

Skybluecam
Posts: 2
Joined: Thu Jan 02, 2014 8:21 pm

Re: Lego + Pi (Beginner)

Thu Jan 02, 2014 11:12 pm

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?

User avatar
williamhbell
Posts: 291
Joined: Mon Dec 26, 2011 5:13 pm
Contact: Website Twitter

Re: Lego + Pi (Beginner)

Wed May 21, 2014 8:19 pm

You should be able to use another microprocessor chip to do this. The code at
https://github.com/mindboards/ev3source ... d_analog.c
explains how LEGO devices work.

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Lego + Pi (Beginner)

Thu May 22, 2014 9:13 am

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:
http://blog.zephod.com/post/37120089376 ... spberry-pi

Return to “Automation, sensing and robotics”