The Arduino range of open source robot controllers is taking the worlds of both hobby and serious robotics by storm. Compressed onto a board smaller than a deck of playing cards is a full 20MHz computer with enough I/O lines and RAM to keep anyone happy. Being open source, you can download the plans and build one yourself, but for a ridiculously small amount of money, you can simply buy one ready built and tested from any of a number of suppliers.
Massimo Banzi is a co-founder of Arduino and the author of Getting Started with Arduino. He has a refreshing approach I think is best summed up by the inclusion of the front cover of seminal fanzine “Sniffin’ Glue” and by the phrase “punk electronics.” This is an ethos to which I personally subscribe. Learn to take basic electrical precautions so you don’t burn out the chip and simply try things.
To this end, Massimo advocates simply getting a breadboard and some wires, cannibalising old consumer equipment for parts, and hooking them up to an Arduino board to make something unique. To help, this book is packed with the basics, such as how to make an LED flash, how to bias a passive sensor, how to drive a motor with a power transistor, and so on.
Seasoned hobby roboticists will feel this book is a little basic for them, and they’d be right. Look at the title again; it’s a getting started guide and it’s a very good one. It takes the novice from the ethos behind Arduino through installing the IDE software and creating simple circuits. For good measure there are several appendices covering reading resistor codes, the Arduino language and even how to read a schematic.
Throughout the book are plenty of hand drawn illustrations that remind me strongly of Tim Hunkin’s exceptional work on “The Secret Life Of Machines”. Everything is clear, readable and above all accessible in a way that really does live up to the promise plastered on the front of “Sniffin’ Glue” issue 1: “This is a chord. This is another. This is a third. Now form a band.” Substitute circuit for chord and “build a robot” for “form a band” and it’s possible to see that you don’t need a degree in electronics and you don’t need the resources of the Sony Aibo team to get started in robotics.
What are you waiting for?
17 December 2008
Book review: Getting Started with Arduino
12 December 2008
Getting started with Arduino...
I've just received a review copy of Massimo Banzi's new book, "Getting Started with Arduino". I'll review it properly in a later post, but from what I've seen so far, it looks like an excellent introduction to this fabulous piece of kit.
28 November 2008
Arduino pet robot head taking shape...
My ideas for an Arduino-based pet robot are slowly taking shape in spare minutes. I have a basic movement-based vision system up and running.
At the moment, it has basic (LDR-based) stereo light input, which feeds a weird real-time event integrator algorithm and some associated data structures - one per sensor. These feed a further algorithm which calculates the position data being sent to a servo upon which the two LDRs are mounted (revolving left and right in the the Y axis). The act of turning this "head" servo to indicate captured attention creates new input data itself, leading to complex feedback.
The whole thing is designed to produce nothing more controlled than emergent behaviour. For example, I never told it that if I sweep my hand in front of the sensors from left to right, the head should turn to follow it. Nor did I tell it that if I sweep my hand the other way the head should follow. For a laugh, I mounted the device in front of the computer's monitor, set the wallpaper to black and moved a small white window around. The head followed it, slowly losing interest when it stopped. I placed the device in front of a TV and let it track moving objects. It's weird to watch the head suddenly take an interest in things. At some point, I'll post a video.
The next phase is to add more LDRs to resolve movement in more detail, followed by a second servo to control the head's X axis (sothat it can look up and down), but already this project is getting very interesting.
13 November 2008
Servos...
How sad (by normal standards, anyway) is it that I am gradually falling in love with my Arduino Diecimila robot controller?
I now have 6 tiny little Ultrafly ST-9 micro-servos, which simply plug into the PMW sockets on the Arduino. The Arduino servo library then allows you to simply send an angle to each and the servo whirs into position. How much simpler could this be?
The more I investigate the online Arduino community and discover the strange and interesting libraries people have written, the more I realise that open source hardware is a viable alternative to closed source, propriatary kit. I've long believed that open source software has the potential to become a major force in computing, and to a very great extent that faith is paying off. How long before somoene decides to create a seriously powerful open source computer, I wonder, or even a cluster of them? I'm not holding my breath, but I don't think we'll have to wait an eternity for the first models to appear either.
8 November 2008
The Arduino Diecimila
Gadgets are guaranteed to give geeks a special tingly feeling, and robot controllers are a very special type of gadget. Was it William Morris who said that nothing useless can ever be truly beautiful? Whoever it was, he was spot on. By that definition, Robot controllers are immensely beautiful. What's more, they're not difficult to get into, and thanks to the open source hardware movement, they're an amazingly cheap method of making intelligent objects. Robot controllers typically contain tiny amounts of RAM, but because you're not fannying about trying to hoist a pointlessly resource hungry translucent user interface onto a graphics card that can outperform an 80's supercomputer, you don't need that much memory to do complex and genuinely cool things. Robot controllers also have plenty of input/output lines built in, waiting for you to poke the wires from sensors, buzzers, motors etc. into them to give your creation (whatever it is - and it doesn't have to be a robot) a sense of where it is, what's going on and how to control itself in the world. The rest is down to your creativity as a programmer.
I've just bought the Arduino Diecimila robot controller for just £17.60 from Cool Components. To the untrained eye, it looks like a very small and boring interface card for a PC. It's not. It's a full computer with some very special qualities. The chip at its heart is an Atmel Mega168, for instance. This is an industry standard microcontroller, which is basically a complete computer on a chip. It runs at 20MHz and, because it has a simple yet very comprehensive instruction set, it delivers a full 20 MIPS. The chip has 16K of non-volatile RAM on board to store its programs, 1K of volatile RAM to store variables while it's running, and 0.5K to store data when it's switched off. So, it can maintain a persistent state between battery changes - ideal for a robotic pet, wouldn't you say? but isn't the lack of RAM a problem?
No. Seriously. By programming like a real programmer, you can fit one hell of a lot of functionality into this beast. Think about it: you need to store a true/false (boolean) value, for example. Why would you need a 4-byte word to do that? Why not designate one byte to store 8 such booleans? See? Real programming; "tapping on tin" as they used to say is how it used to be done, before Windows came along and PCs became bloated playthings. Who actually needs an Intel Quad Core processor to read their email, for crying out loud?
Sorry, I got a bit ranty there. Anyway, by thinking like a proper programmer, the amount of "mind" you can squeeze into a microcontroller is phenomenal and the RAM seems huge. Want proof? Hundreds of millions of microcontrollers are used in car manufacture every year. They control everything from the dashboard to the injector system. They decide whether to deploy the air bags and tell the mechanic whether the wheels need balancing at service time. Your car may contain several dozen of them.
Everything about the Arduino Diecimila is open source, including the hardware. You can, if you wish, download the plans from the Arduino homepage, buy a Mega168 (they're around £3 retail!), a few resistors, capacitors and wires, solder the lot into a bit of veroboard, and hook it up to the serial port on your PC. You can program it directly from there using the free AVR Studio suite, which gives you the industry standard GCC C compiler, and a superb macro assembler if you want to get really code efficient. It also has a full simulator for a range of Atmel chips so you can test your code properly before squirting it onto the chip and watching it control your creation.
The Arduino Diecimila has 20 I/O lines. 6 can take analog inputs and convert them into 10-bit binary. 6 of the ports will do pulse width modulation, making them ideal for directly controlling servos. The others will accept things like infra-red diodes and photo-resistors directly, and have such high impedence, touching the end of a wire connected to them will cause the input to go high (ideal for touch sensors).
What's more, the Arduino Diecimila has a USB interface. This is used to program it, but there's also a library enabling you to write from the unit to a USB pen storage device. Is that enough non-volatile RAM for you?
So, what can you do with a robot controller? Well, the obvious thing is to make a robot, but there are plenty of other possibilities. I'm interested in making what I call an intelligent object; one that reacts intelligently to it's surroundings and to your interaction with it - a digital pet that goes WAY beyond the idea of a Tamagotchi, for want of a better phrase. One that learns from physical interaction. So far, the design can see light and infra red, it has a basic sense of touch, it can sense its orientation (and any movement), and hear basic sounds. It has light, sound and vibration as outputs at the moment and there are plans to give it a small LCD screen. It doesn't even move yet under its own steam, but the plan is to mount the sensors on a kind of "head" that sits atop a servo motor so that it can turn.
I'll be posting the results of my experiments over the coming months, and hopefully I'll have something basic running to show you soon. It's a big project and something I've never contemplated before, but I'm not doing it because it's easy. J.B Priestly once said that the secret to happiness is to be busy with unimportant things. I'm beginning to see what he meant.
P.S: I have no idea why the formatting of this post is different. I've tried everything. Sod it. Life's too short.