What Exactly is an Arduino?

image

Figure 1-1. An Arduino Uno

Wikipedia states “An Arduino is a single-board microcontroller and a software suite for programming it. The hardware consists of a simple open hardware design for the controller with an Atmel AVR processor and on-board I/O support. The software consists of a standard programming language and the boot loader that runs on the board.

To put that in layman's terms, an Arduino is a tiny computer that you can program to process inputs and outputs between the device and external components you connect to it (see Figure 1-1). The Arduino is what is known as a Physical or Embedded Computing platform, which means that it is an interactive system that can interact with its environment through the use of hardware and software. For example, a simple use of an Arduino would be to turn a light on for a set period of time, let's say 30 seconds, after a button has been pressed. In this example, the Arduino would have a lamp and a button connected to it. The Arduino would sit patiently waiting for the button to be pressed; once pressed, the Arduino would turn the lamp on and start counting. Once it had counted for 30 seconds, it would turn the lamp off and then wait for another button press. You could use this setup to control a lamp in an closet, for example.

You could extend this concept by connecting a sensor, such as a PIR, to turn the lamp on when it has been triggered. These are some simple examples of how you could use an Arduino.

The Arduino can be used to develop stand-alone interactive objects or it can be connected to a computer, a network, or even the Internet to retrieve and send data to and from the Arduino and then act on that data. In other words, it can send a set of data received from some sensors to a website, which can then be displayed in the form of a graph.

The Arduino can be connected to LEDs, dot matrix displays (see Figure 1-2), buttons, switches, motors, temperature sensors, pressure sensors, distance sensors, GPS receivers, Ethernet modules, or just about anything that outputs data or can be controlled. A look around the Internet will bring up a wealth of projects where an Arduino has been used to read data from or control an amazing array of devices.

image

Figure 1-2. A dot matrix display controlled by an Arduino (image courtesy of Bruno Soares)

The Arduino board is made up of an Atmel AVR Microprocessor, a crystal or oscillator (a crude clock that sends time pulses at a specified frequency to enable it to operate at the correct speed), and a 5-volt linear regulator. Depending on what type of Arduino you have, it may also have a USB socket to connect to a PC or Mac for uploading or retrieving data. The board exposes the microcontroller's I/O (input/output) pins so that you can connect those pins to other circuits or to sensors.

The latest Arduino board, the Uno, differs from the previous versions of the Arduino in that it does not use the FTDI USB-to-serial driver chip. Instead, it uses an Atmega8U2 programmed as a USB-to-serial converter. This gives the board several advantages over its predecessor, the Duemilanove. First, the Atmega chip is a lot cheaper than the FTDI chip, bringing the prices of the boards down. Secondly, and most importantly, it enables the USB chip to have its firmware reflashed to make the Arduino show up on your PC as another device, such as a mouse or game controller. This opens up a whole array of new uses for the Arduino. Unfortunately, moving over to this new USB chip has made it a lot more difficult for clone manufacturers to make Arduino Uno clones.

To program the Arduino (make it do what you want it to) you use the Arduino IDE (Integrated Development Environment), which is a piece of free software in which you write code in the language that the Arduino understands (a language called C). The IDE lets you to write a computer program, which is a set of step-by-step instructions that you then upload to the Arduino. Your Arduino will then carry out these instructions and interact with whatever you have connected to it. In the Arduino world, programs are known as sketches.

The Arduino hardware and software are both open source, which means that the code, schematics, design, etc. can be taken freely by anyone to do what they like with them. Hence, there are many clone boards and other Arduino-based boards available to purchase or to make from a schematic. Indeed, there is nothing stopping you from purchasing the appropriate components and making your own Arduino on a breadboard or on your own homemade PCB (Printed Circuit Board). The only caveat that the Arduino team imposes is that you cannot use the word “Arduino.” This name is reserved for the official board. Hence, the clone boards have names such as Freeduino, Roboduino, etc.

As the designs are open source, any clone board is 100% compatible with the Arduino and therefore any software, hardware, shields, etc. will also be 100% compatible with a genuine Arduino.

The Arduino can also be extended with the use of shields, which are circuit boards containing other devices (e.g. GPS receivers, LCD Displays, Ethernet modules, etc.) that you can simply connect to the top of your Arduino to get extra functionality. Shields also extend the pins to the top of its own circuit board so you still have access to all of them. You don't have to use a shield if you don't want to; you can make the exact same circuitry using a breadboard, Stripboard, Veroboard, or by making your own PCB. Most of the projects in this book are made using circuits on a breadboard.

There are many different variants of the Arduino. The latest version is the Arduino Uno. The previous version, the very popular Duemilanove (Italian for 2009), is the board you will most likely see being used in the vast majority of Arduino projects across the Internet. You can also get Mini, Nano, and Bluetooth variations of the Arduino. Another new addition to the product line is the Arduino Mega 2560; it offers increased memory and number of I/O pins. The new boards use a new bootloader called Optiboot, which frees up another 1.5k of flash memory and enables faster boot up.

Probably the most versatile Arduino, and hence the reason it is the most popular, is the Uno, or its predecessor, the Duemilanove. This is because it uses a standard 28-pin chip attached to an IC (Integrated Circuit) socket. The beauty of this system is that if you make something with an Arduino and then want to turn it into something permanent, instead of using a relatively expensive Arduino board, you can simply pop the chip out of the board and place it into your own circuit board in your custom device. By doing so, you have made a custom embedded device, which is really cool.

Then, for a couple of quid or bucks, you can replace the AVR chip in your Arduino with a new one. Note that the chip must be pre-programmed with the Arduino Bootloader (software programmed onto the chip to enable it to be used with the Arduino IDE), but you can either purchase an AVR Programmer to burn the bootloader yourself or you can buy a chip ready programmed; most of the Arduino parts suppliers provide these. It is also possible to program a chip using a second Arduino; instructions are available online for this.

image

Figure 1-3. Anthros art installation by Richard V. Gilbank controlled using an Arduino

If you do a search on the Internet for “Arduino,” you will be amazed at the large number of websites dedicated to the Arduino or that feature cool project created with an Arduino. The Arduino is an amazing device and will enable you to create anything from interactive works of art (see Figure 1-3) to robots. With a little enthusiasm for learning how to program an Arduino and make it interact with other components as well as a bit of imagination, you can build anything you can think of.

This book will give you the necessary skills needed to make a start in this exciting and creative hobby. Now that you know what an Arduino is, let's get one hooked up to your computer and start using it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.92.124