The Monday Jolt: Bricktronics Expands the Possibilities of Lego

Arduino Fun & Games Technology
The Monday Jolt: Bricktronics Expands the Possibilities of Lego

joltbanner
The Monday Jolt is a new column about microcontrollers and electronics that appears in MAKE every Monday morning.

lrgLego Mindstorms NXT is a fantastic educational robotics set that teaches kids and adults skills ranging from engineering to programming. Nevertheless, wouldn’t it be cool to enhance those Lego robots with Arduino boards and shields? With that thought in mind, Adam Wolf, Matthew Beckler, and I wrote Make: Lego and Arduino Projects and developed the Bricktronics shield to interface the two.

Adam and Matthew, who run the electronic kit business Wayne and Layne, tackled the challenge of making the shield. They reverse engineered Mindstorms’ protocols, had custom parts molded overseas, prototyped circuits, and developed an Arduino library for controlling the shield. The book explains how to build some fun Lego models as well, including a chocolate milk drinkbot and a keytar synth.

Anatomy of the Bricktronics Shield
As we delved into the world of Arduino and Mindstorms, we found one of the challenges was how to physically connect the two. Mindstorms uses custom wires with plugs that are RJ12 connectors with an off-center tab. We found two solutions: the first is to crimp a Mindstorms wire to a Molex plug, allowing the wire to be plugged into a Mindstorms motor or sensor on one end and the breadboard on the other. The simpler solution is to use an Arduino shield that can accommodate the plugs, so we focused on developing the shield rather than emphasizing breadboarded solutions–though we show you how to do those as well. The Bricktronics shield has six Mindstorms-compatible connectors, four for sensors and two for motors.

assembled

Here’s what the shield looks like:

  1. Sensor plugs. Ports 3 and 4 can accommodate analog sensors like the color or ultrasonic, while all four can accept input from digital sensors like Lego’s touch sensor.
  2. The MCP23017 chip is an I/O expander that sends data using only two pins using the commonplace I2C bus.
  3. The DPDT switch toggles you between the an Arduino Uno Rev 3 and older Arduinos for purpose of I2C data handling.
  4. Darlington Transistors are used to switch higher-current loads, and enable the shield to control non-Lego motors. Connect your components to the female headers next to the transistors.
  5. These male headers used to control Lego’s Power Functions line of DC motors, which don’t use Mindstorms plugs. (In the book we also show how to make Power Functions to Molex adapters.)
  6. L293D Motor Driver: This chip controls two Mindstorms servo motors.
  7. Motor plugs.
  8. Stackable headers. The classic shield accoutrement allows you to add still more shields on top.
  9. The button toggles the Arduino’s reset function.

Bricktronics vs. NXT
5870177096_18af9062c1_bSo the shield and Arduino beat out Lego’s microcontroller, right? Well, yes and no. In our explorations we found ourselves very impressed with the NXT brick, which is the default Mindstorms microcontroller. It’s so good that many hackers have figured out how to put alternate operating systems on the NXT brick like LeJos and NXT-C. Then there is the fact that the NXT can control 3 motors and our shield only two. That said, there is a lot to like about the Arduino approach. Simply being able to use all of Arduino’s vast ecosystem of hardware and code will do wonders for your robot. Wayne and Layne are also developing a motor controller that can run five motors and has a built-in XBee connector. It’s not ready to buy or build yet but you can see it in action here.

One of the biggest differences between the NXT and our boards is that Bricktronics is open source, and Wayne and Layne freely share the schematics and code necessary to create your own projects without needing to buy the shield. When other hackers begin developing their own Mindstorms-compatible projects, we’ll start seeing a huge expansion of what is possible to do with Mindstorms.

Bricktronics in Education
One of the cool surprises we encountered in developing Bricktronics was discovering that educators really dug it. According to these teachers, Arduino meeting Mindstorms takes something that challenges kids and adults technically, and brings it to the next level of difficulty. Some STEM teachers help students learn programming by introducing them to Mindstorms, which offers a simplified graphical interface and teaches broad programming concepts like loops and if/else constructs, but doesn’t really teach coding as such.

The next step is to take those same models the students built with Mindstorms’ official microcontroller and swap in an Arduino, thereby upping the challenge with a minimal learning curve. Simultaneously, students are introduced to the Arduino world gently, being able to acclimate themselves to the Arduino environment without learning electronics, soldering, and so on.

DrummerBot, a Basic Project
Step45Here’s a very basic robot that anyone can build as long as they have an Arduino Uno, a Bricktronics shield (or wire up your own!) and a Mindstorms set. It’s the DrummerBot, a robot designed to drum on a plastic peanut butter jar. It uses two servo motors to control the drumsticks, and an ultrasonic sensor to detect when someone goes near. The program works in a loop, waiting to sense a person within a certain distance. When it spots someone close, it begins drumming its drum, with the speed increasing the closer the object approaches.

Want to build the DrummerBot? Follow the links below to download the Arduino program as well as the Lego Digital Designer CAD file for the model.

This is a great project for beginners because it’s easy to build and program, and teaches you how Arduino interacts with the Bricktronics library. It’s a good way to get started delving into the fun possibilities that Lego and Arduino represent.

Learn More
Here’s what you can learn about Bricktronics:

  • Visit Wayne and Layne’s Bricktronics page.
  • Buy the book: you can get it on O’Reilly and Amazon.com, among others. Sample chapters are available at both sites.
  • Buy or build a Bricktronics shield.
  • Build DrummerBot: download the Lego Digital Designer file and Arduino code on Wayne and Layne’s Github page.

2 thoughts on “The Monday Jolt: Bricktronics Expands the Possibilities of Lego

  1. ManOfScience says:

    One major error on your Bricktronics overview:
    ” One of the biggest differences between the One of the biggest differences between the NXT and our boards is that Bricktronics is NXT and our boards is that Bricktronics is open source,… ”
    Lego may not be active in the oss community, but they have open sourced the NXT. the Schematics and firmware are distributed for free on the Lego website to this day. It is one of the main reasons that projects like Bricktronics are feasible.

    That said, kudos on the sheild! We can always do with more tools, and this looks like a good one, and probably far mor economical than an NXT brick!

Comments are closed.

Discuss this article with the rest of the community on our Discord server!
Tagged

My interests include writing, electronics, RPGs, scifi, hackers & hackerspaces, 3D printing, building sets & toys. @johnbaichtal nerdage.net

View more articles by John Baichtal

ADVERTISEMENT

Maker Faire Bay Area 2023 - Mare Island, CA

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 15th iteration!

Buy Tickets today! SAVE 15% and lock-in your preferred date(s).

FEEDBACK