Primer GETTiNG STARTED be fore you StArt building witH tHe Arduino tHere Are A few tHingS you need to know And do firSt let’S tAke A look At tHe HArdwAre And SoftwAre you’ll need for tHiS book tHen you’ll teSt out tHe Arduino witH A SimPle led Project And get StArted witH A few tecHniqueS tHAt will come in HAndy like Soldering And downloAding uSeful code librArieS
FigurE 0-1 The Arduino Uno board hArdwAre First let’s look at the Arduino Uno board and a few pieces of hard ware that you’ll use in almost every project the Arduino uno There are numerous types of Arduino boards available but this book uses only the most popular one the Arduino Uno shown in Figure 0-1 The Arduino Uno is open source meaning its designs may be freely copied so as well as the official board which costs about 25 you will find numerous compatible clone boards for around 15 RESET BUTTON USB CHIP 14 DIGITAL IN OUT PINS 0 13 USB SOCKET SURFACE MOUNT PIN 13 LED TX RX LEDS ICSP HEADER ATMEGA328P CONTROLLER POWER SOCKET 2 1 MM BARREL TIP 9 VOLTS POWER PINS 6 ANALOG IN PINS 0 5 The Arduino controls components you attach to it like motors or LEDs by sending information to them as output information sent out from the Arduino Data that the Arduino reads from a sensor is input information going in to the Arduino There are 14 digital input output pins pins 0 13 on the Arduino Each can be set to either input or output see Arduino Pin Reference on page 253 for a full pin refer ence table Power When you connect the Arduino Uno board to your PC to upload a program it is powered from your computer’s USB port When the Arduino is not linked to your PC you can have it run independently by connecting it to a 9-volt AC adapter or 9-volt battery pack with a 2 1 mm jack with the center pin connected to positive power as shown in Figure 0-2 Simply insert the jack into the power socket of the Arduino 3 Primer
FigurE 0-2 A 9-volt battery pack which you can plug into the Arduino to give it power breadboards A breadboard acts as a construction base for electronics prototyping You’ll use a breadboard for all of the projects in this book instead of soldering parts together The name breadboard dates back to when electronics projects were created on wooden boards Hobbyists hammered nails into the wood and wrapped wires around them to connect components without having to solder them permanently Today’s breadboards are made of plastic with predrilled holes called tie points into which you insert components or wires which are held in place by clips under neath The tie points are connected by lengths of conductive material that run beneath the board as shown in Figure 0-3 FigurE 0-3 Breadboard connections THESE PINS ARE CONNECTED HORIZONTALLY THESE PINS ARE CONNECTED VERTICALLY THERE ARE BREAKS IN THE BOARD IN THESE PLACES 5V AND GND ARE ON BOTH SIDES OF THE BREADBOARD Breadboards come in various sizes To build the projects in this book you’ll ideally need three breadboards one full-size typically with 830 holes one half-size with about 420 holes and one mini board with 170 holes The full-size breadboard is ideal for projects 4 Primer
that use an LCD screen or a lot of components and the half-size and mini boards are best for smaller projects For the projects in this book I recommend that you buy breadboards that look like the one shown in Figure 0-3 with red and blue lines and a center break between the holes The main board area has 30 columns of tie points that are connected vertically as shown in Figure 0-3 You’ll often have to position components so they straddle the breadboard’s center break to complete your circuit This break helps to prevent components from short-circuiting which can derail your project and even damage your components You’ll learn more about this as you start to build The blue and red lines at the top and bottom are power rails that you use to power the components inserted in the main breadboard area see Figure 0-4 The power rails connect all the holes in the rail horizontally the red lines are for positive power and the blue lines for negative power or ground as you’ll often see it called Tip It’s useful to use red wires for connections to 5V and black wires for connections to ground GND The rest of the wires can be your choice of color FigurE 0-4 Positive and negative breadboard rails Jumper wires You’ll use jumper wires to make connections on the breadboard Jumper wires are solid-core wire with a molded plastic holder on each end that makes it easier to insert and remove the wires You could use your own wire if you have it but make sure to use solid core wire stranded wire is not strong enough to push into the hole clips When you insert a jumper wire into a breadboard hole it’s held in place from beneath the board by a small spring clip making an electrical connection in that row You can then place a component in an adjoining hole to help create a circuit as shown in Figure 0-5 5 Primer