Introduction to Arduino
In the last number of years, electronics hobbyists all over the world have had one thing on their tongues; Arduino. Thousands of projects on Instructables have featured these boards. But “Arduino-controlled” can be a daunting term for electronics newbies and analogue heads alike. So let’s get stuck into a little about these boards and demystify them.
Arduino isn’t the first microcontroller on the market. Far from it in fact. But in 2003 students at Italy’s Interaction Design Institute Ivrea were spending just shy of $50 US on BASIC Stamp 2 boards. As any student knows, every penny counts. That, and few bar staff take payment in IOU’s. So a combination of factors inspired a small team to build a new, open source board that would eventually become the Arduinos we know today.
Most Arduino boards come either affixed with headers for directly connecting dupont connectors, or vias ready to have wires soldered directly to it. Again, it’s common to find USB connectors on most modern boards in order to interface with them. This is where we’ll start.
Connecting an Arduino board to a computer, using the USB port is the easiest way to get your program onto it. Begin by downloading and installing the Arduino IDE. In the menu, you will have the option to load some of the example sketches to the board. If you’re running the Arduino UNO R3 the blink sketch is a great place to start. This board has a built-in LED meaning you can see your work in action nearly straight away.
Speaking the right language
So you’ve bought an Arduino. You’ve installed the IDE. You’ve loaded the first sketch. Now your screen is filled with code. Arduinos are programmed in a variant of C / C++ designed to make life easier for its users. If you’re new to programming the Arduino website holds a wealth of information about getting started and explanations of different methods. But the simplest and most fun way is to take the sketches that exist and alter the values to get a feel for it.
However anyone with a basic history of programming shouldn’t struggle too much here. There is support for custom libraries and you’ll soon find yourself getting your ideas working. The only downside I find personally is, unlike say Visual Studio, there is little room for error checking. It’s upload and hope a lot of the time.
Making a connection
Making the on board LED flash can seem like a great achievement. However unless your project is a morse code display in a very dark room, that will only get you so far. You may have noticed, or at least we’d hope you’d noticed that your arduino has a series of either holes with copper pads on them, or little black squares that look like you could just about fit a pin into. We shouldn’t advise shoving wires into random sockets but this is a fairly safe bet.
Look to see a pin marked as either digital or D and a number. These pins can be set to either read or write. In other words they will look for a voltage or output one themselves.
Outputs are used to control, as you might have guessed, things like LEDs, Motors, Servos etc. Whereas inputs will be used to take signals from external sources such as buttons or switches. A good example would be, you could use an input button to tell the arduino to turn on an output LED.
Powered by a tiny wizard inside
The secret to the arduino is the little chip sitting on the board. The ATmega328, or variants of it depending on the board you have. This little chip is where the magic happens. Although typically one might be able to write a few KB of code, dependant on the chip, because of the basic nature, this is typically more than enough and in the early stages you’ll be hard pushed to get more than a few percent of the memory filled.
But something I see getting over looked in beginner tutorials is the 1KB of EEPROM. Although you’ll find less in boards running the ATtiny or some other variants. This little pocket of memory can hold important retrievable information. This could be a PIN code in a security project or a board ID in an Arduino robotics project. Kind of like a tiny hard drive, this data is stored, even if you power the board off.
Major Tom, controling GND?
As well as the digital in out, and the analogue pins, we also have a few others. Usually you’ll find a few ground pins, a 5V pin that gives you a constant 5V power and sometimes a 3V3 pin for giving you a 3.3 volt signal. But there’s a few other pins too. You might have ones that say IOREF, AREF, VIN, RESET and more.
- IOREF – Tell’s whatever you connect to it what voltage to expect from the pins as outputs.
- AREF – Is used to set the maximum voltage to expect on the intake of the analogue pins. Since the analogue inputs give you a reading between 0 and 1023. If this is unused, it will sample evenly between 0 and 5V giving you a resolution of about 4.8mV or thereabouts. Good for most things, but if you’re sensors maximum output is 3.3V, you could get a higher more accurate result using this pin.
- VIN – If you don’t have room for a USB power cable or a DC barrell socket on your project, you can use this pin as your power input. Depending on the board, this pin can accept as much as 9V so can be handy for battery powered portables.
- RESET – Resets the board. Simple. Just pull this pin to ground and your board will start from the
Picking the right size
Arduino, and their many… MANY clones come in a number of form factors. Latest counts show in the region of 20 variants. And this is just the officially supported boards today. This doesn’t include the likes of the Duemilanove and the original Mega which are still widely used. So lets take a look at some of the common ones you’ll see, especially when making your first purchase.
We’re number Uno!
The Arduino Uno is the most common board, especially for beginners and for a good reason too. This board comes with 32KB of flash for holding your sketch. 1KB of EEPROM , 6 Analogue Input pins and 14 Digital I/O pins. The small form factor makes integrating into medium sized electronics projects easy, and because of the pre soldered headers connecting your project sensors and buttons is quick and easy.
We need more power, captain!
The Arduino Mega2560 is an absolute beast. I’ve made an effort to separate fact from opinion in this article but let me make this very clear. This is a BEAST. Ok, so you don’t have the full 512KB of the Due but 256KB is nothing to be sniffed at. Add the 4KB of EEPROM that you won’t find on the Due and a massive 54 digital pins, (15 of which have PWM) and a full 16 Analogue inputs, This board will take your sketches and run them as if they were background processes.
Weighing in at just 7g it’s now even easier to give your project a powerful microcontroller base. Though a whopping 32KB of flash means that you can do a lot more than you’d think with such a tiny footprint. With 22 Digital I/O and a rather suprising 8 analogue inputs this little board punches well about its weight.
A quick search will throw up so many wildly varied prices for arduinos and arduino kits. Some, at first, actually look too good to be true; but are they? Lets talk about the originals first. It’s only fair.
The Real Deal
When you purchase a genuine Arduino board, you are buying more than just a cool micro controller for your next project. You are buying peace of mind. Genuine Arduinos use high quality components and are designed to a high specification. They are built exactly as stated in their documentation and will work. There is something to be said for this peace of mind. You are also helping to further the development of future arduino products.
Arudino even features a handy guide for spotting counterfeits.
The “Real” Deal
There are hundreds of Counterfeit arduinos being made by companies all over the world and being pedaled as genuine by unscrupulous sellers. This hardly comes as a suprise in honesty though, as Arduino have said there is nothing wrong with using the schematics they provided to build Arduino clones! All of their boards are released under a “copyleft” licence and released as open source hardware. But they did ask we don’t use the name Arduino. Reasonable enough ask.
These counterfeits are found all over the web and there are reports of these even being sold in legitimate shops. Lets hope that the merchant is ignorant rather than malicious on this. The advantage is that these boards typically work. However the also typically feature lower quality components or omissions. If cost is an issue and you need one for a project, know that these exist but you’re taking a small chance. Remember not one cent of your purchase goes towards the development of new Arduino boards. Make sure the seller has a return policy and don’t forget, Buyer Beware.
Counterfeits are often confused with Clones. As we mentioned before arduino is released as open source hardware. That means, as long as someone doesn’t use the Arduino name, there is nothing wrong with creating clones of these boards. There are advantages to clones. Similar to counterfeits these boards tend to be cheaper. Because each is branded by the company who manufactures them, these boards can be accurately researched and reviewed by users. However again in most of these cases, none of the cost gets reinvested into the development of new Arduino products.
Arduinos are a great development board and are very beginner friendly. Perfect for a wide range of projects and because of the different form factors it’s easy to find one to suit your needs. Genuine, Counterfeit or Clone, make your next project a little smarter with arduino, and arduino compatibles.