Arduino Tutorial – Chapter 2.1: Our First Project

Preparing for our Project

Now that you understand what an Arduino is, it’s time to start sampling what it can do.  We’re going to start small, with a project that every new Arduino user has to create – it’s a rite of passage, and it’s called “Blink”.  If you’ve ever written a computer programme, it’s very likely that the first programme you ever wrote printed “Hello World” on the screen.  After this chapter, you can say that your first Arduino sketch went “blink”!

This Chapter will be a little longer than most, as we need to get a few principles under our belt first.  These are important principles, as we’ll be using them again and again – well, for every project really.  Buckle up, let’s get cracking.

Before you start – Basic Precautions

I’m sure that you know how to handle electrical components, but would suggest that you read the few pointers below to make sure that you don’t accidentally overcook your brand new UNO.

Working Space: You should choose a level, uncluttered, well-lit working space to tackle these projects.  You’ll be handling small components which are easily lost, need good light to make sure you plug the right tiny component into the right tiny hole, and need space to lay things out as you work.  Your work surface must not conduct electricity, or build up static electricity – metal and plastic are bad; wood is good.  Your surface will get scratched, so don’t work on your grandfather’s antique mahogany desk.

Static Electricity: Static electricity is the enemy of all things electrical.  You’ll notice that many of the components are shipped in anti-static bags – I’d suggest that you store them that way until you use them.  You should not sit in a chair that builds up static electricity, and ideally should not wear clothes that crackle and spark when you rub them!  You should consider looking at using an anti-static wristband or anti-static working mat, making sure that they’re grounded correctly.

Moisture and Metals: It goes without saying that moisture and metal conduct electricity.  The contacts on the underneath of your UNO are not insulated, so if you accidentally put it down on the screwdriver you were just using, or in a puddle of spilled coffee, you risk smelling that burning smell again… and another trip to your online retailer.

Project Layouts

Each of the projects in the tutorial series will follow the same format.  Before you get going with the Blink project, let’s quickly take a look at how the projects will be presented.

Parts List: At the beginning of each chapter, I’m going to list what you need to build the projects in that chapter.

New Components: This section will go into an explanation on any new components that you haven’t used previously in the book.  We won’t get too technical, but will get into enough detail to enable you use them effectively – both in the projects in this tutorial and on your own.

Schematic Diagram: At the start of each project, you’ll see a schematic diagram of the finished circuit.  A schematic diagram shows how the components of a project are connected together, but not how this looks physically.  Schematics are useful in that they allow you to clearly and logically lay the circuit out.  If you’d like to draw your own schematics, there are a number of software tools to help you.  For this series I’ve used the free version of Eagle CAD – another up-and coming tool is Kicad.

Breadboard Diagram: this is the physical layout on the breadboard or the printed circuit board.  This provides one way you could translate the schematic into a physical layout – there are many other ways to physically lay the circuit out, and you may want to try your own ideas.  The layouts in this book are not designed to be the most efficient or use space optimally – rather they’re meant to be easy to follow.  In the spirit of the Arduino, I’ve used open source software (called Fritzing) to draw these physical diagrams.  Fritzing is free to download, and is a great way for your to record your projects.

Step-by-step Instructions: This section will contain step-by-step written instructions for building the project, and depending on the complexity, there may be step-by-step Breadboard Diagrams.  The steps may include references to particular components on the Schematic or the parts list – for example, if there are 3 different resistors, they will be referred to as R1, R2 and R3.  By using this labelling technique, you’ll be certain that you’ve connected the right component in the right place – and won’t smell that dreaded burning smell!

The Sketch: Building the physical circuit is only half the job done – we need to write the programme that tells the Arduino what we want it to do.  We’ll start building up our knowledge of the Arduino programming environment as we progress through the projects in the book.  All the sketches are available for download off the website, to save you typing them in – although I recommend that you do type them in as it’s the best way to learn.

Let’s Get Started

The “Blink” project is as famous to Arduino as the “Hello World” project is to computer programmers.  It’s a quick introduction to the world of Arduino, and gives you immediate feedback on your learning.  You’ll see from the parts list, that you need an LED (light-emitting diode), a resistor, a breadboard, and jumper wires to connect these components to the Arduino.

Continue with Chapter 2 – The Parts…