|
|
Subscribe / Log in / New account

Hardware Fun with the Arduino board

Several weeks ago, your author took a look at the SquidBee project, which involves making a wireless remote sensor network from building blocks made of open-hardware components. At the heart of each of the SquidBee nodes is an Atmel AVR 8 bit RISC microprocessor, which sits on an Arduino Diecimila circuit board. This week, we'll take a look at the Arduino project:

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be stand-alone or they can communicate with software on running on a computer (e.g. Flash, Processing, MaxMSP).

[Arduino Diecimila]

AVR chips programmed with the Arduino on-board library software are available in a number of different hardware configurations. The Arduino Diecimila board is the one of the more popular variations, it features a USB host connection which provides power and allows for software downloads. The Diecimila name comes from the fact that 10,000 Arduino boards have been sold, making is a fairly popular development platform. Arduino Diecimila boards are available from a number of vendors for around $35. The board was purchased online and arrived in the mail several days later.

In addition to the basic processor board, there are numerous open-design shield boards available. Shield board functions that are currently available include: motor control, biosensor interface, prototyping, XBee interface, Phidget sensor interface, and potentiometer interface. Upcoming shield boards include: sensor amplifier, external memory, external display controller, Bluetooth interface and multi-sensor interface.

To work with the Arduino board, it is necessary to install some software on a host machine. Your author used his main Athlon 64 which runs Ubuntu 7.04. There is a special Ubuntu installation document that walks the user through the package installation (and removal) steps, and explains the software setup procedure.

Running the Arduino IDE was a simple matter of typing ./arduino on the command line, which caused the IDE window to pop up. The IDE defaulted to the Diecimila board type, it was necessary to define the USB connection in the Tools/Serial Port pulldown. The first attempt at running an LED blinker test program resulted in a bit of operator confusion. The board is apparently shipped with this particular software example installed, so installing the same test software does not change the appearance of the already blinking LED.

The Blinker software was pulled into the IDE with the File->Sketchbook->Examples->Digital->Blink menu sequence. The software was built with no trouble using the Verify button and copied to the board using the Upload button. The LED started blinking again. Tweaking the delay times in the example code, then building and uploading the changed code verified that indeed, changes were being sent to the board. There is another slightly confusing interface aspect to the IDE, there are tape recorder style run/stop buttons at the top of the screen, but the run button is really the Verify (compile) function and the Stop button didn't seem to stop the running code.

The software that the Arduino board runs is written in the Arduino programming language, which looks a lot like C/C++ and is based on the wiring language. Making a few changes to the blinking LED example was so intuitive that it was not even necessary to consult the documentation. The Button example was also tried, digital input to the board worked as advertized.

Further testing of the I/O functions of the Arduino Diecimila board will require some hardware construction, which is beyond the scope of this (first) article. Your author has been building simple and complicated microcontroller projects for a number of decades; his initial impression of Arduino is that it has a very quick learning curve and provides a lot of powerful features. The Atmel AVR microcontroller provides a lot of useful I/O functionality and enough memory to build many interesting devices.

If you are looking for a convenient way to design a microcontroller based hardware project, extend the I/O capabilities of your desktop system, or just play with some cool hardware, Arduino is a quick and easy way to get started.



to post comments

Hardware Fun with the Arduino board

Posted Dec 20, 2007 10:47 UTC (Thu) by Tracey (guest, #30515) [Link]

A month or two ago I started playing with the arduino.

I managed to get the arduino environment working on my local desktop, running a 64bit Fedora
7.  I installed the 32 bit version of Sun's Java somewhat the same way as was published under
the arduino documentation for Fedora installations.

It was a lot of fun finding all of the various articles published about the arduino and the
Atmel AVR.  I then managed to put together a parallel port programer so that I could burn the
chip used in the arduino from scratch.  Along the way I set up KontrollerLab on the machine,
and also learned how the use avrdude from the command line.

What are sensor networks good for?

Posted Dec 20, 2007 18:42 UTC (Thu) by kbob (guest, #1770) [Link] (4 responses)

My imagination is failing me.  What are people using sensor networks for?  I try to think of
things I want to sense but draw a blank.

Thanks.

For fun and anything that doesn't exists.

Posted Dec 22, 2007 9:48 UTC (Sat) by amartoq (guest, #1712) [Link] (1 responses)

I am in the process of a home-made MIDI pedal for controlling in a different way my PODXTLive
[1] device and a "teleprompter" software that jumps the lyrics in my notebook screen. The
lyrics software [3] is being used for practice and even live (at least once), because all
members of my band have little time to memorize lyrics and even the chords of the songs! It
allow us to play any song we got in the computer (and the public ask to play) even if we never
played it before...

So, the MIDI pedal will make all this song/lyrics/effects transitions very easy... Of course,
I could buy a real MIDI controller like the behringer fcb1010 [2]; but is much more fun to do
it yourself, besides that there is no existing software that do what I'm doing and pretending
to do in the near future: controlling current song, lyrics, channel POD setup and even some
chopters and background sound tracks we use on some songs.

I'm using PIC18F4550 from Microchip, those are not linux-friendly like the AVR, but something
is available[4].

[1] http://line6.com/podxtlive/
[2] http://www.behringer.com/FCB1010/
[3] No link yet, I'll release the software once I get version 0.3 ready (Version 0.1 was a 1
hour python programming session that just displayed lyrics, Version 0.2 was a 1 week python
programming that supported a list of songs and change to prev/next)
[4] http://www.yty.net/pic/enindex.html

For fun and anything that doesn't exists.

Posted Dec 22, 2007 12:45 UTC (Sat) by i3839 (guest, #31386) [Link]

You could give SDCC a try, it should support the PIC18F4550:
http://sdcc.sourceforge.net/

What are sensor networks good for?

Posted Jan 4, 2008 5:03 UTC (Fri) by HalfMoon (guest, #3211) [Link] (1 responses)

Classic examples of sensor nets include factories and warehouses. If you can just stick wireless sensors in place and let them self-organize a network, that's cheaper than wiring the place up ... and easier to repair, too, when a forklift accident damages something. (People being much harder to repair!)

My favorite example is ecological though. Small cheap sensors are spread throughout a forest ... at lots of different altitudes. You can study not just microclimates, but nanoclimates, and their relationships to forest health.

What are sensor networks good for?

Posted Jan 12, 2008 0:35 UTC (Sat) by nix (subscriber, #2304) [Link]

As a random aside, Vernor Vinge's _A Deepness in the Sky_ has a distant 
descendant of sensor networks (`localizers') play a significant part in 
the plot.

(But then Vinge *is* an ex-CS prof who writes his books in Emacs, so I 
guess it's not unusual that he knew about this sort of thing years before 
the rest of us spotted it... of course he's inspired the name of at least 
one program as well, GNU Mailman. Thankfully this one is rather less 
malevolent than Vinge's.)

Hardware Fun with the Arduino board

Posted Dec 20, 2007 22:46 UTC (Thu) by Quazatron (guest, #4368) [Link] (1 responses)

Arduinos are great. I bought a Boarduino from Adafruit (http://www.adafruit.com) and had a lot
of fun putting it together. It was the first PCB I ever soldered and it was so easy even I
could do it.
The code is very straightforward, it reminded me of the times I spent hacking away at my ZX
Spectrum's Z80 processor, you have complete control of the bare metal (minus the touchy power
supply and the tape loading errors).
The Arduino gives you a way to have your code interact with the Real World, by using sensors
or driving motors. I must admit I only did a couple of projects with it (a 5 LED PoV display
and playing Jingle Bells through a speaker), because Real Work seems to get in the way...

Freeduino!!

Posted Jan 4, 2008 5:51 UTC (Fri) by HalfMoon (guest, #3211) [Link]

For that matter, you can just use avr-gcc and avrdude instead of the Arduino software environment. It's a completely reasonable AVR platform; comes with an ATmega168, soon upgradable to ATmega328p (32 KBytes flash for code). You can put your own RTOS on (I kind of like AvrX, under 2 KBytes) but it's just as easy to use "raw" unless you really need task switching. In case you've not used AVR micros before: you can fit a lot of code in just few KBytes. I often haven't neded even 4 KBytes...

Worth mentioning also is the www.Freeduino.org umbrella effort, the same idea (and default firmware!) as Arduino but cheaper and not constrained by the Arduino trademark. I like the moderndevice.com BBB; it's easy to breadboard with, and the reusable usb-serial cable is nice. ISTR it's the original idea from which Boarduino (one flavor of Freduino) and RBBB evolved. BBB hooks up directly to the power rails, and takes up less breadboard space. (Leaving more for me, w00t!)

If any of that interests you, one more tidbit: Atmel's AVR Dragon is essentially a $50 JTAG programmer/debugger you can use with the 6-pin ICSP connector. Debugging only from MS-Windows though (sigh); but programming works with avrdude from Linux. In any case, it's really hard to beat the bang-for-buck of these boards if you want a good place to start!

author?

Posted Dec 30, 2007 9:48 UTC (Sun) by astrophoenix (guest, #13528) [Link] (1 responses)

hey, who wrote this article?

author?

Posted Jan 2, 2008 17:15 UTC (Wed) by cook (subscriber, #4) [Link]

>hey, who wrote this article?

I wrote it but forgot to attribute it to myself. Here's a little Arduino script that improves on the basic blink application, I expect to do more serious projects with this cool device.

/*
 * Blink2
 * based on the blink example:
 * http://www.arduino.cc/en/Tutorial/Blink
 * Now the LED blink rate changes from fast to slow and back.
 */

int ledPin = 13;                // LED connected to digital pin 13
int dtime = 40;
int flip = 0;

void setup()                    // run once, when the sketch starts
{
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
}

void loop()                     // run over and over again
{
  if (flip == 0)
  {
    oneblink();
    dtime += 10;
    if (dtime >= 180)
     flip = 1;
  }
  else
  {
    oneblink();
    dtime -= 10;
    if (dtime <= 40)
     flip = 0;
  }
}

void oneblink()
{
  digitalWrite(ledPin, HIGH);
  delay(dtime);
  digitalWrite(ledPin, LOW);
  delay(dtime);
}

Hardware Fun with the Arduino board

Posted Apr 24, 2008 20:51 UTC (Thu) by rolandl (guest, #51757) [Link]

I suggest you load your (first) Diecimila with Simple Message System
from the archives at arduino.cc. Then download my script package from
my mini-website, http://207.14.167.161. It's called SMS1.tgz. This
package provides full control of the hardware with shell scripts:
writePin-1,writePWM-1, readAD-1, readIO-1, and more. AD is scaled to
milliVolts and formatted for import to most spreadsheets. Sorry, my
mini-website isn't 24/7, it only works when my PC is booted, so keep
trying. Package is modular: need more pins? Plug in another SMS-loaded
Diecimila!

This turns the unit into a general-purpose linux-based control unit.
Includes hints on controlling servos and the like. You'll want to keep
the SMS-loaded unit around during development of other projects. Suppose
you need to calibrate a sensor--how do you do that? These scripts make
it easy. Want a light-show? Put commands in a textfile and 'source' it.

Hardware Fun with the Arduino board

Posted Jul 19, 2008 1:37 UTC (Sat) by rolandl (guest, #51757) [Link]

I have updated the above-mentioned script package with IO-GUI and PWM-GUI 
shell scripts, both based on Xdialog. Now available 24/7 via:
    'wget http://user.cavenet.com/rolandl/SMS1.tgz'
Includes instructions for getting Xdialog for Debian/*buntu.


Copyright © 2007, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds