Instructables

How to use an Android device and Lego NXT to build a Two-Wheel Self-Balancing Robot

Featured
Picture of How to use an Android device and Lego NXT to build a Two-Wheel Self-Balancing Robot

Today, I will teach you how to make an Android powered and controlled Two-Wheel Self-Balancing robot with Lego NXT.

Firstly, let's see a testing video for the final robot.

Here is another testing on the slope:

To build this robot, all the things you need are list below:

- Two Android devices. One for balancing control and one for remote control. The one what I use for balancing control is Nexus 7, for remote control is an Android smart phone with a simple control app.

- Lego NXT kit.

- An Android ADK board. The one I use is called HippoADK.

- A ADK board to Lego shield. The one I use is HippoADK-Lego Shield.

- A battery.

How does this robot work?

By using the HippoADK board and HippoADK-Lego Shield, Nexus 7 can read the status of the Lego Motors and can also control the Lego Motors. While balancing, with the gyroscope sensor in Nexus 7, the robot can adjust the status of the Lego Motors to keep balance. Hippo-ADK is an open-source electronics prototyping platform based on Android. By combining an Arduino-like microcontroller board with Android, not only does it allows you to tap into the powerful resources of your smart devices, but also to do so in an amazingly simple and elegant manner.

For more about HippoADK, you can see more details here.

Let's go to see how to build this robot.

 
Remove these adsRemove these ads by Signing Up

Step 1: Assembly Instructions

Picture of Assembly Instructions
IMG_20140706_141416.jpg

The attach pdf file is the assembly instructions of the main part of the robot by LEGO NXT.

Step 2: Add ADK parts and battery to the robot

1. Add battery as the above pictures show.

2. Add HippoADK and HippoADK-Lego Shield as above pictures show.

Step 3: Connect the wires

Picture of Connect the wires
IMG_20140706_151815.jpg

Connect the wires.

Step 4: Add Nexus 7 to the robot

Picture of Add Nexus 7 to the robot
IMG_20140706_162038.jpg
BalanceRobot-AIBlocks.jpg

After assemble the Lego parts of the robot, you can program the robot using our graphical programming platform based on App Inventor. As you can see the code is incredibly simple we can show it in one picture.

BalanceFilterDemo is attached. You can use it to test the Kalman filter together with the phone's accelerometer and gyroscope.

You can easily add Nexus 7 to the robot as above pictures show.

Step 5: Run the robot

Picture of Run the robot

Put the robot on the desk, turn on the power and run the robot.

Ingenious! I like how you used legos to make an awesome robot! Btw, check your PM inbox.

waltassault4 months ago

Really nice project and I'm trying to do something similar with autonomous control using an Android device's sensors(GPS, Gyro, Accelerometer etc.). My question is; Doesn't the Nexus 7 have USB OTG? Meaning you could use a regular Arduino/compatible board versus an Android ADK type board. I've looked into this a bit but I haven't begun development. I was thinking that with USB OTG capability I could communicate with one of my existing boards.

HippoDevices (author)  waltassault4 months ago

Yeah!The Nexus 7 have USB OTG,you can communicate with regular Arduino/compatible board.And the Hippo-ADK has USB-OTG too.But most of smart phone doesn't have otg,they can't communicate with regular Arduino.But both of Android device after 2.3.4 have ADK:)

By using Hippo-ADK,you don't need to learn the mind-boggling hardware programming; Just use graphical programming platform App Inventor or Java API to create your dream gadgets.

cheer4ftc4 months ago

Cool! I couldn't find any information on the Hippo-ADK boards. Is there a link somewhere with more info?

HippoDevices (author)  cheer4ftc4 months ago

Hi cheer4ftc, we have launched a Kickstarter campaign of this board. You can see more details here:

https://www.kickstarter.com/projects/hippo-devices/hippo-adk-create-your-dream-gadget-with-a-smart-de

cstorm1254 months ago

Optimus Prime!!!!

NorthWesttel4 months ago

Did you use the sensor on Nexus 7?It looks a great job!

Yes. I think so. It made Android possible.

Ufactory4 months ago

Really a great project. I have also made a Two-Wheel Self-Balancing Robot by using Arduino. But using an Android Devices and Lego is really a smart and impressive idea. Genius!!! Hope to see more projects of you!!! Cheers!!!

RoboterS4 months ago

Very nice! I wish you good!

CarterBond4 months ago

Looks cool! I am working on a mindstorm project right now. I wish you luck in the contest. :)

Nice job! It's really cute but also very impressive!