Arduino Due is the first 32 bit ARM Processor development environment released by the Arduino community after their widely successful 8 bit development platform – Arduino Uno. The main advantages of using a 32 bit ARM Processor based Arduino Due for your next project are:

1.) Can act as USB Host – Supports USB On the Go (OTG) devices like Tablets, Smartphones, Keyboard, Mouse, etc.

2.) Compatible with the Android Development Kit 2.0 Protocol.

3.) Compatible with all Revision 3 Shields or Custom ones that are able to exploit the IOREF pin.

4.) Two Digital to Analog Converters (DAC) on-board (in addition to the conventional Analog to Digital Converters – ADC)

5.) Low Power Consumption (Due runs at 3.3V).

6.) Increased Flash Memory – 512 KB (Code Upload capacity of Uno is 32 KB while that of Due is 16 times higher).

7.) More Input/ Output Ports.

8.) Higher Clock Speed (a jump from 16 MHz to 84 MHz).

A recent article posted on the Wired has confirmed that the Due will support the ADK 2.0 Protocol and will be compatible with Google’s Libraries and some of the code written for the Android Development Kit (ADK).

USB Ports

There are two USB Ports on the Arduino Due:

a.) Micro USB B connector (for Programming).

b.) Micro USB AB connector (for Debugging and acting as Host for USB On-The-Go (OTG) Devices).

For details about programming Arduino Due, see the Programming Section.

To learn about how to setup and program an Arduino Board from the beginning, refer to our tutorial here: Explore Labs – Arduino Beginnings

Arduino Community has released a Beta version of Arduino IDE 1.5.0 which will support the new generation Arduino Due board.

Arduino Due is powered by Atmel’s AT91SAM3X8E ARM Cortex M3 32-bit MCU (datasheet).

The Arduino Due is said to be Cross-Compatible with its predecessors. The method of installing the drivers, using the IDE, coding techniques and uploading Sketches will be identical.

Arduino Due at Explore Labs – Buy

Discuss your queries related to Arduino Due at our Forum

Imagine if you could forget about soldering the crystal and different resistors/capacitors and stop worrying about a serial connection to your computer before using a microcontroller in your next project! What if you had a simple way of doing this, like using the plug-and-play features of the USB.

Imagine a way of taking inputs from variety of things like switches and different types of sensors (light, temperature, etc.) and controlling the movements of motors, LEDs, or animating the physical world around you.

Introducing Arduino…(curtains raised)

 

Design By Numbers Processing Wiring Arduino
1999 2001 2003 2005
Massimo Banzi and David Cuartellis, founders of the Arduino project, named it after King Arduin of Ivrea, Italy. (Pronounced “Hardwin”) which means “strong friend”.Actually, Arduino owes its birth to Design By Number programming language created by John Maeda, at the MIT Media Lab. It allowed artists, designers and non-programmers to easily start computer programming.
Processingis a programming language and development environment that makes sophisticated animations and other graphical effects accessible to people with relatively little programming experience.” – John Maeda, MIT.However, two of his students, Casey Reas and Ben Fry took it even further by developing Processing, to teach computer programming in a visual context.
Next came Wiring, a programming language which allowed to control physical world objects attached to Wiring I/O electronic boards to create interactive objects, like, lighting up an LED when there is no light in the room.It was created by Hernando Barragán as a Master’s thesis at the Interaction Design Institute Ivrea under the supervision of Massimo Banzi and Casey Reas.
Arduinois the descendent of the open-source Wiring platform, designed to make the process of using electronics very easy and accessible to all disciplines.The hardware consists of an open source hardware design for the Arduino board with an Atmel’s microcontroller which can be programmed easily with a Processing-based IDE through a USB cable.
Fritzingis an open-source software environment for designers and artists to document their interactive prototypes and to take the step from physical prototyping to actual product (from Breadboard to Printed Circuit Board).It can be though of as an Electronic Design Automation (EDA) tool for non-engineers.

“Arduino was intended to be an electronics version of Processing that used our programming environment and was patterned after the Processing syntax. It was supervised by myself and Massimo Banzi, an Arduino founder. I don’t think Arduino would exist without Wiring and I don’t think Wiring would exist without Processing. And I know Processing would certainly not exist without Design By Numbers and John Maeda. etc. This is what is exciting to me – the iteration and growth of this community.” – Casey Reas, Rhizome.

At first, there was binary… Long strings of 1s and 0s… Then, assembly language was introduced to make the programmers life less miserable. It was also abstracted into High Level Languages such as BASIC, COBOL, FORTRAN, C, etc.

When electronics prototyping and tinkering reached the hands of common users (us!), there was a need to make the life of a tinkerer even simpler. This was the beginning of Open Source era and Do-It-Yourself (DIY). With the introduction of Processing and Wiring it was easy for a designer or an artist or even a non-programmer to adapt the simple look and feel of the IDE and start writing programs.

The use of Microcontroller in Hobby projects as well as commercial products is not new. It dates back to the era of 80s, the Intel 8051, Motorola 68000 and many more. Later, to BASIC Stamp and PIC, etc. All these had one common caveat to them; their programming.

Earlier, the code was written in assembly language in the Intel HEX format and then burnt onto the Microcontroller using a dedicated programmer board. This programmer board was connected to the computer using Parallel or Serial Port.

Then, it was made even more simpler with the introduction of C-based programming environments like the KEIL uVision compiler which was used to write code for a microcontroller in C language. Assembly was gone. The code written in C was compiled and converted to an Intel hex file and then burnt onto the Microcontroller. (How?) Well, the programmers had to be used still.

Then came Arduino which changed every programmer’s, hobbyist’s view towards electronics prototyping and programming. The programming language was as simple to write code on, as simple was the hardware and connection.

An Arduino board can be connected to a computer using USB cable and code written in the Arduino IDE can be uploaded (burnt) onto the board’s ATMega 328 IC without any hassle (again, the code is converted to Intel HEX file, but behind the scenes and uploaded).

Also, it is a complete development environment in itself. You don’t need anything else. It has got the power supply regulators built-in so that you could plug in the USB cable and forget worrying about any power issues. It has its I/O pins broken out onto female headers so that you could directly connect it with your breadboard without worrying a thing. Also, It has got the coolest feature of Serial Communication made easy using Object Oriented Programming so that you could interact visually with Processing. And finally, because of its open source-ness, Arduino has got the world’s largest community of programmers, designers behind it. Even its Eagle layout and schematic files are available for download (this is the beauty of Open Source).


The Makers of Arduino want you to start head-on with your prototype or the idea you have in your mind and not worry about how you will program the Arduino (actually, the ATMega 328 Microcontroller!). This brings the time to implement your idea way down.

Things you will need:

a.) Arduino Uno (The latest variant available)

b.) USB A to B Cable (Mostly used as Printer Cables)

Thats it!

Arduino Uno gets its power from the USB port of your computer (5V). You could also use a 9V battery or a combination of AA cells to power your Arduino through the barrel jack but it is not needed when you are seated near your computer and learning the basics.

The USB interface is provided for three reasons:

a.) It is easily available on all the computers, notebooks present today as compared to serial port.

b.) It powers the Arduino

c.) It sends the code from the computer to the Uno board.

The following instructions are written for Mac OS X Lion 10.7.4

a.) You need to download the Arduino IDE which can be found here. [Current version as of August 3, 2012 is Arduino 1.0.1]
For users other than the Mac, download the appropriate files: Windows, Linux (32-bit), Linux (64-bit).

b.) Connect USB cable to your Arduino Board. The “ON” LED should light up (above the reset button).
You will get the following dialog box with it:

Select (Network Preferences…) It will open up Network Preferences. Click (Apply) and quit Network Preferences.

c.) The .dmg file which you downloaded would open up as a new window. Drag the Arduino.app file to your Applications folder.


a.) Start the downloaded Arduino IDE (from your Applications folder). You will get an empty sketch with the name as the present date.
 

b.) Go to Tools -> Boards. Select “Arduino Uno” from the Menu Bar on the top.

c.) Go to Tools -> Serial Port. Select /dev/tty.usbmodem621 (or a similar number at the end depending on how many serial devices you have connected at present).

d.) To start off, go to File -> Examples -> 01.Basics -> Blink
It should open up a new sketch named Blink with the following code written in it:

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

e.) Do not worry about the code. We will go through it step by step. First, lets verify if your Arduino board is working or not!

Select File -> Upload or press ⌘ + U or Click on the following button:
 

 
f.) The The Tx and Rx LEDs on the Arduino should blink indicating a successful upload of the ‘Blink’ code to the Board. After some time, LED at pin 13 (built into the Arduino board) will start blinking at the rate of 1 second. So, you have successfully uploaded a sketch to your Arduino Uno Board.
 

Now going back to the code. Lets break it down to understand it completely.

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */

Anything between a /* … */ is treated as a comment by the compiler, i.e., not compiled. It is for the reference of user only.
Also, Each line that has a // prefixed before it is also a comment (a single line comment).

int led = 13;

The LED on Pin 13 (L LED) on the Arduino Board will now be called as led.

void setup()                

Every sketch that you will make from now on will have a setup() function. It is like the init() function for a seasoned programmer for initializing some things before the actual start of the code.

  pinMode(led, OUTPUT);     

pinMode() is a function in which you tell the Arduino about a specified pin and what will be its behavior (Input/Output).

{...}

A curly bracket is used to specify the end of a function. Take a look at the start of void setup() function.

void loop()

Every microcontroller needs an endless loop to perform its function, not only Arduino. If it is not present, a microcontroller will do its work once and then stop. Any code written in this endless loop will start as soon as the microcontroller is turned on and will repeat itself infinitely until the power supply is cut off. The loop function does the exact same task.

  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)

As you can see in the comment, digitalWrite() function will set the pin 13 HIGH, i.e., Turn ON the LED

  delay(1000);               

The delay() function will stop any activity for the specified amount of time (in mili seconds). Here, 1000 ms = 1 second

  digitalWrite(led, LOW);    
  delay(1000);               

Again, the LED is turned OFF and then we wait for a second. Then, again we go back to the start of the loop() function and repeat the steps, i.e., Turn ON then OFF the LED.


The Arduino has taken the world of electronics and microcontrollers by a storm. Due to Open Source, many makers and DIYers are following it and the Arduino community has become one of the largest community of DIYers in the world. The Arduino hardware reference designs are distributed under a Creative Commons Attribution Share-Alike 2.5 license and are available on the Arduino Web site.

There are many different variants of the Arduino board available in the market with the ever increasing number of shields growing day by day.

Arduino is the best example of “Physical Computing” meaning interacting with the real world objects using software and hardware. Physical Computing is a subject taught in many universities across the world.

 
References

Getting Started with Arduino 3rd Release by Massimo Banzi
Arduino – Home Page
Technology Review, MIT
Interview with Casey Reas and Ben Fry

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

A tutorial to show the basic interfacing of two Servos with an Arduino. Here, the servos are controlled with a two-axis Joystick.


Schematic to show the wiring connections.


// Controlling movements of two servos using a Joystick
// Joystick's x- and y- axes are connected to A0 and A1 analog pins of Arduino.
// Servos are connectd to PWM Pins 9 and 10.
// By Explore Labs

#include <Servo.h>

Servo tilt, pan; // create servo object to control a servo 

int joyX = A0; // analog pin used to connect the X - axis of Joystick
int joyY = A1; // analog pin used to connect the Y - axis of Joystick
int x, y; // variables to read the values from the analog pins 

void setup()
{ 
  tilt.attach(9); // attaches the tilt servo on pin 9 to the servo object 
  pan.attach(10); // attaches the pan servo on pin 10 to the servo object void loop()
{ 
  x = joyX;    // reads the value of the Joystick's X - axis (value between 0 and 1023) 
  y = joyY;    // reads the value of the Joystick's Y - axis (value between 0 and 1023) 
  x = map(analogRead(joyX), 0, 1023, 900, 2100); // scale it to use with the servo b/w 900 usec to 2100 usec
  y = map(analogRead(joyY), 0, 1023, 900, 2100);
  tilt.write(x); // sets the servo position according to the scaled value 
  pan.write(y);
  delay(15); // waits for the servos to get there 
}

Here, we are going to start Physical Computing by controlling an LED using a light sensor. There will be two circuits which are very similar; First – LED lights up when there is light, and Second – LED lights up in the absence of light. Before we go on to the Arduino, i want to show and make this using the primitive techniques – Voltage Regulation, Transistors, etc.




You will need the following:

Qty. Product Value Specifications
1 LDR (Light Dependent Resistor)
1 LED (Light Emitting Diode) Forward Current, If = 20mA
1 Transistor BC547 – NPN
1 Resistor 220Ω or 330Ω both will work, but with 220Ω, LED will be more brighter
1 Resistor 1kΩ or 1000Ω or 1K
1 Resistor 10kΩ

Plus all the components from the Voltage Regulator circuit on a BreadBoard for converting your unregulated power supply to a circuit friendly voltage (Regulated 5V).



Case 1: LED lights up in the absence of light, i.e., in a dark room.

Case 2: LED lights up when there is light in the room and turns off if there is no light.




For both the cases, the circuit will be same. The LED is optional. If you really want some lights to flicker in your room, you can put it in pin 13 of your Arduino board with a 220Ω or 330Ω resistor as shown in the figure.


Case 1:

/*

  From Darkness to Light (Analog Input using an LDR)
 
 Demonstrates analog input by reading an analog sensor
 (here, an LDR) on analog pin 0 and turning on and off
 a light emitting diode (LED) connected to digital pin 13.
 The amount of time the LED will be on and off depends on
 the value obtained by the LDR using the analogRead() function.
 
 The circuit:
 * A Light Dependent Resistor (LDR) attached to analog input 0
 * one pin of the LDR is connected to the analog pin 
   and also through a 1K resistor to the ground
 * other pin of the LDR to +5V
 * Built-in LED at Pin 13 or an external LED connected as follows:
     LED anode (long leg) attached to digital output 13
     LED cathode (short leg) attached to ground
 
 Created by David Cuartielles
 Modified 4 June 2011
 By Explore Labs
 
*/

int ledPin = 13;            // the default pin where Uno's LED is connected
int ldrPin = A0;            // input pin for the LDR
int ldrVal = 0;             // variable to store value coming in from the analog pin

void setup()
{
  //Serial.begin(9600); // Debug: for serial communication to view output in your computer
  pinMode(ldrPin, INPUT);   // not necessary
  pinMode(ledPin, OUTPUT);  // declare pin 13 as output
}

void loop()
{
  ldrVal = analogRead(ldrPin);    // read value coming from the LDR

  //Serial.println(ldrVal, DEC); // Debug: un-comment if you want to see the output
                                  // in Serial Monitor

  digitalWrite(ledPin, HIGH);     // turn the ledPin ON
  delay(ldrVal);                  // wait for milliseconds
  digitalWrite(ledPin, LOW);      // turn the ledPin OFF
  delay(ldrVal);                  // wait for milliseconds
}

Case 2:

For the second case, i.e., to light up the LED in the presence of light, no change is done in the circuit. Only the code needs a little rework.

/*

  From Darkness to Light (Analog Input using an LDR)
 
 Demonstrates analog input by reading an analog sensor
 (here, an LDR) on analog pin 0 and turning on and off
 a light emitting diode (LED) connected to digital pin 13.
 The amount of time the LED will be on and off depends on
 the value obtained by the LDR using the analogRead() function.
 
 The circuit:
 * A Light Dependent Resistor (LDR) attached to analog input 0
 * one pin of the LDR is connected to the analog pin 
   and also through a 1K resistor to the ground
 * other pin of the LDR to +5V
 * Built-in LED at Pin 13 or an external LED connected as follows:
     LED anode (long leg) attached to digital output 13
     LED cathode (short leg) attached to ground
 
 Created by David Cuartielles
 Modified 4 June 2011
 By Explore Labs
 
*/

int ledPin = 13;            // the default pin where Uno's LED is connected
int ldrPin = A0;            // input pin for the LDR
int sensorVal = 0;          // variable to store value coming in from the analog pin
int ldrVal = 0;             // variable in which the rework, i.e., mapping is done
void setup()
{
  //Serial.begin(9600); // Debug: for serial communication to view output in your computer
  pinMode(ldrPin, INPUT);   // not necessary
  pinMode(ledPin, OUTPUT);  // declare pin 13 as output
}

void loop()
{
  sensorVal = analogRead(ldrPin);    // read value coming from the LDR
  ldrVal = map(sensorVal, 0, 1023, 1023, 0);  // to change the range of values from
                                              // 1023 to 0 (default was 0 to 1023) 

  //Serial.println(ldrVal, DEC); // Debug: un-comment if you want to see the output
                                  // in Serial Monitor

  digitalWrite(ledPin, HIGH);     // turn the ledPin ON
  delay(ldrVal);                  // wait for milliseconds
  digitalWrite(ledPin, LOW);      // turn the ledPin OFF
  delay(ldrVal);                  // wait for milliseconds
}

After uploading the codes to the board, if you want to see the output in the Serial Monitor, just uncomment the two lines of code starting with the keyword Serial. Then, while Arduino is running with any of the above codes, click on Serial Monitor.

The Serial Monitor showing the result of Case 1 with real time changes in values of the light falling on the LDR. (shown on Arduino 0022)





The Arduino has taken the world of electronics and microcontrollers by a storm. Due to Open Source, many makers and DIYers are following it and the Arduino community has become one of the largest community of DIYers in the world. The Arduino hardware reference designs are distributed under a Creative Commons Attribution Share-Alike 2.5 license and are available on the Arduino Web site.

There are many different variants of the Arduino board available in the market with the ever increasing number of shields growing day by day.

Arduino is the best example of “Physical Computing” meaning interacting with the real world objects using software and hardware. Physical Computing is a subject taught in many universities across the world.
References

Circuits were Made with Fritzing. For more circuit examples, see the Fritzing project page
Code – Analog Input from Arduino

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.