Book Image

Arduino Robotic Projects

By : Richard Grimmett
Book Image

Arduino Robotic Projects

By: Richard Grimmett

Overview of this book

Table of Contents (21 chapters)
Arduino Robotic Projects
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Selecting the right Arduino board


Before we connect power and start programming, you'll need to decide which of the different Arduinos is right for your project.

A brief history of Arduino

First, let's understand a little history and a few definitions. Arduino began in 2005 with a few brave folks at a school in Italy deciding that providing a simple, inexpensive, easy-to-work-with hardware (HW) and software (SW) platform would be a wonderful endeavor so that their students could work on their own embedded systems projects. They started with the Atmel series of processors and then added four key elements.

First, they provided an easy-to-use hardware connection to the processor so that users didn't need to purchase expensive and difficult-to-use additional HW for this task. Initially, this connection was done via a serial port; now, it is almost universally done through USB.

Second, they provided a boot program (the program that runs when the processor powers on) that would configure the hardware and get the entire system to a known state so that users would have a standard set of hardware with which they can work. This also enables the contribution of the third key, which is the Arduino integrated development environment (IDE). It is a piece of SW that runs on a host computer and allows developers to develop their projects and then upload them easily to the target Arduino development board. The program can then be run, debugged, and modified through the IDE. Then, when the program is completed, you disconnect Arduino from the host system and it will run without any connection to the development system.

The last contribution is a set of Input/Output (I/O) pins in a standard configuration. This makes documentation easy, but more importantly, it has allowed for an entire set of additional capability to be provided by what are called shields. These shields fit on top of Arduino, plug directly into the pins, and are supported by a code library that allows the user to easily access the increased functionality.

Introducing the different versions of Arduino

Initially, there was only a single board, which made selection easy. However, as the community of Arduino users has grown, so have the many different needs for different sizes, capabilities, and form factors. There are now many different Arduino versions and even Arduino clones. There are also chips that allow you to create your very own Arduino-like systems. There are many well-known and popular versions of Arduino for you to consider for your project. However, they are too many to be listed and discussed here.

There are some that are very powerful but also have a much larger form factor and are more expensive. There are some that are extremely small and inexpensive, but they are somewhat limited in the size of programs and interfaces. Here are some of the most popular versions of Arduino.

Arduino Uno R3

Perhaps the current most popular version of Arduino is the Arduino Uno R3 (or Rev3). The following is an image of the unit:

Choosing the Arduino Uno R3

This is a standard choice for many Arduino projects. It has 32 KB of space for programs, which is a relatively adequate amount for most small-to medium-size programs. It has an ATmega328 processor running at 16 MHz and the standard Arduino set of I/O pins, 14 digital I/O pins, six analog inputs, and one serial communication port. It takes a USB A Male to B Male cable, as shown in the following image:

Arduino Mega 2560 R3

Another popular choice, especially when additional program space and programming power is needed, is the Arduino Mega 2560 R3. The following is an image of this Arduino:

Choosing the Arduino Mega

The Arduino Mega is Arduino of choice for larger projects that require more programming space, a more powerful processor, more I/O, or all of these. It uses an ATmega2560 processor, which runs programs faster than the ATmega328 processor. The biggest difference, perhaps, is the larger program size. It has a total of 256 KB of memory, which can store much larger programs than the standard Arduino Uno. It also has more analog and digital I/O pins.

Note

The add-on shields are boards that can fit on top of Arduino to add more functionalities. However, it is important to note that they are made to fit the Arduino Uno may not fit the Arduino Mega. For each shield you are considering, make sure it will work with your particular Arduino.

Spotting a counterfeit or clone

There is one more thing to note here. Where it says Mega, you'll notice that there is no Arduino trademark on the board. The Arduino team restricts the usage of its trademark for manufacturers that pay a license fee and work with the team to ensure quality. In this case, this board is almost assuredly not an official Arduino Mega. Go to http://arduino.cc/en/Products/Counterfeit#.UxkWsfldVHI to find out more about how to spot a counterfeit.

As the hardware for Arduino is also open source, some manufacturers take this design and provide new and different designs form factors. These are considered Arduino clones. You will need to rely on the quality of the manufacturers of these clones, so consider that before purchasing.

Arduino Due

If you need even more processing speed, the most powerful of all the Arduino lines is the Arduino Due. The following is an image of this product:

Choosing the Arduino Due

The Arduino Due is truly at the top of the line as far as processing power is concerned. This unit uses the AT91SAM3X8E7 processor, which is an ARM Cortex processor. It is the same type of processor that many cell phones use. It also offers 512 KB of memory and lots of analog and digital I/O pins. Shields that are made to fit the Arduino Mega or Uno often will fit the Arduino Due, but it is always good to check before purchase. For most starter projects, you'll not need the power of the Arduino Due.

Arduino Micro

If you need to go smaller, the Arduino line also offers opportunities with much smaller packages in a number of different form factors. One of the more popular units is the Arduino Micro. The Micro is a very small form factor; yet, it has a processor with the appropriate boot parameters so that you can run the Arduino IDE, the USB connector, and the exposed I/O pins, even though they are much fewer than those found in the Arduino Uno.

The following is an image of this unit:

Choosing the Arduino Micro

This unit comes with an ATmega328 processor, the same processor that comes with the Arduino Uno, but runs at half the clock rate. It comes with the same 32 KB of memory as the Uno but with much fewer I/O pins. For this unit, and the others that I will present here, you'll need to use a mini-USB B cable, as shown in the following image:

Adafruit FLORA

As noted earlier, as Arduino designs and parts are openly available, some companies have taken the standard Arduino and given it a different look. If you are looking for a much different form factor, you can try the Adafruit FLORA, offered by Adafruit at www.adafruit.com. The following is an image of this unit:

Choosing the Adafruit FLORA

The Adafruit FLORA is part of a wearable line of Arduino clone processors. It is 1.75 inches in diameter, but still has the USB connection, connectivity to the Arduino IDE, and exposed pins, but much fewer than any of the other Arduinos we have discussed. It uses the Atmega32u4 processor and also uses a mini-USB B cable.

Adafruit Gemma

If you like the FLORA form factor but want something even smaller, you can purchase the Gemma from Adafruit. In the following image, this unit is on the right-hand side of the FLORA:

Choosing the Adafruit Gemma

Amazingly, the Adafruit Gemma still has the USB connector, uses the same Arduino IDE, and has some I/O pins still available. As it has an ATtiny85 processor running at 8 MHz, only 8 KB of memory, and far fewer I/O pins, it can only be used in limited applications. However, it is an interesting form factor.

Adafruit Trinket

Finally, another small form factor Arduino from Adafruit is the Trinket. The following is an image of it with the FLORA and Gemma in the background:

Choosing the Adafruit Trinket

The trinket is very similar in performance with the Gemma, with the same processor, memory, and I/O.

Other options with Arduino

There are also other possible Arduino configurations. As you can purchase a chip that has the Arduino processor and Boot ROM configuration, you can build a custom Arduino configuration. The http://www.instructables.com/id/Paperduino-20-with-Circuit-Scribe/ website even shows you how to print your own Arduino circuit on paper.