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.

Wednesday 30 December 2015

RELOADED: Graphical Programming the Arduino

Makeblock (http://makeblock.cc) introduced with mBlock  a new kid on the block (nice pun...) when it comes to graphical programming the Arduino.

The features of Scratch, Ardublock, mBlock and Minibloq are shortly described and compared in the following blog: http://www.makeblock.cc/showcase/graphical-programming-software-comparison/

And by the way: The Ardublock website has moved to http://ardublock.heqichen.cn/blog/en/ - repositories can be found:
Please make sure you are really using the right version for your purpose. But once installed it just works like charm...

 

Wednesday 19 February 2014

Controlling an Arduino by S4A using Bluetooth

Connecting the ITeaduino BT seems quite straight forward:
  1. configure Bluetooth transceiver on ITeaduino BT
  2. ensure Bluetooth on the connecting computer (i.e. laptop in our case) is configured correctly
  3. initiate Bluetooth device pairing between computer and ITeaduino BT
  4. configure S4A properly
  5. test connection running a program - e.g. make LED blink on Arduino's D13
But as always: The devil's in details

The following links prooved helpful to me:

 1. Configure Bluetooth transceiver on ITeaduino BT

After having tested the ITeaduino BT working in "normal" cable connection, I started configuring its Bluetooth transceiver. As described in Benjamin Bellamy's blog I set the Arduino clone to transceiver programming mode. How to configure the used HC-05 module can be found on the first link provided above.
In configuring the transceiver module I used the parameters given in ITead Studio's blog:
  • AT+ORGL (Restore the default state)
  • AT+ROLE=0 (Configure the HC-05 as slave)
  • AT+POLAR=1,0 (The LED will on when the output of PIO8 is high. And it indicates connecting successfully when the output of PIO9 is low.)
  • AT+UART=57600,0,0 (Set baud rate to 57600, one stop bit and no parity bit)
  • AT+INIT (Initializing SPP library)
As a terminal program I used AccessPort - but it should also work with the Arduino SerialMonitor, which I ruled out as it is by far not as comfortable as AccessPort.

N.B. I'm using the Arduino 1.5.4 r2 development tool - but I have NOT exchanged the “rxtxserial.dll” file as suggested. If I'm remembering correctly, I ran into problems with doing that...

I've also played with adding the the 1uF capacitor to the ITeaduino BT as described - but finally removed it again as I didn't want to programm the Arduino via Bluetooth (YES, this really works!!!)

2. Configure Bluetooth on the connecting computer

This seems to be a no-brainer. But with me it turned out to be a bit of a challenge to get the correct Bluetooth driver for Windows 8. Make sure it works correctly with another device e.g. a smartphone. And... at least for me, this took a considerable amount of time...

3. Initiate Bluetooth device pairing

 This is really straight forward: initiate Bluetooth pairing as described in ITead Studio's blog or as you're used with any other device. Don't forget the virtual serial port you're using for your Arduino...

4. Configure S4A properly

Using S4A 1.5 you have to program your Arduino with thw according firmware (S4AFirmware15.ino). To be shure, you should do this the "normal" way with an USB cable. Once downloaded to the Arduino I encountered S4A couldn't detect the Arduino, on the serial monitor you could see the Arduino send some gibberish.
A crosscheck with the S4A firmware helped on: at the very beginning of this sketch a data rate of 38400 baud is configured, whereas I've set the Arduino's Bluetooth transceiver to 57600 baud (see above). I decided to change the baud rate in the S4A firmware sketch instead of reprogramming the Bluetooth transceiver. And - heureka - S4A detects the ITeaduino BT via Bluetooth.

5. Test your connection from S4A

Once S4A detects your Arduino clone, you'll find it is working properly with your first Scratch program...

Mission accomplished.

Monday 17 February 2014

Alive - Lego Robot on the Run

The most important message at the very beginning: This project is very alive - even without me finding time to blog...

My son is really happy programming his Arduino (in fact an Arduinio clone: ITeaduino BT as described in my blog from October 2013) with S4A.

At the very beginning, he worked through the excellent documentation Elisava Workshop Materials 2011 provided from Citilab. This gave him the knowledge and the confidence to start setting up his "ArduBot" entirely built from the LEGO Technic set 9390 and some special parts, I've already described.

ArduBot - from the side
A permanent bluetooth connection allows "remote controlling" of the robot's actuators and sensors with S4A. This really works fine - and I really dont understand, why this way of connecting to an Arduino is not much more widespread.
Modified microservos to act as continuous rotation servos move ArduBot, IR sensors prevent it from collisions, whereas an ultrasonic sensor (like the famous PING!) provide a long distance detection of obstacles (not mounted on the picture above) and small IR sensors allow the implementation of a "line follower".

ArduBot - from front angle
What we learnt from the modification of our microservos is a different story, enough to fill another blog as well as construction details of our new tech toy...




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.