Arduino

modified on 1 April 2010 at 20:52 - 2,114 views

From RoboWiki

Jump to: navigation, search

The Arduino is an open-source and open-hardware Microcontroller. This means that both the hardware design and software tools are free to obtain, modify, use, and redistribute. Because of this, Arduinos may be purchased from many vendors for a very reasonable price. Many different versions of the Arduino exist for various applications, but the club primarily works with the Arduino Diecimila or its newer counterpart Arduino Duemilanove. The Arduino's simple programming interface makes it an easy to learn tool for beginners, but the its flexibility also makes a powerful platform for experienced users. The Arduino is also cheaper than many of its counterparts ($30 vs. the BASIC stamp board: $100), making it an excellent resource for the club.

The Arduino Diecimila and the first run of the Duemilanove uses at its core the ATmega168 microcontroller, but the newer Duemilanove's use the ATmega328 microcontroller, which has more memory. Arduino provides an IDE (Integrated Development Environment) written in Java that works on all major operating systems (Windows, OSX, Linux/Unix), which is responsible for the transfer of the code to the Arduino board. It is interfaced through a USB-serial cable, though other interfaces (such as bluetooth) exist.

An Arduino Diecimila. Photo by Nicholas Zambetti.

Contents

[edit] Hardware

The Arduino site describes each version of the Arduino board in detail here, but a short description for selected versions will also be provided here.

[edit] Diecimila

Most of the club's Arduinos are the Arduino Diecimila, the older model of the standard Arduino board. It provides 14 digital I/O pins (6 PWM), 6 analog input pins, 14 KB of programmable memory, 1 KB of RAM, and a clock speed of 16 MHz. The Diecimila board has a jumper on-board to specify whether to use USB power or External (the barrel connector) power.

[edit] Duemilanove

The newest version of the standard Arduino board is the Duemilanove. It provides 14 digital I/O pins (6 PWM), 6 analog input pins, 14 KB of programmable memory (30 KB of memory on the newer models), 1 KB of RAM (2 KB of RAM), and a clock speed of 16 MHz. The Duemilanove automatically selects between USB power and External (the barrel connector) power.

[edit] Mega

The Arduino Mega is a board for larger applications. It is based on the ATmega1280 microcontroller, and provides 54 digital I/O (14 PWM), 16 analog input pins, 124 KB of programmable memory, and a clock speed of 16 MHz.

[edit] Programming

The Arduino programming language is a derivative of the Processing programming language, but in reality is much more similar to C/C++. The differences are noted here. The compiler used is AVR GCC with AVRlib/AVR LIBC as its standard library. One of the largest differences between the C/C++ language standards and Arduino's programming language is that there is no standard "main()" application entry function, but there are two functions with similar purposes. The "void setup()" function is called after every hardware reset and is used for any setup code, and the "void loop()" function executes infinitely after the exit of the setup function.

The Arduino is not threaded and does not allow any code to run in parallel, but it does support hardware and software interrupts. At this time the club uses the Arduino Diecimila for table-top robotics as well as for the Mini Grand Challenge for movement and sensor interfacing.

[edit] Tutorials

  • Many simple programs are provided on the Arduino tutorial page here.
  • The Penn State Robotics club has our own small Arduino Programming tutorial for those without any programming/software background.

[edit] External Links