Stuart Yarnold
Arduino
In easy steps is an imprint of In Easy Steps Limited
16 Hamilton Terrace Holly Walk Leamington Spa
Warwickshire CV32 4LY
www.ineasysteps.com
Copyright 2015 by In Easy Steps Limited. All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without prior written permission from the publisher.
Notice of Liability
Every effort has been made to ensure that this book contains accurate and current information. However, In Easy Steps Limited and the author shall not be liable for any loss or damage suffered by readers as a result of any information contained herein.
Trademarks
All trademarks are acknowledged as belonging to their respective companies.
Contents
Understanding Arduino
This chapter is an introduction to the subject of Arduino. We see just what Arduino is, what can be done with it and the advantages it offers over competing platforms.
What is Arduino?
An Arduino is a small circuit board, which contains either an 8-bit or a 32-bit microcontroller, plus a handful of other components. Recent models, such as the Uno, also offer a USB interface, and a number of analog input pins as well as a number of digital input/output pins.
Arduino began in Italy at the Interaction Design Institute Ivera. This is a school of design education that focuses on interaction with digital devices and systems.
The concept behind the development of Arduino is to simplify the construction of interactive objects or environments and make them more accessible. To this end, it has been designed to be inexpensive and straightforward, thus providing a way for hobbyists, students, and professionals to create devices and projects that interact with their environment with sensors and actuators.
Typical examples of Arduino projects include simple robots, security systems and motion detectors. There are many more.
Arduino is the modern-day equivalent of those old electronic kits from yesteryear sold by companies such as Radio Shack and Heath
Arduino is about more than just hardware though. The microcontroller needs to be programmed and this introduces a software element in the form of an integrated development environment (IDE) that runs on personal computers. With it, users write programs (known as sketches) using the C or C++ programming languages.
The Arduinos microcontroller comes with a boot loader that makes it much easier to upload programs to the boards flash memory. The Arduinos competitors, in comparison, typically require the use of an external programmer. In keeping with the ethos behind Arduino, this keeps the programming side of things as straightforward as possible by allowing it to be done with a personal computer.
Because the connectors on Arduino boards are all standard types, it is possible to extend the basic Arduino by incorporating pre-built circuit boards, known as shields. Due to the design of the connector blocks, these can be stacked on top of one another, making it possible to create large and complex projects.
A number of Arduino boards are available. These include the Uno, the Duemilanove, the Diecimila, and the Mega. These are all designed for use with specific types of project and so come with differing specifications. Of all of them, the Uno is the most popular and can be used for the widest range of projects.
As a way of learning the basics of both electronics in general and programming, Arduino is an ideal tool.
Why Arduino?
The Arduino isnt the only low-cost computer on the market. There are a number of alternatives, all of which provide much the same capabilities. These include:
Raspberry Pi
CubieBoard
Gooseberry
APC Rock
OLinuXino
Hackberry A10
While we discuss Arduino in this book, it may be that one of the other low-cost computers is better suited to your requirements.
However, Arduino does have the following advantages:
Cost Arduino boards are not as expensive as other microcontroller platforms. For many people, this is an important factor.
Cross-platform Arduino software runs on Windows, Mac, and Linux operating systems. This is in contrast to most other microcontroller systems, which are limited to just Windows.
Simplicity & Flexibility the Arduino programming environment is simple enough for beginners to quickly grasp, yet provides the flexibility that enables more complex projects to be tackled.
As an educational tool, its conveniently based on the common open source Processing programming environment, so many people will already be familiar with it.
Open source software Arduino software is open source and freely available for download from a number of websites. For those who dont have the ability to write their own programs or those who simply cannot be bothered, a huge range is available.
Open source hardware the Arduino is based on the ATMEGA8 and ATMEGA168 microcontrollers, the plans for which are freely available under a Creative Commons license. Thus users can make their own version of the module to improve it or to increase its capabilities.
Arduino does offer advantages over the competition.
Which Arduino?
Arduino boards are not all the same there are a number of types, each designed for different requirements. So before parting with the cash, it may pay you to take a look at what is available. Below, we look at the three most popular boards:
Arduino Uno
The most popular Arduino board of all is the Uno. This offers a range of features that make it a good all-purpose board.
It incorporates the ATmega328 chip as the controller and can be powered directly from USB, battery or an AC to DC adapter. The board operates at a voltage of 5 volts.
The board also offers 14 digital input/output pins, six of which can be used as pulse width modulation (PWM) outputs. In addition, it has six analog inputs, plus RX/TX (serial data) pins.
Memory provision is 32KB of flash memory, 2KB of static random access memory (SRAM), and 1KB of Electrically Erasable Programmable Read-Only Memory (EEPROM).
The Arduino Uno is the reference against which all other Arduino boards are compared.
Variations of the Uno include:
The Leonardo this is available both with and without headers, and offers a micro USB port.
The Ethernet this comes with a RJ45 Ethernet socket rather than a USB port. It also offers a microSD card reader.
Pros of the Arduino Uno include:
Simplicity
Low cost
Plug-and-play
Plenty of resources available, e.g. tutorials, sample code, etc.
Next page