Arduino

 
 
Arduino is a single-board open source microcontroller designed around an 8-bit Atmel AVR microcontroller, or a 32-bit Atmel ARM.

Arduino Uno rev3.0

Arduino uno rev 3.0 front

The Arduino board exposes most of the microcontroller's I/O pins, allowing the CPU board to be connected to a variety of interchangeable add-on modules known as shields. Some shields communicate with the Arduino board directly over various pins, but many shields are individually addressable via an I2C serial bus, allowing many shields to be stacked and used in parallel.

Ethernet shield stacked on Arduino Uno

Ethernet shield stacked on Arduino Uno

The current Arduino Uno Revision 3 provide 14 digital I/O pins, six of which can produce pulse-width modulated signals, and six analog inputs. These pins are on the top of the board, via female 0.1-inch (2.5 mm) headers.

The Arduino integrated development environment (IDE) is a cross-platform application written in Java and consists of a standard programming language compiler and a boot loader that executes on the microcontroller. A program or code written for Arduino is called a sketch and are written in C or C++.

Arduino integrated development environment

Arduino integrated development environment

More information about Arduino can be found at: http://www.arduino.cc/







Arduino abbreviations and definitions



Information
none

Operating system used
none

Software prerequisites
none


Abbreviation Description
ANALOG IN Analog input

Arduiono Uno rev 3 has 6 Analog pins (A0-A5).

Arduino power and analog pins

The pins can be used as a 10 bit Analog converter (also known as 10 bit resolution).

2^10 = 1024 (0-1023)

0 = 0V
:
1023 = 5V

breadboard A breadboard or protoboard is a solderless plugboard where electrical components are placed.

How the points are connected with each other see the image below:

Breadboard

Digital pins Arduino Uno rev 3 has 14 digital pins (0 - 13).

Each digital pin supports 0V or 5V (max 40 mA).
If the digital pin is set to HIGH, the digital pin has 5V.
If the digital pin is set to LOW, the digital pin has 0V.

Pin 13 is special, it has a buildin resistor. If the led anode is connected to pin 13 and the cathode to GND, the buildin resistor protects the led (for too high current) by lowering the Voltage over the led.

Led connected to pin 13

Drop down resistor or pull down resistor Usually a drop down resistor is used in combination with a switch. The drop down resistor makes sure the digital pin measures a HIGH (5V) or LOW (0V). If no drop down resistor is used the digital pin measures a noise which can be anything between 0V - 5V. The drop down resistor must have a high resistance value for example 100KΩ.

Drop down resistor

FTDI Future Technology Devices International, commonly known by its abbreviation, FTDI, is a Scottish privately held semiconductor device company. The company's flagship product is its FTDI Chip.

The FTDI chip translates the serial data coming from a serial-enabled device into USB data and vice-versa.

I2C Integrated - Integrated Circuit

I2C has 2 buses:
  • SDA - Serial Data Access
  • SCL - Serial Clock
I2C has 1 master and one or more slaves.
Master genertates clock signals shared by the slaves.

I Current (A = Ampere)

I = U / R
I/F Interface

IMU Inertial Measurement Unit

Is an electronic device that measures and reports on a craft's velocity, orientation, and gravitational forces, using a combination of accelerometers and gyroscopes, sometimes also magnetometers. IMUs are typically used to maneuver aircraft, including unmanned aerial vehicles (UAVs).
LDR Light Dependent Resistor

A photoresistor or Light Dependent Resistor (LDR) is a analog resistor whose resistance decreases with increasing incident light intensity.

LED Light Emitting Diode

A light emitting diode (led) is a semiconductor light source and requires 2-3 V to operate. A led is always protected by a resistor in a series circuit, usually 220 Ohm. The led must be placed in the right direction (long lead connected to +)!

Led orientation

NPN transistor An NPN transistor has 3 pins:
  • (C)ollector
  • (B)ase
  • (E)mitter
If the base has a higher voltage than the emitter, current flows from collector to emitter.
Small amount of current also flows from base to emitter.
More current flows from (C) to (E) depending on the state of the (B)ase pin.
If the voltage on the base increases more current will flow from (C) to (E).

NPN transistor

The direction of the arrow on the emitter distinguishes the NPN from the PNP transistor:
  • If the arrow Points iN, the transistor is a PNP.
  • If the arrow is Not Pointing iN, the transistor is an NPN.
  • Follow the arrow to see the direction of current flow.
Always check the transistor datasheet what the collector, base and emitter leads are.

For example:
The widely used transistor package TO-92 (Transistor Outline package, Case Style 92) has the following leads.

The BC547C (NPN) transistor is using the TO-92 package.

Transistor package TO-92

Usages:
P Power (W = Watt)

P = U * I

parallel circuit Also know as current dividing circuit

The current is divided over its electrical components but the voltage is everywhere equal.

PNP transistor A PNP transistor has 3 pins:
  • (C)ollector
  • (B)ase
  • (E)mitter
If the base has a lower voltage than the emitter, current flows from emitter to collector.
Small amount of current also flows from emitter to base.
More current will flow from (E) to (C) depending on the state of the (B)ase pin.
If the voltage on the base decreases more current will flow from (E) to (C).

PNP transistor

The direction of the arrow on the emitter distinguishes the NPN from the PNP transistor:
  • If the arrow Points iN, the transistor is a PNP.
  • If the arrow is Not Pointing iN, the transistor is an NPN.
  • Follow the arrow to see the direction of current flow.
Always check the transistor datasheet what the collector, base and emitter leads are.

For example:
The widely used transistor package TO-92 (Transistor Outline package, Case Style 92) has the following leads.

The B550D (PNP) transistor is using the TO-92 package.

Transistor package TO-92

Potmeter A potentiometer

Is a three-terminal resistor with a sliding contact that forms an adjustable voltage divider.

Usage:
  • Middle of potmeter connected to an Analog IN pin (for example A0)
  • One side to the 5V pin
  • Other side to the GND pin
By sliding the potmeter you will have 1024 (0-1023) different voltage steps.

2^10 = 1024 (0-1023)

0 = 0V
:
1023 = 5V

Power pins Arduino Uno rev 3 has 5 power pins (3.3V, 5V, GND, GND, Vin).

The power pin 5V can supply a current of max 500 mA.
If an external power source is connected to the power jack the power pin Vin can supply a current of max 1000mA.

Arduino power and analog pins

PWM Pulse Width Modulation

Arduino can not receive or send out analog signals. Instead it uses PWM.

Pulse width modulation

On the Arduino UNO rev 3, the digital pins:
3, 5, 6, 9, 10 and 11 can be used for Pulse Width Modulation.
The digital pin numbers are marked ~.
In total there are 256 steps: 0-255.

R Resistance (Ω = Ohm)

R = U / I
RS-232 An RS-232 serial port is used to connect modems, printers and other peripheral devices to computers.

series circuit Also know as voltage dividing circuit

The voltage is divided over its electrical components but the current is everywhere equal.

Servomotor A servomotor is a rotary actuator that allows for precise control of angular position, velocity and acceleration. It consists of a motor coupled to a sensor for position feedback.

Wiring:
  • Orange - digital channel
  • Red - 5V+
  • Black - GND
sketch A sketch is a Arduino program which is uploaded to and run on an Arduino board.

  • pinMode(pin,OUTPUT);

    set pin in output mode (= send current OUT the pin)
  • pinMode(pin,INPUT);

    set pin in input mode (= send current IN the pin)
  • digitalWrite(pin, HIGH);

    set the digital pin (0 - 13) to HIGH (=5V)
  • digitalWrite(pin, LOW);

    set the digital pin (0 - 13) to LOW (=0V)
  • digitalRead(pin);

    read the digital pin (0 - 13)
  • analogWrite(pin, value);

    set the analog pin (A0 - A6) to a value
    Possible values: 0 - 255
  • analogRead(pin);

    read the analog pin (A0 - A6)
    Possible values: 0 - 1023
  • delay(1000);

    wait 1000 msec
  • Serial.begin(9600);

    sent data to serial monitor at a rate of 9600 baud
  • Serial.println(value);

    sent value to serial monitor
transistor A transistor can be seen as a elecronic switch. See NPN transistor.

A transistor has 3 pins:
  • (C)ollector
  • (B)ase
  • (E)mitter
In front of the base is always a resistor to protect it from high current.

SPI Serial Peripheral Interface
  • MOSI - Master Out Slave In
  • MISO - Master In Slave Out
  • CS - Chip Select Line
U Voltage (V)

P = U * I

UART Universal Asynchronous Receiver/Transmitter

The Universal Asynchronous Receiver/Transmitter (UART) takes bytes of data and transmits the individual bits in a sequential fashion (serial communication).

USB Universal Serial Bus

An USB has 4 pins:
  • Rx - Receiver
  • Tx - Transaction
  • Vin - Voltage (0 - 5 V)
  • Gnd - Ground
TTL Transister-Transistor Logic

Serial I/F (RS-232) works with (logic 1=)-15V (logic 0=) +15V Arduino uses 0-5V TTL

Vin Power Pin max 1000mA

Voltage divider Uout = R2 / (R1 + R2) * Uin

wiring color codes
  • VDD - red
    It is connected to VCC
  • GND - black
    Ground is black
  • Reset - blue
    It "freezes" the processor
  • (U)SCK - orange
    Think of the movie clockwork orange
  • MOSI - green
    Use green / yellow for communications (usually RS232) transmit / receive
  • MISO - yellow
    see above