Book Image

Mastering Arduino

By : Jon Hoffman
Book Image

Mastering Arduino

By: Jon Hoffman

Overview of this book

Mastering Arduino is an all-in-one guide to getting the most out of your Arduino. This practical, no-nonsense guide teaches you all of the electronics and programming skills that you need to create advanced Arduino projects. This book is packed full of real-world projects for you to practice on, bringing all of the knowledge in the book together and giving you the skills to build your own robot from the examples in this book. The final two chapters discuss wireless technologies and how they can be used in your projects. The book begins with the basics of electronics, making sure that you understand components, circuits, and prototyping before moving on. It then performs the same function for code, getting you into the Arduino IDE and showing you how to connect the Arduino to a computer and run simple projects on your Arduino. Once the basics are out of the way, the next 10 chapters of the book focus on small projects centered around particular components, such as LCD displays, stepper motors, or voice synthesizers. Each of these chapters will get you familiar with the technology involved, how to build with it, how to program it, and how it can be used in your own projects.
Table of Contents (23 chapters)

History of the Arduino

In 2003 Hernando Barragan started working on a project called Wiring for his master's thesis at the Interaction Design Institute Ivrea (IDII) in Italy. At that time students used a microcontroller board that cost USD $100 and needed additional hardware and software to use. Massimo Banzi and Casey Reas, who is known for work on the Processing language, were supervisors for his thesis. The name was Wiring: Prototyping Physical Interaction Design.

The purpose of the thesis was to create a low-cost and easy-to-use tool so non-engineers could create digital projects. To do this, Hernando wanted to abstract away the complicated details of the electronics to let the user focus on their project. This meant that it had to be work by simply plugging the device into a host computer and have an easy-to-use interface to program it.

The first prototype used the Parallax Javelin Stamp microcontroller, which used a subset of the Java programming language. This solution required the Parallax proprietary tools to compile, link and upload the projects to the microcontroller; therefore, it did not meet the requirements of the project because the wiring was going to be an open source project.

The second prototype used the Atmel ARM-based 91R40008 microcontroller. Hernando obtained better results with this new microcontroller; however, he determined that the microcontroller was far too complex, and it was almost impossible to solder it by hand to a circuit board.

The third prototype used the Atmel ATmega128 microcontroller with the MAVRIC microcontroller board. Hernando had great success using this microcontroller. He used a tool written by Brian Dan called Avrdude to easily upload new programs to the board.

Avrdude is still used today and can be found here: http://www.nongnu.org/avrdude/.

FTDI's hardware was chosen for the USB to serial communication because it had easy-to-obtain drivers for Linux, Windows and macOS platforms. This allowed the Wiring project to be compatible with all three major platforms.

In 2004, the IDII ordered and paid for 25 Wiring circuit boards. These boards were manufactured by SERP. They included the ATmega128 microcontroller, FTDI USB to serial hardware, onboard LED connected to a pin and serial RX/TX LEDs. Usability tests were performed using these boards and the results were great.

After graduating with distinction in 2004, Hernando moved back to his native Colombia to teach at the Universidad de Los Andes where he continues to work on Wiring. In May 2005, Hernando ordered 200 circuit boards and begin assembling the first Wiring boards outside of IDII. He sold these boards for approximately USD $60. By the end of 2005 Wiring was being used in various parts of the world.

Also, in 2005, the first Arduino board was created. The Arduino board used the less expensive ATmega128 microcontroller to reduce cost. The Arduino team forked the Wiring code and added support for this board.

The initial Arduino core team consisted of Massimo Banzi, David Cuartielles, Tom Igoe, Gianluca Martino and David Mellis. Hernando was not invited to participate in this project. There are several accounts from different individuals involved about why he was not invited.

I do not have any first-hand knowledge about which of these stories are true and which are false; therefore, for this book, I will leave it at the known truth of Hernando was not invited to participate in the Arduino project.

The Arduino team strongly believed in open source hardware and software. They believed that by opening the platform up, many more people would have access to and be involved with it. Another reason for opening the platform up was that IDII had used up its funding and was going to be shut down. By open sourcing the platform they knew it would survive and would not be exploited by others.

The team initially decided on a price of USD $30 for the board. They figured it would make it easily accessible to students as well individuals. They also decided to make the board blue, which was different from most other boards at the time, which were green. Another design decision that helped add to the popularity of the board was giving it lots of input and output pins. Most boards at the time limited the number of I/O to reduce costs.

Initially, the team ordered 300 printed circuit boards to conduct a usability test. They handed these boards out to students at IDII with three simple instructions: look up the assembly instructions online, build your board and use it to create something. They had great success with this test because the students were able to assemble the boards and create numerous projects with it.

Shortly after this test, people began to hear about this board and wanted one for themselves. The project started to take off; however, it was still missing a name. While discussing the name, the team was having drinks at a local a bar frequented by Massimo Banzi. The bar's name was Bar Di Re Arduino and the new board became known as the Arduino.

What is the Arduino?

At the heart of the Arduino is the microcontroller. A microcontroller is a standalone, single-chip integrated circuit that contains a CPU, read-only memory, random access memory and various I/O busses. Most Arduino boards use the Atmel 8-bit AVR microcontroller.

The Arduino UNO R3, which is the primary board used in this book, uses the ATmega328 chip. This chip is an 8-bit RISC-based microcontroller that features 32 KB of flash memory with read-write capabilities, 1 Kbyte EEPROM, 2 Kbytes SRAM, 23-general purpose I/O lines and 32 general-purpose registers. Do not be too concerned if you do not understand all those specifications because we will be interacting with the microcontroller using the interface that the Arduino board provides us. It is good to know these specifications as you begin to develop more complex applications because they do put limits on what we can do.

All the hardware and software that make up the Arduino platform are distributed as open source and licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL). This allows for the manufacture and distribution of Arduino boards by anyone and has led to numerous generic, lower cost, Arduino compatible boards.

You can find more information about the license and the Arduino boards on the Arduino website here: https://www.arduino.cc.