Quite some people have asked me lately: “I bought an Arduino a while ago, but I don’t know where to start?” This blog post aims to help those people: A post describing how you can get started with Arduino, learn and moving upwards from there. We will go from a bare Arduino and it’s programming environment, towards the use of shields and then to using discrete components. I will finish with some tips around buying stuff and where to get help.
Let’s get started
So you bought an Arduino or are thinking about buying one? If you haven’t already, then I would advice to buy a Arduino Uno or Leonardo (and while you are at it, buy one or two shields you like, see next paragraph). Arduino + a shield will set you back around 40-60$. Once you have the Arduino in front of you, follow the instructions in the Arduino guide: http://arduino.cc/en/Guide/HomePage
to install the programming environment and the board drivers for you computer. You should now have an Arduino board that is flashing the LED and a working programming environment.
Modify and program blink
The first step in actually programming the Arduino would be to open the blink sketch (just like described in the guide), change the on and off times in the Sketch (a sketch is the Arduino name for a program) so you can see the change for real on the board. Change the first delay(1000) to delay(5000) for instance, but no need to change. Follow the guide and select the right board, serial port and upload. After a few seconds you should now see that the LED is on for 5 seconds instead of 1 second. Congratulations: You have really programmed you first Arduino….Time for coffee and a little celebration ;)
Analog input pins
Another one to get you even more confident: Another sketch that we can use without any external components is AnalogReadSerial (Find at: File-> Examples -> Basics). This sketch reads the analog value of a pin A0 and displays the measured value on the serial interface. Since nothing is connected to this pin, you will get some varying numbers due to electric noise. See that it goes quite fast, let’s make it a little slower and more stable: Add a line after
the “Serial.println” line, saying “delay(1000);” (without the quotes of course).
The second step: Introducing Arduino shields
Next to it’s plug-and-play nature, it’s programming environment and it’s libraries, Arduino is great for starters and more advanced people due to it’s shield availability. Shields are printed circuit boards (pcb) that hold some kind of functionality and that fit exactly on the Arduino main board: You just plug it on, load a sketch and you are running. For this step, I’m advising that you buy one or two shield that you like and get them going. Buy a shield that interests you, like a 16×2 display shield, an Ethernet shield, a wifi shield, an mp3/wav shield or anything you like.
Finding code for shields
Once you have that, just google for the code that is available for that shield “16×2 shield arduino” or “16×2 arduino example”. If you are not sure: Just buy the official Arduino Ethernet shield that comes with an official Ethernet library and examples sketches: http://www.arduino.cc/en/Main/ArduinoEthernetShield. Got that working: Congratulations!
Third step: Real electronics – buying components
Once you get confident with the Arduino you might want to get into even more exciting adventures, like buying real electronics components. Here is a small list with stuff that you will use all the time and won’t set you back to much:
- Bunch of 220R, 1k and 10k resistors (10 or more)
- Bunch 100nF capacitors
- Some LEDS (one color or multiple)
- Some pushbuttons
- One or two LDRs (light dependent resistors)
- Analog temperature sensor like MCP9700
- Optional: Any other sensor or actuator (“motors”) that you like (either on a small or just wired)
Where to buy and get great pricing
You can find this stuff at Sparkfun, Adafruit, ebay or any other electronics site. Or at one of the more professional oriented providers like Digikey, Farnell/Newark, Mouser where you get really good pricing.
Don’t be afraid to blow up stuff
Now with these components you can start playing around, googling how to use them and get some experience. Don’t be afraid to blow stuff up: It will hardly happen and even when it happens, not really a big deal as these are not really dangerous components (like Elco’s) and pretty cheap.
For instance you can hook up a LED to one of the other Arduino pins with a series resistor of 1k (brown-back-red-other color), change the pin number in the sketch and see how your LED is now flashing.
Or hook up the analog temperature sensor to A0 (see picture) and use the AnalogReadSerial sketch to see the impact of temperature change (maybe you can add a formula to get the real tempearture, based on reading the datasheet).
I hope you have as much fun with Arduino as I have: I think it is a fantastic platform to get you started in electronics and have you move towards more advanced electronics in a fantastic step-by-step way. But what if you get stuck? Just google it by describing your problem or components and add arduino to the search term. So here a list of great resources:
- Arduino playground website (information about all kinds of hardware)
- Adafruit learning system/tutorials
- Sparkfun tutorials
Happy hardware hacking!
Want more Arduino and Hardware tips in your inbox?
Do you want to hear more about Arduino, embedded hardware and hardware startups? Click on the “Follow” button on the right, I appreciate it.