General Engineering Introduction/Arduino and Motors/Arduino Introduction
What, Why Arduino?
The Arduino contains a microcontroller. Microcontrollers evolved from the same microprocessors that started the PC revolution such as the Motorola 6502 and Intel 8088. Microcontrollers differ from modern CPUs in that IO, RAM, and Flash memory are imbedded in a single chip. They are found in embedded applications such as the control panel of a microwave, printer or car dashboard. They exist in a variety of configurations and price points starting at under two dollars for quantity one. Two popular microcontroller companies used in the DIY community are AMTEL and Microchip PIC. They are popular because they give away the software development environment (C language) for free and they scale up to supporting Linux.
The Arduino is open source hardware. It contains chips from for profit companies. The open source features are:
- The form factor: the way wires attach to it, the way add on products stack on top of it
- The circuit board
- The circuit that connects the chips
- Standard boot loader (what happens when you turn it on)
The Arduino evolved out of the open source Wiring project, which was inspired by the Processing programming language. The Arduino was created at the Interaction Design Institute in Ivrea Italy (where Olivetti is located) in 2003 in almost one evening (24 minute video link). The goal of Wiring is to create an single board microcomputer, a programming language and an IDE that caters to artists. The Arduino is a success for several reasons:
- Surface mount chips are hard to solder. The DIY community needed to move away from designing circuits, building unique big circuit boards and soldering chips. They needed to move to small standard circuit boards that are stacked on top of each other.
- Test driven software development
- Example driven software learning
- Active community expanding examples
- Physical feedback through lights, motors, sounds of software success
- Price points, competition and branding necessary for economic success
Every year for the last 20 years both universities and companies have come up with new microcontrollers targeting the DIY educational market. The starting price point has been around $300. The Arduino has lowered this to around $30.
In summary the Arduino has a lower starting point in both cost, experience and expectations. Yet it scales up to the dominate professional software development environments used by electrical engineers to create circuits and computer engineers to build systems. It also scales up to enabling complicated open source, Linux applications such as the robot operating system (ROS) and autopilots to travel in battery operated robots.
The term "Arduino" refers to a family of controllers that use the same software but have different target applications and form factors. The rest of this document refers to the Uno Arduino specifically.
The Arduino Uno's function is expanded by sandwiching different circuit boards on top of it. These circuit boards are called shields. New shields spark creativity, demand and profit. Pictured are a USB Host Shield .. which enables the Arduino to act like a PC rather than the device being plugged into the PC.
To the right is a picture of an Uno (blue) with a USB Host Shield (red) and motor Shield (green) stacked on top of it. The USB Host Shield and UNO have stackable or female headers. The motor shield has been made with breakaway or male headers that prevent stacking of more shields.
The Uno can be powered through the USB cable. Eventually adding stuff to the Uno will cause everything to stop working. The solution is to plug in a 5 to 12 volt DC in cable to the Uno. Things will then work, more will be added and eventually the Uno will stop working again. At this point the individual shields may need their own power sources. This is especially true if motors are involved.
The USB cable is designed to be attached to a computer so that software can be downloaded to the Arduino. Once the program is downloaded, the USB cable can be disconnected (if another power source is available) and the program will run without a computer.
A USB mouse or keyboard can not be plugged into the Arduino as if it were a computer. The USB port on an Uno is a slave port, not the USB On-The-Go port found in cell phones. The Uno needs a USB host to talk to. Keyboards and mice are slaves. Two slaves can not talk to each other. That is why a USB Host shield for the Arduino exists.
6 Analog In Pins
Six pins (or holes where pins go) are clearly labeled on the Uno. EEG, ECG, temperature sensors, light sensors, and strain gauges are examples of devices that turn physical measured information into a voltage. The Uno can turn the voltage into a number between 0 and 1023 through the Analog pins. The maximum voltage defaults to 5 volts, but can be changed to 1.1 or 3.3 volts through software.
The word "AREF" on the Uno points a pin. AREF stands for Analog REFerence. A different maximum voltage for the Analog pins can be connected here and then selected through software. The maximum voltage is 5 volts. 1.1 and 3.3 volts can be selected through software. Anything different will have to be connected to the AREF pin. Doing this enables the Uno to be more accurate when converting information from the 6 analog pins to numbers.
The digital pins put out either 0 or 5 volts. They can turn off and on LEDs. Or they could tell a fax machine LCD panel what to say. Pins 3,5,6,9,10,11 are PWM or Pulse Width Modulation pins, meaning that the time on and time off do not have to equal. This enables the control of Electronic Speed Controllers (ESC). This enables an Uno to change the speed of helicopter propellers. Pins 0 and 1 stand for transmit and receive ... with anything including another UNO. This for example would enable one UNO to talk to another.
The Uno pins move up through the headers and thus are available to all the shields. The shields themselves may have additional features. There is a protoboard shield that adds no features other than providing a platform on which to build unique circuits.
The arduino has spun off a number of competing open source hardware projects. The uno header pin out and compatibility with arduino software are the two major features of all arduino boards.
Many companies are making "almost compatible" arduino products like the Pinguino. Some feature the pic processor rather than the arduino's Atmel. Others like the papilio (based on Xilinix FPGA) don't claim software capatibility, just compatibility with the UNO header pinout.