Parallax’s Basic Stamp is the mainstay for hobbyists wanting to add intelligence to everyday devices. A new system called Arduino provides the benefits of the Basic Stamp at a greatly reduced cost, increased speed, and is entirely open-source.
A Little Background
Tiny computers surround your life. In your coffee maker, remote control, vacuum cleaner, telephone, and clock radio, these little computers (aka microcontrollers) are getting smarter and cheaper and becoming more pervasive every day. They can be had for less than a dollar. And you can program them as easy as you can write a web page.
To program microcontrollers in the old days (i.e. a few decades ago), the requirements were an expensive development environment costing thousands of dollars and a professional electrical engineer. In the early 1990s, Parallax had the idea of embedding a simple BASIC interpreter on a microcontroller, mounting it on an stamp-sized module, and providing lots of add-on devices, excellent documentation, and example circuits and code. The friendly Basic Stamp created a whole new market of hobbyist-oriented microcontroller devices and the standard by which other such devices are judged.
The reasons why the Basic Stamp was a hit are obvious in retrospect. BASIC is an easy computer language to pick up. People without knowledge of computer programming can pick it up quickly. Parallax’s wonderful examples showed how with just a handful of extra parts and a few lines of code you could create all manner of smart objects. In an afternoon you could create your own robots, games, data collectors and toys. In the process you’d learn about microcontroller techniques.
Basic Stamp Issues
The Basic Stamp does have a few downsides:
- Expensive — The Stamp itself is $50 and to program it you really need a development board for another $70. Even without the dev board, a $50 part makes you reluctant to use one for every room of the house, let alone for every appliance in your house.
- Slow — The Basic Stamp re-interprets your BASIC program each time it’s run, placing a limit on the fastest it can do things. Time-critical are beyond its capability.
- Low Memory — There’s not much room in a Basic Stamp for anything but simple programs.
- Closed — If you want to modify the BASIC interpreter in the Stamp to add new commands or remove the ones you don’t use, or even learn how it works, you’re out of luck. It’s closed nature meant for the longest time only Windows PCs could program Basic Stamps.
Enter Arduino
Arduino solves most of the above issues with the Basic Stamp. The most noticable is cost:
Getting to the “Hello World” of microcontroller projects, the blinking LED, on Arduino costs $32 compared to the $119 for a Basic Stamp. This is perhaps a little unfair because the Basic Stamp board contains a full bread-boarding space. A similar setup for Arduino would cost about $60, still a 2x savings (and can made cheaper if you want). A more telling cost comparison is the “consumable” cost. If you accidentially blow out the chip on each board how much does it cost to replace it:
The standard Atmel AVR ATmega8 chip used on the Arduino board can be obtained for less than $4. The Basic Stamp must be obtained from Parallax and costs $50.
This order-of-magnitude cost reduction opens up entirely new avenues for embedding intelligence. Where before it would be economically infeasible to have a 100-Basic Stamp project, with Arduino and an AVR programmer like the $34 AVR-ISP, you can program as many ATmega8 chips to work with Arduino as you like.
What is Arduino
Arduino is two things:
- A software programming environment, with a GUI and style based off
of Processing, and a packaging of AVR GCC, AVR LIBC, and AVRlib. In many ways the Arduino environment is like WinAVR, but cross-platform. - A hardware board, based on an Atmel AVR processor, arranged in a standardized way. Arduino isn’t restricted to just this board however, and many Arduino-compatible boards have been created
Like the Basic Stamp, Arduino solves in a simple, elegant way the usual difficult problems of microcontroller programming (setting up a working board, talking to the board, making compilable code) With a Arduino board, doing a blinky light “hello world” takes less than 5 minutes. For example, below is the same functioning code for Basic Stamp and Arduino.
Basic Stamp | Arduino |
---|---|
'{$STAMP BS2} '{$PBASIC 2.5} OUTPUT 14 DO HIGH 14 PAUSE 1000 LOW 14 PAUSE 1000 LOOP |
int ledPin = 13; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, HIGH); delay(1000); digitalWrite(ledPin, LOW); delay(1000); } |
The differences are minimal. However unlike the Basic Stamp, with Arduino you can use real GCC C code to implement your algorithms and access all the hardware of the AVR chip.
Go Forth and Hackify
Try out Arduino. Go to SparkFun.com and buy an Arduino board, then download the software and start playing. Check out the many examples or visit the playground to see how people are hooking up their Arduinos to the world.
Note the above thoughts are not unique to me. Several others have made similar observations. Tom Igoe of ITP, especially, gave a much more detailed analysis at the Sketching in Hardware ’06 conference.
Thanks!
One of the big benefits of Arduino is that it’s open-source and cross-platform: Linux, Mac OS X, and Windows.
Also, you can do most of what AVRStudio does using the open-source command-line components that Arduino uses to compile your code (avr-gcc & avr-libc) and program your chips (avrdude).
Thank you for the quick reply :)
It clears things out a lot to me.
I think I’m gonna go for both (plus a breadboard and other paraphernalia). Sad thing though that AVRStudio is a windows only application. I hope that we’ll soon see a linux version (or an open source clone).
Btw, great blog. Keep on good work.
Hi newbie,
As for (1), the official Atmel programmer boards like the STK500 aren’t that much more expensive, like $75 or so, so you can get both an Arduino and an STK500. :) The Arduino only works with ATmega8 and ATmega168 chips, so if you want to work with other AVR devices, you’ll need to wire up your own circuit or use something like an STK500.
As for (2), it depends on what you mean by debugging. Most AVR chips support a thing called debugWire, which is lets you step through code running on a chip via a single wire connected to the RESET pin. The more advanced AVR chips support industry standard JTAG debugging. In both cases, you use the Windows-only AVRStudio to run the debugger.
In general though for Arduino debugging, most code is small enough that people just put in appropriate print() statements or blink LEDs to indicate various code paths or conditions. For higher-speed debugging, it’s common to toggle a pin and look at the timing of that pin’s oscillations on an oscilloscope.
Most people using Arduino don’t use real debuggers as the code is small enough to understand by inspection or simple print statements. Think back to when you first started programming and all the programs were a page in size. It was easier to just try the program out and see what happens than get a debugger involved.
That’s the way Arduino is, just try things out!
Hi todbot,
I’m quite new to the embedded world (OK, better consider me a total newbie). I’m thinking about Arduino as a starter kit (basic reasons are it’s price and open source nature, linux environment). Yet, there are some questions:
1. In what cases can this board suffice instead of a (much more expensive) ATMEL programmer board?
2. Are there any sort of debugging tools in there?
Thanks in advance.
Hi brucee,
I’ve long wanted to get into ARM systems, and the Cordium boards you link to could be a good way. I am a bit put off by their site though, being so Windows-centric. I’ve heard folks programming ARM with GCC, and it looks like Cordium is just using GCC for their compiler, so maybe truly cross-platform development is possible.
I could totally see the Arduino aesthetic extending to more larger microcontroller architectures like the ARM. But like some of the more advanced Arduino boards (like the Arduino BT), the cheapest ARM board are relatively expensive and if you blow the controller, you’re out of $40. I wish Cordium’s Stamp-like module was about $20 cheaper or I’d be all over it in a heartbeat.
The ARM line should be considered now, with single unit prices of $5, and a fast 32bit architecture, and built in A/D converters. They offer a much wider range of memory (upto 512K Flash and 64K RAM).
A single board is available starting at $40 with pre-configured BASIC or C compilers.
Hi you All,
We need 14 to 16 bit ADC and DAC, 2X16 LCD, hardware and software for my Arduino brd.
Thank you
Joe
Check out Bare-bones Arduino kits for $15 (qt 1) or Arduino boards and chips to build your own at moderndevice.com.
Open source hardware and software make Arduino a great option.
Paul
Basic programmable micro controllers predate the basic stamp.
First to come to mind is the intel 8052AH basic chip which was released in 1980.
Not as cheap as basic stamps but they are much more powerful then a stamp you can add memory up to 64K.
Programming only took a terminal emulator program and text editor or even just a dumb serial terminal.
The family is still in use and is known as the MSC-51 family the atmel 89X mcs-51 chips are fairly cheap and the basic interpeter has been released as freeware.
use a friggen PIC, jeez.
Just to clarify, you don’t need a programmer ($0.79 or otherwise) to program an Arduino board. You use the Arduino software on your computer to program the Arduino board over its USB connection.
However, if you’d like to create new Arduino boards yourself, you’ll need some sort of programmer for AVR chips. The Atmel STK500 or AVR-ISP are both good choices because of the wide support and USB-compatibility. The “$0.79” programmer requires a parallel port on your computer, which increasingly fewer computers have.
and as soon as I typed that last comment I realized I wasn’t on the official arduino homepage and when I went there, I found it…doh!
I read on makezine’s blog that there are schematics for a “$0.79” programmer and I THINK it was supposed to be on this site but I’m having probs finding it. Any help?
llaurén, you don’t *need* an Arduino board to use the AVR microcontroller. Similarly, you don’t need to use the Arduino software to program an AVR chip. Before I used Arduino, I built up my own AVR circuits, wrote C code using emacs and command-line tools, and programmed them with either the STK500 or AVRISP programmers. But the Arduino environment (both the software and the hardware) is a nice environment that encapsulates a lot of knowledge. In that way it’s very similar to the Basic Stamp: you *could* wire up your own PIC microcontroller and program it using a BASIC compiler, or you could just use the Stamp.
I’ve got a few standalone AVR chips that I’ve programmed with the Arduino bootloader. I stick them into an Arduino board to program them then push them into a breadboard to use by themselves. But usually if I’m getting that serious, I’ll go a little further and program the chip with an ISP programmer. For me, Arduino’s about trying out an idea quickly, without having to wire up a bunch of circuitry.
Righty, so what i’m not getting is whether i *need* the thirty buck board to run the four buck microcontroller or if i can make my own from, say, breadboard? That’s what makes PicAXE so beautiful: those small beauties (which cost between two and six bucks need almost no peripherials to operate. There’s even a healthy competition between PicAXE hackers on who can bend the most impressive stuff into a single film canister (remember those? :)
~rL