loading

After some years of experimenting with Arduino, I decided that the time has come to share the knowledge I've acquired. So I here it goes, a guide to Arduino, with the bare basics for beginners and some more advanced explanations for people who are somewhat more familiar with electronics.

Every step will consist of a detailed explanation, then a summary, followed by a more advanced approach.

If you're a complete beginner, I recommend reading the explanation first, and then the summary. There will (almost certainly) be some parts of the explanation you don't understand. Don't worry, it is absolutely normal, it will become clear after reading some other examples in the next steps, just don't get discouraged!

I'll provide some links to the Arduino reference page, Wikipedia, and some other interesting sources. If you want to know more about about a certain subject, these are great places to start. Again, if you don't understand a word of those links, don't worry, it is absolutely not necessary for this Instructable, and especially for beginners, they can be very confusing or even demotivating. If that's the case, it might be better to skip them for now. But don't give up!

Although a tutorial like this might be very helpful, you'll learn mostly by experimenting yourself. Use this Instructable as a starting point, as a reference, but make your own projects, modify the given examples, try new things, search the internet, the possibilities are pretty much endless!

Step 1: What is Arduino?

Well, first things first: What is Arduino?
Let's take a look at the introduction from the Arduino website:

Arduino is an open-source prototyping 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. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing.

That actually says it all.
You can find the complete introduction here.

Maybe a little more information about the board:

The Arduino Board itself is a blue circuit board, the size of a credit card (but they also have models in other sizes). It has two rows of connectors (the 'headers'), a power connector and a USB connector. The brain of the board is an Atmel microcontroller. It's like a really small, very low power 'computer'. (It only has 32KB of storage, 2KB of RAM, and the 8-bit processor runs at only 16MHz.) For most applications, however, this is more than enough. The pins of the processor connect to the headers, and you can connect them to virtually anything you can imagine. You just need to write some lines of code to control them. The I/O pins (Input/Output) can be used as input pins, to connect buttons or knobs, temperature sensors or light sensors, or even keyboards and mouses, digital musical instruments … or they can be used as output pins, to connect LEDs, drive motors, control the lights in your home, connect to small displays or even connect to the Internet, so that it can check your mail, post tweets ... Through the USB connection you can also use it to control your computer, or use your computer to control the Arduino.

As you can see, the sky's pretty much the limit !

You can buy an Arduino on their website or at a local reseller for about $22 (€20).

To get an idea of what you can do with an Arduino board, check out the Arduino blog or the Arduino channel here on Instructables.

(image credit: arduino.cc)

<p>I like it a lot. Very comprensive, clear and practical. The best Arduino Introduction I've read.</p><p>Thank you</p>
What is Arduino?
<p>You're absolutely right, I'll add it to the introduction as soon as I can!</p>
<p>I seriously don't know.<br>I get the gist of what it must be - but I'm not young anymore, and can't keep up with technology... it seems like yesterday that many Instructables were about Raspberry Pi (I don't really know what that is either, but it seemed similar)<br><br>I go back to the old Radio Shack 100 in 1 electronics experimenter gizmo, and all the way back to when not many people had electrified erector sets (just the rich kids)!</p>
<p>Well Mark, I still have my Commodore 64, PET, and VIC 20! However, I just purchased Arduinos and my first RPi 2 B. Downloaded the OS, put on a uSD, connected (huge) monitor thru HDMI, USB keydb, mouse, wifi dongle, and showed off to my wife and daughter. I have been waiting for an article like this to both refresh, enlighten, and educate. It did all of that. The sbc's (single board computers) are a tinker's delight. And I only paid $35 for the Raspberry Pi 2 B. It has everything except a free OS, and I/O devices.</p><p>ttapa, Kudos on the article.</p>
The arduino is a microprocessor it is basically a piece of hardware where you can upload some code to so that code can control flashing lights for excample. The raspberry pi is actually a complete computer that you can connect to a monitor and keyboard but it also has gpio pins so it can do the same thing as an arduino but with more processing power and it is easy to connect to stuff like wifi
<p>I added an introduction, thanks for your comment!</p>
<p>Arduino is a small programmable micro controller (there are many variations)</p>
<p>Check out their home page at arduino.cc</p>
<p>Actually the &quot;Arduino&quot; language isn't &quot;C-like&quot;, it's C++ which will accept ANSI C code with a little more strictness with prototyping and typing. The underlying compiler is GNU C++. (g++) however standard libraries are not there or some functions are severely limited (for example the printf functions do not work with floating point)</p><p>Perhaps this is beyond the scope of a beginner's article, but, full C++ classes can be defined and use, so, for example, you could define a class such as: <br>-- Code -- <br>class digIO {</p><p>private:</p><p>int pin;</p><p>int state;</p><p>int value;</p><p>public:</p><p>digIO(pin, initstate = LOW) {</p><p>this-&gt;pin = pin;</p><p>this-&gt;state = initstate;</p><p>}</p><p>void poll(void) {</p><p>pinMode(this-&gt;pin,INPUT);</p><p>this-&gt;value = digitalRead(pin);</p><p>}</p><p>int get(void) {</p><p>return this-&gt;value;</p><p>}</p><p>int set(int value) {</p><p>this-&gt;value = (value == HIGH) ? HIGH : LOW;</p><p>pinMode(this-&gt;pin,OUTPUT);</p><p>digitalWrite(this-&gt;pin,this-&gt;value);</p><p>}</p><p>};</p><p>then the code could use: <br>digIO pin1(1);</p><p>the poll method could be called in the loop function, or manually. The value that was last set (via the set method) or polled can be retrieved with the get method. The compiler generates nice tight code too!</p>
<p>Great explanation, many interesting examples and source codes, thanks was very helpfull</p>
<p>with</p><p> Ibase-emitter = 0.2A / 97 = 0.00206A &asymp; 21mA</p><p>Is not correct .</p><p> Its 2.1mA (0.00206A x 1000 {to get mA From A} = 2.1) </p><p>I guess you mean driving 2000mA load with Hfe 97, then all is good and tge resitor values will correct. I guess this is true as motors are quite often +500mA with stall around 3 to 6 times of run.... but i do like the article clear :-)</p>
<p>You're absolutely correct, I changed it, thanks a lot!</p>
<p>I face a problem. while plugging Arduino to usb's laptop,the code is working correctly.But once I use battery 9 volt to power the arduino, It do not work.</p><p>any help ?</p><p>thanks in advance</p>
How did you connect the battery? And what code are you running?
<p>What a great post !</p>
<p>This is an excellent article to give anyone interested in an Arduino the nudge they need to get started. Just enough math to cover what is required and nothing so heavy as to scare people away. It is not full of puffery that says &quot;I'm smarter than you are&quot;. </p><p>Although after reading this I realized that I had already learned most of this, some 40 years ago and the rest in the last few months, I enjoyed reading the article. It helped me realize I am doing OK with learning micro-controllers. </p><p>As far as the pull up - pull down stuff you are spot on mentioning this. It is essential for the steps after BLINK. The button sketch is like the third or fourth in the series and knowing (not necessarily a full understanding) about pull up - pull down is essential.</p><p>BRAVO - ENCORE </p>
<p>I like it a lot. Very comprensive, clear and practical. The best Arduino Introduction I've read.</p><p>Thank you.</p><p>J.C.</p>
This is the best article I have seen in a while. I just gave my nephew his first UNO kit, and forwarded him this article. I hope you reads it five times before moving forward with any other projects. Thank you again for your time put into this Instructable.
<p>Thanks! Glad you liked it!</p>
<p>Thanks for your effort</p>
<p>I loved what you did in the first 10 steps. Then you started talking about Pin/Port Manipulation etc and you lost me! In an article where you have to explain what is a capacitor/resistor/pull-up and pulldown resistors, anything beyond blink, arrays (maybe), maybe DC motor control ? is not considered &quot;Beginner's&quot; territory anymore. Is it useful ? Of course! But information overload for a rank beginner!!</p>
<p>You're absolutely right about the fact that this is a bit too advanced for a beginner, nevertheless, I thought it was good to know it exists. The aim of this Instructable was to be useful for intermediate Arduino users as well. I added it in the &quot;Extra&quot; section of the step, thinking that beginners would skip it.</p><p>Thanks for your comment!</p>
<p>where do I find the extension pack?</p>
<p>What extension pack are you talking about?</p>
<p>Thanks for the clear and very helpul instructable, I was looking for such an instructable for a while. </p><p>I just wanted to edit a sentence, which I think is misleading: &quot;Al text placed between the */ /* signs, is a command.&quot;</p><p>It should be like this: &quot;All text placed between the /* and */ signs, is a comment.&quot;</p><p>I'll keep reading and &quot;editing&quot;, if you don't mind :)</p>
<p>Thanks, I'll change it right away!</p>
<p>Wow! Thank you so much for sharing! I'm trying to start learning Arduino, And this is a great start!</p><p>You have my vote</p>
<p>please what is Arduino, just very curious .</p><p>Thank Yvon. 79years young</p>
<p>You can Google anything that you don't know (I do this all the time), I think <strong>An Arduino is basically a small programmable computer</strong></p>
<p>great article. still trying to figure out various applications mostly with r/c drone flight control.</p>
<p>This is a great article. It is like 2 instructables:</p><p>1. introduction to electronics</p><p>2. introduction to arduino</p>
<p>Thank you very much for your nice and comprehensible explanation. I wired a 16x2 LCD and it works OK. Without any problem. </p><p>But after wiring a new &quot;12864 128x64 Dots Graphic Blue Color Backlight LCD Display Module for arduino raspberry pi&quot; bought on Aliexpress it does not work. And as for a new &quot;12864 128x64 Graphic Symbol Font LCD Display Module Blue Backlight For Arduino&quot; bought on Banggood is the situation the same. Could you say the right connections between LCD 128x64 and Arduino Uno? </p><p>Thank you in advance.</p><p>George JF</p>
<p>I have a 128x64 (marked 12864ZW on the back), this one is based on a ST7920 controller.</p><p>It's connected thus</p><p>PSB -&gt; GND for serial (SPI) mode</p><p>RS -&gt; Arduino D10</p><p>R/W -&gt; Arduino D11</p><p>E =&gt; Arduino D13</p><p>I used u8glib to connect to it and the declaration at the top is</p><p>U8GLIB_ST7920_128X64_1X u8g(10); // Hardware SPI, 10 = CS/CE, 11 = MOSI, 13 = SCK</p><p>If you'd like more information, please ask.</p>
<p>Thank you very much. I will try it and send you a message.</p>
<p>It's a bit difficult to help you, since I don't have a display like that myself, but I found some more info on the Arduino Playground: <a href="http://playground.arduino.cc/Code/LCD12864">http://playground.arduino.cc/Code/LCD12864 </a> </p><p>Hope this helps!</p>
<p>Hi, thank you very much for your prompt reply. I will do with it and will inform you about my results. </p>
<p>B4 getting to the end of this doc, went into OVERWHELM! :P :o OMG!</p><p>May have to return at another time. </p><p>Would really like a brief summary of what the &quot;A&quot; stuff can do! And why there's so much interest in it. Without all the voltage details! </p>
<p>Thank you for this explain .</p>
<p>Dear</p><p>Very nice &amp; very helpful and just in plain English. We hope, you will add more instructables like this, please. Thanks.</p>
<p>Hi Sir, this is GREAT help for us biginers!</p><p>Greetings from Croatia!</p>
Great - thank you!
<p>dang this start guide is crazy good</p>
<p>Thank you! (I'm still in the camp of &quot;what is Arduino&quot; also) :)</p>
<p>Excellent!</p>
<p>Did Arduino get the problem with the USB dropping out, fixed?</p>
<p>Very helpful. Thankyou and keep the good works going. All the best.</p>
<p>Very nice!!! This guide even gives a very good basic primer to electronics. I only skimmed it, but it is clear you've put a lot of work into the Instructable. I'll be back, for sure.</p>
<p>Great job! For anyone who wants more info on C programming, there are a bunch of free tutorials online. I googled &quot;free C tutorial&quot; and got over 200 million hits! As for a readable book, I like the 2nd ed of Beginning C for Arduino (reviews on Amazon).</p>
<p>You've got my vote. Excellent job!</p>

About This Instructable

99,299views

1,530favorites

License:

More by tttapa:Raspberry Pi AirPlay receiverHow to install Ubuntu 14.04 alongside WindowsGetting started with Ubuntu
Add instructable to: