New product in town! The Månsteri Starter Kit With Arduino Uno! It contains all the basic components that will get you started on your path to Arduino enlightment.

Kit

This post is the first of several tutorials for the Arduino Starter Kit. More to follow soon.

The first thing to do is to unpack the kit and find out what exactly is included.

Step 1 – Identify the Different Parts

Arduino UNO SMD

UNO SMD

The latest Arduino USB board. Currently our kits come with the Arduino UNO SMD board.

Half-size Breadboard

Breadboard

Breadboards are used to prototype electronic circuits without having to do any soldering. The kit includes a transparent or white half-size breadboard with 400 tie points.

USB Cable 1.8 Meters

USB

Standard A to B USB cable for uploading code to the Arduino.

Jumper Wire Kit (75 wires)

Wires

A nice selection of jumper wires for building your circuits on the breadboard. Different colors and lengths.

Light Dependent Resistor

ldr

The resistance of this component changes according to the amount of light. Use it as an ambient light sensor.

10K Potentiometer

Potentiometer

Everyone should have at least one of these. A standard 10K linear potentimeter.

Push Button Switch

Button

A momentary push button switch. There will be one of these in the kit, but the color might be different (black, white, red, green, blue or yellow).

LEDs

LEDS

Three super bright LEDs. Three different colors. Red, Green and Blue. Use the 180 Ω resistors when connecting these to the Arduino. Please note that they all look the same (clear) when not lit.

Also note that the other leg of the LED is longer than the other. The longer leg is the anode and should be connected to the positive side of your circuit (VCC). The shorter leg is the cathode and should be connected to the negative side (GND).

Resistors

Resistors are used to limit the amount of current flowing in your circuit. The kit contains 15 metal film resistors. Three different values, five pieces of each value.

5 x 180 Ω resistor (1% tolerance)

180

5 x 1 KΩ resistor (1% tolerance)

1K

5 x 10 KΩ resistor (1% tolerance)

10K

Capacitors

Capacitors are like small batteries that can store a small amount of electrical charge. Can be used for many things, but most often used for filtering and smoothing. You will get two different capacitors in the kit:

10 uF/100V

Capacitor 10 u

100 uF/63V

Capacitor 100 uF

Step 2 – Install the Arduino Software

Ok. Now you have all of the parts laid out on your table. Leave them there for now. The second step is to install the Arduino software and to make sure that you are able to upload code to the Arduino.

The Arduino website has great instructions on how to install everything, so I'm not going to repeat everything here. Follow the Getting Started instructions for your operating system: http://arduino.cc/en/Guide/HomePage

Here is a quick summary anyway:

  • Download and install the software from: http://arduino.cc/en/Main/Software follow the instructions for your operating system.
  • The next step depends on your operating system:
    • If you are on Mac OS X or Linux, you are done. The Arduino UNO does not require any additional drivers
    • If you are using Windows, follow these instructions: http://arduino.cc/en/Guide/Windows
  • Connect your Arduino UNO board to your computer with the USB cable

When you connect the Arduino board to your computer, you will notice that the LED on the board marked L starts blinking. That is actually a program running on your Arduino. All Arduinos leave the factory with this basic program that blinks the LED once every second.

While you are looking at the blinking LED. Take a closer look at the board itself. What are all those connectors for?

UNO SMD

  • The USB connector we already figured out. It's for connecting the Arduino to your computer.
  • The DC Power Jack is used to power the Arduino with an AC-DC power adapter or a battery. The power supply should be between 7-12 V DC with a 2.1 mm center-positive plug.

There is also a bunch of those black header pins on the top and the bottom. Let's go through those quickly.

  • DIGITAL 0-13 – The pins in the top row are used as digital inputs or outputs. Digital means ON or OFF, 1 or 0, HIGH or LOW, 5 volts or 0 volts. Each pin can be configured to be either an input or an output. Inputs are used to read digital signals like buttons or switches. Outputs are used to drive things like LEDs or motors.
  • PWM~ – Pins 3, 5, 6, 9, 10, 11 in the top row can also be used as PWM outputs. PWM (Pulse Width Modulation) is a way to "fake" analog output with a digital signal. These pins can be used to fade LEDs, control the speed of motors etc.
  • ANALOG IN A0-A5 – These pins are used for analog input. They can measure voltages between 0 and 5 volts. Sensors with analog output are connected to these pins.
  • POWER – These pins are used to provide power to external components you would like to use with the Arduino.

Some of the pins also have specific functions. More details on them in later tutorials or from the Arduino site.

Now that we roughly now what the different pins are for, let's try to make that LED blink in a little bit faster.

Step 3 – Your First Arduino Program

Open the Arduino application. You should see something like this:

Arduino

If you have ever used Processing, the interface might feel strangely very familiar to you.

The most important thing to do first is to make sure we have the right serial port and the right device selected from the Tools menu. Go to Tools > Board from the menu and select Arduino UNO (or whatever board you are using).

Board

Next select the correct Serial Port. Go to Tools > Serial Port and select the right port. On Mac and Linux it will look someting like the picture (usbmodemXXXX). On Windows you have to go to Device Manager and check which COM port your Arduino is.

Screenshot 3

Next open the Blink example sketch that comes with Arduino. You should find it from File > Examples > 1.Basics > Blink

Screenshot 4

This is the same one that is running on your board right now, but let's make sure everything is OK by uploading this code to the Arduino. Press the upload button to upload the code. If everything goes well, the TX and RX LEDs should blink for a few seconds and then it should say "Done uploading" on the bottom part of the Arduino window.

Upload Button

Let's take a closer look at the code.

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

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:  
pinMode(13, OUTPUT);
}

void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000);            // wait for a second  
digitalWrite(13, LOW);  // set the LED off  
delay(1000);            // wait for a second
}

The first part is greyed out and inside /* */ symbols. That means that those lines of text are comments and the Arduino is going to ignore those parts. They are used to somment the code and make it undestandable. You can also comment things by using //. Everything written after that on the same line is a comment.

All Arduino programs need to have two functions: setup() and loop().

Everything written inside the curly brackets after void setup() is part of the setup() function.

Everything written inside the curly brackets after void loop() is part of the loop() function.

setup() gets run only once when Arduino starts or resets. You will do all the things that need to be done only once inside the setup(). In this case, the setup looks like this:

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:  
pinMode(13, OUTPUT);
}

As you might remember all of the digital pins can be either inputs or outputs. Therefore, we must define in the setup if the digital pins we want to use should be inputs or outputs. In this case, we want to use the digital pin 13 as an output. Why pin 13? Because pin 13 is internally connected to the LED marked L on your Arduino and we can use that before we start building our own circuits.

loop() gets repeated over and over as long as the Arduino has power. Your main program code is going to be inside the loop(). In this case, the loop looks like this:

void loop() { 
digitalWrite(13, HIGH); // set the LED on 
delay(1000);            // wait for a second  
digitalWrite(13, LOW);  // set the LED off  
delay(1000);            // wait for a second
}

The comments explain the code already quite well. We call digitalWrite() to turn a digital output pin HIGH or LOW. HIGH means 5 volts and LOW means 0 volts. The number 13 is the pin we wish to control.

The delay(1000) tells the program to wait for one second (1000 milliseconds = 1 second).

Our goal was to make the LED blink faster, right? So the only thing to do now is to change the delay values. Try changing them both to 100. Or whatever you feel like! This is the fun part where you start experimenting. Just remember to press upload after making your changes.

You could even copy and paste the lines inside loop to make more complicated blinking patterns. Can you make it blink SOS in morse code?

That's it! Stay tuned for the next part of the Starter Kit tutorials.