Start up with Arduino

 

Whenever we make any autonomous system a microcontroller is required. We use it for robot’s brain.There are so many microcontroller series but i prefer ATmega 328, arduino family. Now the question is why we’ll use it. The reasons are:

  • It is an open-source project, software/hardware is extremely accessible and very flexible to be customized and extended.
  • It is flexible, offers a variety of digital and analog inputs, SPI and serial interface and digital and PWM outputs.
  • It is easy to use, connects to computer via USB and communicates using standard serial protocol, runs in standalone mode and as interface connected to PC/Macintosh computers.
  • It is inexpensive, around 30 euro per board and comes with free authoring software.
  • Arduino is backed up by a growing online community, lots of source code is already available and we can share and post our examples for others to use, too!

What is Arduino:

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs – light on a sensor, a finger on a button, or a Twitter message – and turn it into an output – activating a motor, turning on an LED, publishing something online.It includes a microcontroller ATmega328 . It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, an ICSP header, and a reset button.

Pin Configuration

A key aspect of the Arduino board is the amount of connectors available. These are the components which permit wiring the Arduino boards to other components (sensors, resistors, buttons, etc..) so that it can interact with them: reading, writing, moving, etc.

As you can see from the picture above, an Arduino Duemilanove board has the following connectors (listed clockwise starting from the top left ):

AREF: Analog Reference Pin

The voltage at this pin determines the voltage at which the analog to digital converters (ADC’s) will report the decimal value 1023, which is their highest level output. This means that using this pin you’ll be able to change the maximum value readable by the Analog In pins: this is a way to change the scale of the analog in pins.

The AREF pin is, by default, connected to the AVCC voltage of around 5 volts (unless you are running your Arduino at a lower voltage).

GND: Digital Ground

Used as Ground for Digital inputs/outputs.

DIGITAL 0-13: Digital Pins

Used for digital I/O. Digital pins have different usages:

TX/RX Pins 0-1: Serial In/Out

This pins can be used for digital I/O just like DIGITAL pins 2-13 but they can’t be used if Serial communication is used. If your project use Serial communication you might want to use those for Serial communication instead of using the USB to serial interface. This can came handy while using the serial interface to interact with a non PC device (eg another Arduino or a Robot Controller)

External Interrupts Pins 2-3

This pins can be configured to trigger an interrupt on different input conditions. I still did not experienced using this pins but more informations are available on the theattachInterrupt() function reference.

PWM Pins 3, 5, 6, 9, 10, and 11

Provide 8-bit PWM output with the analogWrite() function.

LED: 13

There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off.

ICSP: In-circuit Serial Programmer

Arduino comes with a bootloader which enable program uploading trhough the USB to serial interface. Advanced users can also directly upload programs to the Arduino board using an external programmer. This is done using the ICSP header. This might be cool because by doing so you save the ~ 2KB of memory used for the uploading sketches logic. Anyway I don’t plan to use this feature right now. More informations here.

ANALOG IN 0-5: Analog input pins

Used to read from an analog source (eg potentiometer or a pression sensor)

POWER Pins

Used to get or provide power to the Arduino board

 

Vin:

when using an External Power Supply (see External Power Supply In), this provide the same current which is arriving from the power supply. It’s also possible to provide voltage trough this pin.

Gnd (2 Pins):

Used as ground pins for your projects.

Actually, while searching for the differences between digital ground and the other 2 Ground pins (See Power below), I found a forum posts which says that all 3 ground pins on the Arduino board are actually connected togheter thus the digital ground pin and the 2 ground pins under the power section are actually the same. I didn’t checked on the Arduino Duemilanove internal design on this though.

5V:

This is used to get 5V power from the board. This is the same current that powers the microcontroller. This can came either from Vin (External Power Supply In) or from the USB.

3V3:

A 3.3V power supply which is generated from the FTDI chip. The maximum current draw is 50mA. While reading on the forum it seems that the FTDI chip is pretty a delicate component which can easily burns if subjected to shorts or to much current draws. General consensum is to avoid using this pin power source.

RESET:

By bringing this line to LOW it’s possible to reset the board: there is also a button for doing so on the board but, as additional shields (eg Ethernet Shield) might make the button unreachable, this can be used for resetting the board.

External Power Supply In:

With this we can connect an external power supply to Arduino. A 2.1mm center-positive plug connected to a battery or an AC-to-DC adapter. The current range can be 6 to 20 volts but, in order to prevent overheating and stability problems, the recommended range is 7 to 12 volts.

USB:

Used for uploading sketches (Arduino binary programs) to the board and for serial communication between the board and the computer. Arduino can be powered from the USB port.

  

How to use It?

To use arduino there are some steps. Lets follow it.

Steps:

  • Download the arduino IDE software:

 

Download the software by using this link: https://www.arduino.cc/en/Main/OldSoftwareReleases

Click on “Windows ZIP file for non admin install”

  • Install it:
  • you will get a short cut at desktop.

  • Open the software:
  • Open file/examples and select your required programming code:
  • You can write code by yourself:
  • Compile it by clicking on right sign key:
  • Connect by usb with computer:
  • Select your own board and port from tools: