Are you new to Arduino? Open hardware like the Arduino Starter Pack from Adafruit is a great way to start tinkering with this small computer board. It is the ideal kit for beginners to open hardware or anyone looking to start a project using the Arduino microcontroller.
To start, you need a computer from which you will write the code that will run in the Arduino board. This starter pack comes with an Arduino Uno board, which is likely the simplest. The typical programming cycle is to first write your code on the computer, then upload it to the Arduino board via a standard USB cable. The Arduino softwareis available for Linux, Mac, and Windows.
Note: a similar starter kit is available on the Arduino website.
When I started tinkering with my Ardunio Starter Pack, I followed the instructions on the website for installing the packages for Linux (Ubuntu 12.10):
sudo apt-get update
sudo apt-get install arduino arduino-core
At this time, I paused to thank Linux packagers, Scott Howard and Philip Hands, for their awesome job maintaining the Arduino and Arduino-core packages for Debian.
Then, I accessed the Arduino tutorials, where there are plenty of example projects, and picked this LED project.
Steps for an LED Arduino project
Hardware
- Take one of the red LEDs in the package and connect the short leg (cathode) to the ground pin (GND) of the Arduino UNO board.
- Connect the LED long leg (anode) to the bread broad circuit.
- Take one 1K Ohms resistor (brown, black, red) and connect it to the pin 13 in the Arduino board. If you are new to reading resistor colors, try this Graphical Resistor Calculator.
- Connect the other end of the resistor, to the same row where the LED leg is, on the bread board.
- Connect the USB cable from the Arduino to the laptop.
Software
- Launch "Arduino" application from the command line
- Enter the code below (from the Arduino example page)
/* Blink Turns on an LED on for one second,
then off for one second, repeatedly.
This example code is in the public domain.
*/
// Select the pin number where we will connect
// the LED, and 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
}
Finally, use CTRL+U to upload the program in the Arduino (or use the File Upload menu). See the LED blinking at 1 second intervals.
The whole process took about half an hour, from unpacking to blinking success!
At this point, I connected the power supply to the board and unplugged the USB cable. The Arduino board continued running the code, and the LED went on blinking happily.
Another great test to try here is the fading LED.
The Arduino board can also read values from electronic components and use them as part of the program logic to drive other components. So, next I tried out the fading LED where a potentiometer (included in the kit) is used to fade our LED friend.
At this point, I got bold enough to venture into modifying a tutorial / example. I tried combining the photoresistor (included in the kit), to change the brightness of the happy LED.
Making the jump, from following tutorials / examples step by step, to trying your own modifications is a great and important step. It is critical to learning in general, and for tinkering with open hardware specifically. This is good to keep in mind if you plan to show others or teach kids. To avoid frustration, and long debugging sessions, it is important to start simple, and to progress by very small incremental steps, gaining mastery as you go.
The Arduino Starter Kit is a great collection of components. This kit ensures that you have what you need to take the first steps into open hardware or tinkering with an Arduino, without any frustration or setbacks. In a matter of hours, get up to speed on open hardware, programming, and tinkering with electronics. Combine the kit with the wealth of information on the Arduino site, and with the support of a very large community, and you're sure to have an enjoyable experience.
Many other introductory materials are available for Arduino beginners too, like these books and video tutorials. For one, the ABC Arduino book provides a set of key schematics that are clearly drawn and brightly colored, with just the infomation you'll need to make wired connections with the Arduino board.
View the complete collection of Open Hardware Week articles.
5 Comments