Arduino 101
A Technical Reference to Setup and Program Arduino Zero, Nano, Due, Mega and Uno Projects
Obakoma G. Martins
Copyright
Copyright2020 Obakoma G. Martins
All rights reserved. No part of this book may be reproduced or used in any manner without the prior written permission of the copyright owner, except for the use of brief quotations in a book review.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Printed on acid-free paper.
Printed in the United States of America
2020 by Obakoma G. Martins
Table of Contents
CHAPTER ONE
1.0. Introduction
A rduino is an open-source stage utilized for developing electronic projects. Arduino comprises both a physical programmable circuit board (regularly alluded to as a microcontroller) and a bit of programming, or IDE (Integrated Development Environment) that functions on your PC, used to compose and transfer PC code to the physical board. The Arduino stage has gotten very mainstream with individuals simply starting out with gadgets, and for valid justifications. Dissimilar to most past programmable circuit boards, the Arduino needn't bother with a different piece of equipment (called a programmer) in order to stack new code onto the board, you can essentially utilize a USB cable. Furthermore, the Arduino IDE utilizes an improved rendition of C++, making it simpler to figure out how to program. At long last,
Arduino gives a standard structure factor that breaks out the elements of the micro-controller into a more open bundle. Arduino is a programmable circuit board that can be coordinated into a wide assortment of makerspace ventures both straightforward and complex. Due it's adaptability and minimal effort, Arduino has become an exceptionally mainstream decision for producers and beginners hoping to make intelligent hardware projects. With the Arduino board, you will be able to read several inputs such as light on a sensor, a finger on a button, or a tweet and transform it into an output, which might be activating a motor, turning on a LED, distributing something on the web.
An Arduino Board
1.1 Installing the IDE
Perhaps you've just purchased an Arduino, and you're anxious to explore it, however you might be wondering where to start. If you must carry out anything useful on the Arduino, you have to input certain codes into it by installing the Arduino IDE on another computer. The IDE converts the codes you input into instructions that the Arduino can comprehend. When you compose the codes into the IDE, they are sent to the Arduino through a USB cable. The Arduino IDE software download and installation is free and easy to do.
- Visit http://www.arduino.cc/en/main/software to download the most recent Arduino IDE version for your computer's OS. There are forms meant for Windows, Mac, and Linux frameworks. When you're at the download page, click on the "Windows Installer" option to provide you with the quickest installation method.
-Store the .exe document to your hard drive and launch it.
- Press the button to confirm that you agree with the licensing statements.
- Select your most preferred options to install and press Next
- Pick the folders you want the program to be installed to, then press install.
- Hold on for the program to complete the installation and close it.
- Now locate the Arduino shortcut on your computer and open it. The IDE will be opened and the code editor will be displayed.
- Configuring the Arduino IDE.
The next task is to ensure the software is set up for your specific Arduino board. Click on "Tools" drop-down menu, and locate "Board". Another menu will show up, you can choose from a rundown of Arduino models from it.
- Exploring the Arduino IDE
If the need to do this arises, take a moment to peruse the various menus in the IDE. There is a decent variety of model programs that accompany the IDE in the "Examples" menu. These will assist you with becoming familiar with your Arduino immediately without doing much research.
1.2. Setting up the Arduino board
What is on the Arduino board?
There are numerous varieties of Arduino boards that can be utilized for various purposes. A number of the boards appear to be different, however most Arduinos have most of these parts in common:
- Power (USB/Barrel Jack)
Each Arduino board has to be connected to a power outlet. The Arduino UNO can be supplied power from a USB link originating from your PC or a wall socket that ends in a barrel jack. In the image above, the USB port is labelled as (1) and the barrel jack is labelled as (2). In addition, it is through the USB connection that you will input the codes into your Arduino board. However, don't connect to a power supply that is larger than 20 Volts, because this will overpower and damage your Arduino. The suggested voltage for most Arduino models is somewhere in the range of 6 and 12 Volts
- Pins (5V, 3.3V, GND, Analog, Digital, PWM, AREF)
The pins on your Arduino are where you associate wires to build a circuit (most likely in conjunction with a breadboard and some wire. Usually, they have dark plastic 'headers' that enables you to simply plug a wire directly into the board. The Arduino has various types of pins, each of which is marked on the board and utilized for numerous functions.
- GND (3): abbreviated form for 'Ground'. There are numerous GND pins on the Arduino, any of which can be utilized to ground your circuit.
- 5V (4) and 3.3V (5): the 5V pin produces 5voltels of power, while the 3.3V pin supplies a power of 3.3volts. The vast majority of the basic components utilized with the Arduino run on 5 or 3.3 volts.
- Analog (6): The zone of pins under the 'Analog In' name (A0 through A5 on the UNO) are Analog In pins. These pins can analyze the signal from an analog sensor (similar to a temperature sensor) and convert it into a computerized value that is human readable.