Pythonize the Lego Mindstorms

Date:  Mar 5, 2018

You probably don’t understand what I am trying to say in the captioned title.

If you buy a Lego Mindstorms, you can download the Lego Mindstorms software to program you Lego Mindstorms robots.  Lego Mindstorms software has a “Blockly” programming interface that is similar to MIT’s Scratch programming interface.

But there is always limitation what a “Blockly” programming interface can do.  The most powerful method to control your Lego robots is thru using a text based programming language, such as Python.  Well, many can argue that Python is a Interpreter language instead of a real programming language such as C or C++, etc.  But it is good enough to provide unlimited power to your Lego Mindstorms programming.


There is a lot of development on how to interface Python to Lego Mindstorms.  One such web site that provide the info is:

Screen Shot 2018-03-05 at 7.43.15 PM.png

Both my kids attended Da Vinci Innovation Labs robotics class.  They love the course given there.  And they really treat it like a second home.

But … sometimes, you cannot commit to sent them every day to the class because both parents still need to work.

And, initially, there is absolutely, no way that after you go home, you can spent more time to do or think what challenges you suppose to solve in the class.  Because, all the programming environment and interface are IP (Intellectual Properties) to Da Vinci Innovation Labs.  So, you cannot bring anything home.

So, how to practice more and make it perfect?  The only wat is to go to Da Vinci more lah!


Very simple, you can go and read the, and learn how to download and install the ev3dev firmware/software on a Micro SD card, and plug that into the Lego Mindstorms EV3 brain, and then, you should be able to boot the systems into the ev3dev systems which allow you to write Python codes to control the Lego Mindstorms EV3 robots.

So, I am glad that my boy – Jay has really grown up and knows how to do it by following the instructions.


What do you need?  So, you need a Micro SD card < 32Gb.  And you need a Wireless network dongle that works with Lego Mindstorms.


Get the Wifi dongle that is supported by Lego Mindstorms.


Download the firmware.  And then, use ApplePi Baker (if you use MacOs) to burn the firmware onto the Micro SD card.  Plug in both the SD card and the USB, and reboot the EV3.  And you are in business.


And you can start coding in Python.


All the references are here:

And you can start talking to your EV3 using Python running on the EV3 Micro SD card.  Test out all the functions.  Make the LED lid up, make sounds, turn the motor, use the sensors, etc.

Screen Shot 2018-03-05 at 8.01.12 PM.png

Here is the video of ev3dev running on my EV3.  And Jay gets to install it onto his EV3 too.  (Yes, my EV3 is my EV3, his is his, we don’t share the robots, hahahahaha).

Writing codes is easy. Once you know the functions, then, simply calling those function will do what you want it to do.


This is our “Hello World” of running Python on EV3.  We make it speak!

Yeah!  This is a big leap.


I also can install ev3dev onto my BrickPi3.  BrickPi3 is the interface board that you use together with Raspberry Pi 3 and all the EV3 sensors and motors.  If you use Raspberry Pi, you can have even more powerful robots.  Because the space on EV3 is limited so you cannot run so big program.  But you can do whatever you want on a Raspberry Pi.

This will be Jay’s next project.


For now, let’s make fun things with the EV3 robots and program it using Python.


I think Jay still need a few more days to complete his Intermediate course.

After that, you should be able to do more things on his robots.

Da Vinci Jay.jpeg

Learning to program, and learning robotics is an in-thing in Singapore.  This is the recent competition event happening just last week.  Too bad, both Jay and Kay did not go and take a look.  (As Jay needs to work in the school for his community lunch and Kay needs to take his Competition Sparing lessons).

As you can seem lots of primary school students as well as secondary school students attending this meet.


There is a chance Jay can try to compete in WRO (World Robotics Olympiad) this year.  But because the competition is few days in September.  And Jay is in PSLE year.  So, after much considerations, we decided to drop that idea.  🙂

Last week is also the last class for Jay and Kay attending WonderWorks Robotics.


So, this is their last robot they build using the Lego Blockly interface.

You probably wondering, why Jay’s robot is super fast.  Later the instructor told me, “Jay is very good.  He build his initial robots very fast with 2 motors.  As he go so much time, he go and modify his robots on its own to use 3 motors.  The robot is very good, fast and stable.”

This is the same as a few weeks ago, where he uses 2 sensors instead of 1 to compensate the lousy inconsistent gyroscope.


Learning to program is to learn how to solve complex problem.  That is the key of learning in such programming course.  And I think Jay is getting there.




Leave a Reply