Lego PF Hacking – Equipment

PowerFunctions_Logo

Lego Power Functions Hacking Guide –  Part 2 – Equipment
Part 1 – Introduction
Part 2 – Equipment
Part 3 – Wiring (Coming Soon)

Welcome to Part 1 of my Lego Power Functions hacking guide! For those who skipped the intro post I’m demonstrating how to hack Lego Power Functions  (part of Lego Technic) for control with your own microcontroller. In this guide I will be using the Arduino Uno to control our Legos.

To get started I’m going to go over the things we will need as a part of this guide:

Equipment


Equipment Shown:
1) Lego Power Functions Medium Motor
2) Lego Power Functions 9V Battery Box
3) Lego Power Functions Extension Cable (8″ or 20″)
4) Lego Technic Axel (optional)
5) Arduino Uno
6) Arduino CC3000 Wifi Shield (optional)
7) Breadboard jumper wires
8) Dual Motor Driver (DRV8833, can be others)
9) LED and 330 Ohm Resistor

1) Lego Power Function Motor

This is the standard Lego motor with four wire connection. It can be purchased as part of a kit (Link) or separately (Link). The Large and XL motor options also work.

2) Lego Power Functions 9V Battery Box

This is one of two Power Functions battery boxes. Both work just fine. This one comes in the Power Functions kit linked above with the motor or can also be had separately. (Link)

3) Lego PF Extension Cable

These cables are what we are going to hack to connect to the Arduino. This lets us keep the motor in tact for standard Lego builds. These cables were originally designed to convert from older Mindstorms connectors to the new PF connectors. We’ll be cutting of the Mindstorms end. You can find them here: 8″ (Link) and 20″ (Link)

4) Lego Technic Axel and Gear (optional)

Things are always more fun when they do stuff right? If you have some Lego Technic sets lying around go ahead and build something that moves in fun ways and connect it to the motor.

5) Arduino Uno and Solderless Breadboard

The brains of the operation. The Arduino Uno is one of the most common microcontroller boards for hobbyists worldwide. There are vasts amount of documentation and examples available all over the internet so you should have an easy time getting started if you haven’t used one before. The Arduino Uno and a solderless breadboard for wiring can be found at your local Radio Shack or also available online from Adafruit. Both have started kits available that include extra components to help you get started if you’re new to circuits.

6) Adafruit CC3000 Wifi Shield (optional)

Arduinos use add-on boards called “shields” to add functionality to them. As an optional addition to this guide series I’ll show how to add Wifi to your Arduino using this shield so your lego robots can be controlled from a computer! The shield can be found here (Link)

7) Wire Jumpers

To wire components together on a breadboard its always helpful to have jumper wires. A set of these is each included in the starter packs from Radio Shack or Adafruit. You can also cut and strip the ends of your own 22 gauge wire to make some cheaply.

8) Motor Driver – DRV8833

To control a motor you need large amounts of power, more than a microcontroller can handle. We use special motor driver chips to handle the motor current that can be controlled by a signal from the Arduino. There are numerous motor control shields available for the Arduino but I like using external drivers since they can connect to any microcontroller out there. This is a board from Pololu and can be found here (Link)

9) LED and 330 Ohm Resistor (optional)

I always add an LED to my projects just for status information. There is also an LED built in to the Arduino that can be used if it is not covered up by a shield.

10) Soldering Iron!

What hobby workspace wouldn’t be complete without a soldering iron? You’ll need one to tin some wires and attach the pins to many Arduino shields. I won’t be getting in to a soldering tutorial but youtube is your friend. My best advice is don’t completely cheap out on a soldering iron if you can help it. A variable temp iron from Weller or Hakko is a great choice. Both Adafruit and Radio Shack will have these.

Moving On!
Got it all? Ok, shopping list done! Time to move on to what most people are interested in and that is how to hack the Power Functions wires to connect them to our own circuits. Stay tuned as that’s coming up in the next part of the series!

Lego Power Functions Hacking Guide (Contents)
Part 1 – Introduction
Part 2 – Equipment
Part 3 – Wiring (Coming Soon)

Advertisements

New Tools – Windows Tablet and Lightbox!

New Tools! This past weekend I was able to pick up a Windows 8.1 Tablet and Lightbox!

Dell Venue 11 Pro

Dell Venue 11 Pro

Dell Venue 11 Pro

I bought a Dell Venue 11 Pro from the Microsoft Store while I was in Chicago for work related training. It has the Intel Atom Z3770 “Bay Trail” CPU and runs full Windows 8.1! I’m super excited about the Venue 11 due to the fact that I now have a computer I can easily get out on crowded airplanes to do programming and design work on. I love my 17 inch Dell Precision work laptop but at 8 lbs and as wide as it is it just isn’t easy to work on from an airplane seat back tray table with limited elbow room. The Venue 11 Pro should solve that problem for me and also allow me to mess with my designs while hanging out in the living room with the wife. I’m waiting for the keyboard/trackpad dock to arrive in the mail this week which should allow it to function like a standard 11″ laptop when the tablet is docked in it.

After only three days my first impressions are highly positive. Its super zippy for a mobile style processor and has run everything I’ve thrown at it so far. I have Visual Studio 2013 loaded on it along with the IDEs for Arduino and MikroC. All run like a champ. It evens runs Torchlight 2 for some real computer gaming on the go! Next step will be to load Eagle CAD and a 3D modelling package on it for 3D Printing. I’m pretty confident those will run just fine as well. It only has 64Gb of storage space which is a little restricting but should be just enough. I may need to start installing some applications on a USB 3.0 Flash Drive at some point.

http://www.dell.com/us/p/dell-venue-11-pro/pd?oc=ftcwd02h&model_id=dell-venue-11-pro

Photography Lightbox

Cowboy Studio Lightbox

Cowboy Studio Lightbox

Arduino in the Lightbox

Arduino in the Lightbox

My other pickup was a photography lightbox from a company called Cowboy Studio. Taking pictures on my desk don’t always turn out the best so I’m hoping this should make things a lot easier to see when trying to photograph details. The premise being it makes an “infinite white” background. As you can see I need to do some ironing of the cloth insert but I’m pretty happy with how the picture of my Arduino turned out. I don’t know that I’ll use it for everything since I don’t have a space where I can just leave it up all the time but it’s handy for pictures I just can’t get to turn out otherwise. At only $12 it was hard to turn down.

Light Box at Amazon.com

Lego Power Functions Hacking – Intro

PowerFunctions_Logo

Hacking LEGOS! Seriously, who doesn’t like Legos?

One of my current problems is how to get more people interested in microcontroller programming and robotics. Microcontrollers are cheap through the likes of the Arduino but until you attach cool things to them they are quite boring left alone. But how do you start someone going when the things you attach are complicated and often expensive… LEGOS! Few are the households that don’t have access to standard Legos. Add to that a Lego Power Functions motor and gear kit which can be had for as cheap as $10 on ebay and you’re up and running!

I’ve started a project to hack Lego motors for easy attachment to an Arduino. The benefits of this are two fold:

  1. Ease and Low Cost of Lego robot platform building
  2. Massive Arduino code library and documentation availability from all over the internet

My goal is to create a project anyone with Legos and an Arduino could put together to use as a robotics platform. My plan is to start with simple motor control and move on to more advance control.

Here are a few of my possible plans:

  • Wire project with no destruction of Lego motors or attached cables. (Hacking extension cables for Arduino connection)
  • Basic Motor Speed Control using Arduino and cheap motor driver from Pololu.com
  • Remote control over Arduino serial terminal
  • Remote control over WiFi using CC3000 Wifi shield for Arduino from Adafruit
  • PC Interface for WiFi robot control using C#
  • Android Interface for Wifi Robot control (possibly using Basic4Android, we’ll see)
  • 3D Printed Lego Compatible mounting blocks for Arduino (entirely dependent on me getting a 3D Printer, hint: watch this blog)
  • Addition of webcam stream using Raspberry Pi or upcoming Arduino Tre

Some of these are stretch goals but you can never plan to big as long as you keep your priorities in order! So here we go! Hopefully I’ll have Part 1 up soon which deals with starting equipment and hacking the Lego Power Functions cables for connection to a motor driver.

Series Contents:

New Name – Scuttlebots!

So my wife had a brilliant naming idea today. Before my blog and upcoming website were called “Scuttlebutt Engineering”. It was cool but not exceptional. However, thanks to my wife, the new website and blog is now called “Scuttlebots”. How cool is that?! Fun, catchy, and easy to remember. Love it. I need a profile pic/mascot to go with it now. I’m taking ideas if anyone wants to throw some out there!

The start of something great … or different at least

Mwhahaha, the site lives! One thing I have always struggled with is documenting my various projects in a way that others could learn from or understand what it is I am doing. Also, in a way that would better allow myself to go back and remember all the steps I took to get somewhere. The problem with most personal storage methods is that files get over written and old steps are lost over time as updates are made. So here we are, taking the first step to correcting that and hopefully making it easier to share what I’ve made (or trying to make anyway)! Whats the fun of a cool project if you can’t share it with others? So here we go!

3..2..1..GO!

3..2..1..GO!