Lego Mindstorm Controller

Project Synopsis

As part of a group assignment I was given a Lego Mindstorms EV3 robot with one robot arm for shooting balls. A competition will be held in 2 weeks time where the robot has to shoot a ball through a target and score a point. The winner will be determined by how quickly the robot can complete a course and how many targets have been hit. The Lego Mindstorms EV3 robot was provided pre-built with no controls. The assignment was to build an Android application to control the robot.


The main goal was to develop an Android application which controls the movement of the Lego Mindstorms EV3 robot. There were no specific instructions on how to control the robot – e.g buttons pressed on a joy pad or control through the accelerometers – anything was allowed. I decided to build the controls around the gyroscope and accelerometers in the Android phone. A button which activates the slingshot arm of the robot.

Following the original assignment from my professor Jürg Luthiger in German:


Mit den Uebungen soll der Student in einer Gruppenarbeit selbständig eine Android Applikation schreiben, mit der man einen Lego Mindstorm Roboter (Abbildung 1) via Bluetooth ferngesteuert kontrollieren kann.


– Der Roboter wird funktionsfähig zur Verfügung gestellt.
– 2 Android Smartphones stehen zur Verfügung (Eigene Android Handys können natürlich auch eingesetzt werden.)
– Der NXT Legostein kann via Bluetooth mit dem Smartphone kommunizieren.
– Das Smartphone und der NXT Legostein sind über Bluetooth gepairt.
– Sie haben einen netzwerkfähigen Laptop mit Eclipse und Android SDK zur Verfügung, auf dem sie die Android Applikationsentwicklung machen können

Key Activities

  • Setup Basic Bluetooth Communication between an Android Phone and the Lego Mindstorms EV3 Brick
  • Program Simple Control UI to control the Lego Mindstorms EV3 Robot
  • Tune the control parameters to enable fine-grained control of the robot in preparation of the competition
  • Program controls for the activation arm and test it

Source Code

I published the full source-code under the Apache 2 License on github. The Application was built and tested on Android 4.0.3 which at the time was the latest available version for my Samsung Galaxy S1 (running Cyanogenmod)


Building the Application – First Test Run
Final run at competition