Short Project Description


Short Project Description


The concept of graphical programming enables teenagers and even younger children with creative access to computers. Scratch, a project of the Lifelong Kindergarten Group at the MIT Media Lab, provides not only the tool, but creates also a very inspiring environment for children, teachers and parents alike.
But sometimes creativity goes beyond creating "only" a program - physical interaction, tangible results become essential.

On the other hand, the Arduino project is quite famous and I'm impressed how well documented these microcontroller boards are, how easy they are to come by and how many slightly modified clones are around - all of them (Arduinos and clones) with a reasonable price tag. So it seems a good idea bringing Scratch and Arduino together.

This blog describes the advances step by step of setting up a robot controlled by an Arduino and easily programmed through a graphical enviroment. This project might be interesting to hobbyists, teachers, educators and parents (like me).

To allow for a maximum of creativity and flexibility the robot will use LEGO Technic / Education as the mechanical robotics platform.

Sunday 13 October 2013

Getting things started

Enough of grey theory! As the birthday of my son drew nearer, it was due time to get a move on. So I ordered necessary parts to implement an Arduino controlled LEGO Technic /  Education robot programmed with S4A for the sake of easy installation combined with a workshop materials well thought through.

Here's my shopping list for anyone who wants to tackle a similar project:
  1. First the heart of the robot: I ordered the ITeaduino BT to take advantage of directly attaching analogue and ditigal sensors to the electronic brick compatible connectors as well as to connect wirelessly to the Arduino clone via Blueetooth
  2. A small size breadboard and an Arduino + breadboard holder for desktop experimenting, an additional mini breadboard to mount directly to the robot, jumper wires, a battery case + rechargable NiMH batteries (6xAA) to provide power for a wireless robot and some electronic parts for first steps into "physical" computing
    • 3 red LEDs, 3 yellow LEDs and 3 green ones
    • 1 RGB LED
    • 10 resistors 220 Ohm
    • 5 resistors 10 kOhm
    • 1 potentiometer 4,7 kOhm lin.
    • 1 LDR (light dependent resistor) 5 kOhm (@1000 lx)
    • 3 push buttons
    • 1 shift register (SIPO) 74HC595
  3. To provide "real world" feedback I decided to order different distance sensors:
  4. As mechanical components a LEGO Eduction set 9632 and a LEGO Technic set 9390 are already available plus some other LEGO Technic parts of unknown provenience.To provide a "case" for the Arduino, an integration of servo motors as previously described and gears, I ordered some additional parts directly from LEGO
    • 4 Flat Panels - LEGO part no. 4621555
    • 4 Beam R. Frame 5X11 Ø4.85 - LEGO part no. 4540797
    • 4 Beam Frame 5X7 Ø 4.85 - LEGO part no. 4539880
    • 4 Gear Wheel T=24 - LEGO part no. 4211565
    • 4 Double Conical Wheel Z36 - LEGO part no. 4255563
    • 20 Connector Peg w. Friction - LEGO part no. 4121715

  5. Originally I thaught a standard servo would fit for integration into the LEGO rectangular frame (#4540797), but as the servo's axis has to fit into LEGO's grid dimension, I couldn't find a standard servo fulfilling this boundary condition. So I decided to go for mini servo fitted with an insert into this frame. To provide continuous rotation this type of servo motor has to be "hacked" as described several times on the internet; any particularities hacking this specimen I will describe in a later posting.

All in all, this list adds up to about 130 EUR - including delivery costs.

Monday 23 September 2013

The Robotics Platform

The mechanical setup of an Arduino controlled roboter can be done in uncountable ways. In the following I will describe some approaches I investigated in more detail.
  • Based on the well known BOE-Bot, the PARALLAX Robotics Shield Kit presents a kind of "turnkey" kit for an Arduino to move around by itself.
  • Robotics can be as simple as described in WirMachenRoboter.com (the German version of Let's make robots).
  • Following the path using LEGO Technic / Education as a mechanical robotics platform the use of a LEGO Technic kit (mini tow-truck - LEGO 9390) as a mechnical robotics platform is shown in Robot Arduino with several examples.
In my opinion, the only disadvantage of the latter is the very unprotected mounting of the electronics parts. But as LEGO provides the possibility of ordering single bricks, you can easily use special bricks (in this case special beams) to create a protective housing for your Arduino.
With special beam part # 4621555 I found something best described as a flat plate, 5 x 11 holes in extend, two of them can form a mounting plate 10 x 11 holes (7.9cm x 8.6cm) wide, a second set of them a cover. Part # 4540797 is a ladder shaped structure - also 5 x 11 holes (3.9cm x 8.6cm) wide - ideal to form the sides of a housing.



Browsing through LEGO's special beams I also stumbled over part # 4539880 - a rectangular shaped beam which could be used as a mounting frame to servos as its inner spacing of 3 x 5 holes (2.6cm x 4.1cm) fits in length just to standard servos.

Sunday 22 September 2013

The (electronic) Hardware

The open source hardware prototyping platform Arduino has been described in comprehensive ways. So the question boils down to which Arduino platform to use, and are there any clones around, offering something special?
Besides the fact, the platform should be supported by the programming environment concerning the envisaged project, my son has raised one major requirement: A robot controlled by cable is so uncool...
As Scratch based programming controls the Arduino from a computer (PC / laptop), a permanent link is mandatory. Looking for a permanent connection to embeded systems you come across the XBee standard implementing IEEE 802.4.15 protocol. This seems to work, but presents a rather high priced solution - especially as some of the standard's core features are not mandatory to this project. But how about using the well established Bluetooth standard?
In fact - if you dig deeper - there are Arduino shields around promising this kind of functionality. And - even better - there is at least one Arduino clone implementing wireless programming via Bluetooth: ITead Studio's Iteaduino BT.
In addition Iteaduino series boards come with extra electronic brick interface compatible connectors which allow direct connection of servos to the board as well as sensors with 3 pin jumper wires.

Sunday 15 September 2013

Graphical Programming the Arduino

Browsing the internet you'll find several possibilities using Scratch or programming environments following similar approaches to interface microcontrollers.
This list makes no claim to be complete - I would be very happy finding out more possibilites...

Scratch and BYOB/Snap!

All Scratch versions and BYOB/Snap! do not program the Arduino directly but use it as a sensor and control extension. This is realised with a kind of "listener" program that has to be downloaded to the Arduino; the computer running Scratch controls the remotely connected Arduino through a permanent connection. Thus a standalone operation of the Arduino is not possible with Scratch or BYOB/Snap!.

 

Scratch 2.0

Scratch 2.0 can be extendend as described in http://scratch.mit.edu/discuss/topic/13740/ and https://github.com/MrYsLab/S2A . This project was recently updated from a CodeShield extension to a direct Arduino extension (both codes can be found on this github repository) and Alan Yorinks has done an amazing job - not to forget the excellent documentation.
The described concept using an Arduino JSON client presents in my opinion a very clean approach, as well as the rest of the employed software stack. 

 

BYOB/Snap!

BYOB/Snap! implements interesting programming concepts and adopts the underlying principles of Scratch at the same time; it seems to support older learners (14-20) by adding named procedures (thus recursion), procedures as data (thus higher order functions) structured lists, and sprites as first class objects with inheritance.
To my knowledge interfaching with the Arduino platform is not directly supported, whereas at least some extensions exist (e.g. LEGO NXT, Parallax S2) which should allow to create a connection to the Arduino world with reasonable effort.

 

S4A - Scratch for Arduino

S4A was developped to use the built in PicoBoard protocol of Scratch 1.4. It seems it comes as a kind of "turnkey" solution for controlling an Arduino with Scratch. The available output and input channels as well as their assigned purpose (motors, servos, sensors) might be regarded as a slight disadvantage. IMHO this is more than compensated through the available workshop materials providing an easy access to the use and control of Arduino's possibilities. For my impression a good starting point.

Minibloq

Minibloq is designed to provide a graphical programming environment for physical computing and robots. From my opinion the approach is not as stringent as it is implemented in Scratch, but it shows graphical programming and conventional text based program code in parallel, and hence might facilitate the transition.
Minibloq is a sister project of Multiplo, an open source physical computing / robotics platform. 

Modkit

Modkit seems not to be a public available programming tool as it requires a 50$/year membership with the "Alpha Club". From the impression you get from the website, it might be worth the invest....

ArduBlock

The concept of ArduBlock seems to enable the programmer creating sketches through graphical elements, thus provides the possibillity for standalone Arduino operation.
On first sight it allows to lower the hurdle for unexperiences programmers in directly accessing all features of the Arduino. Probably not my first choice for my son, but I will surely follow the evolution of this project as it might present a second or third step towards "normal" (text based) programming.

Saturday 14 September 2013

Where it all begins

Kids are getting older and more ambitious. So, no wonder, my son after gaining some experience in programming with Scratch wants to get physical. For his upcoming birthday a programmable robot is THE number one on his whishlist.
 
To make a long story short, it all boils down to a robot which could be controlled by Scratch or any other graphical programming language with a similar concept. A potential platform would be LEGO Mindstorms NXT / EV3 which also gives the possibility to create a myriad of different robots - most exciting! But as the target groups of these sets are educational institutions they definitely exceed a birthday's budget, even with all grandparents and parents joining forces. And to my opinion they are too "ready made" - you can't see the underlying technology and thus you don't get a feeling how to realise projects in the "real world".
On the other hand, the Arduino project is quite famous and I'm impressed how well documented these microcontroller boards are, how easy they are to come by and how many slightly modified clones are around - all of them (Arduinos and clones) with a reasonable price tag. So it seems a good idea bringing Scratch and Arduino together.

This Blog will deal with the advances to create a robot controlled by an Arduino, graphically programmed and - when possible - taking on the idea to use LEGO as the mechanical robotics platform.