Presenting the Code.org robot

The website Code.org provides the worlds most widely used training environment for children who are learning the basics of programming. Different kind of robots are also very popular as tools to help children learn the cause and effect of their code. What if these could be combined? What if there was a robot, that could execute exactly the same code as children produce in the code.org exercises?

Let us present: the Code.org compatible robot!

We had this idea about a year ago to build a robot that is compatible with the JavaScript syntax used at Code.org (and Blockly) and we finally got around now to blog about it in English, for the public and global benefit of anybody.

Hardware

Building Code.org robots for Koodikerho's (code clubs) in Finland
Building Code.org robots for Koodikerho’s (code clubs) in Finland

The brain of the robot is a Raspberry Pi, a very small and cheap computer designed for educational and tinkering use. The Raspberry Pi is attached to a USB power bank, so that it can move around freely without any power cords hamperings its movements. The RPi also has a small USB Wi-Fi module so that it can also be controlled wirelessly.

The vehicle under the computer is built using the budget robotics kit from Ryanteck. The kit contains a microcontroller which the RPi connects to, and the microcontroller controls how the electricity from the battery pack is directed in the two servo motors that make the wheels rotate.

The robotics kit pre-soldered and with the Wi-Fi module bundled costs about 40 euros, while the Raspberry Pi model A+ with a SD card is about 30 euros more, and the USB battery pack in around 10 euros, but unfortunately you must get them from a separate store as they are not available from Ryanteck. In total the whole package costs about 80 euros.

Software

The Code.org robot software is a Node.js program available on Github.

The Node.js depends on the Cylon robotics library. Naturally you also need to have a OS installed, for which we recommend the Raspbian (Debian version for RPi).

Usage

Code.org view source
Code.org view source
Code.org robot UI
Code.org robot UI

The Code.org robot works such, that when you power on the robot, it will provide a Wi-Fi access point called “Code.org-robot”. The network does not have any password and anybody can connect to it. On the wireless network you can open with a web browser the address http://code-org-robot.local and you will see a big plain text area element. In that element you can paste whatever code you’ve created on Code.org and once you press “Run”, it will execute it.

Naturally the robot cannot write anything on the floor, but it will process all the movement related code and move on the floor just like the Angry Birds, Elsa and other characters at Code.org.

This is a nice demonstration for children: the code is universal, and the code they produced in a game-like environment on-screen can as well command a real life robot that moves around.

How to build it

For exact instructions on how to build the robot, see the robot code repository at Github. Contributions are more than welcome, both to the documentation and the code itself.

Give it a try!

Vantaan Ylästön koodikerho
Robot in action in Vantaa Ylästö schoold code club

Disclaimer: Code.org is a 501(c)(3) non-profit organization (“Code.org”) registered in the United States of America. This robot was not made by Code.org but independently by volunteers who use Code.org to teach programming to children.

Seuraa Koodikerhoa!