Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Learn Arduino Prototyping in 10 days
Learn Arduino Prototyping in 10 days

Learn Arduino Prototyping in 10 days: Build it, test it, learn, try again!

eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Learn Arduino Prototyping in 10 days

The Arduino Platform

"Start from wherever you are and with whatever you have got."
- Jim Rohn

The second chapter of this book is dedicated to laying down a strong technical foundation for the years to come in your Arduino based device development. To start off, we will see what the Arduino platform is all about. Then there will be quick introductory topics regarding fundamentals for getting started. This will be followed by a quick but in-depth look at the first Arduino program (known as a Sketch in the Arduino world).

Things you will learn in this chapter :

  • Explanation of the Arduino platform
  • Basic parts of an Arduino board
  • Procedure to setup an Arduino board
  • Writing a basic C sketch (program) for Arduino
  • Blinking the onboard LED (via pin 13)
  • Setting pin modes for peripheral devices
  • Logical HIGH/LOW voltage values
  • Arduino current supply limits
  • Flash Memory (EEPROM...

Introduction to the Arduino platform

The Arduino platform is a hardware board that offers a hardware-software integrated creative device development platform. The Arduino boards can be interfaced with openly available peripheral devices and custom programs can be written and loaded (embedded) into the Arduino development board:

Figure 1: A typical Arduino Uno development board

These programs in turn control and interact with various peripheral components attached with the Arduino board. Thus by using the Arduino development boards; device designers and engineers can quickly create a running prototype of their imaginations. The best part is that the Arduino hardware and software eco-system is open source.

There are many different types of Arduino boards available in the market. Depending upon the processor speed, number of general purpose input/output pins and different power...

Overview of Arduino prototyping

Developing and prototyping with the Arduino platform is similar to working on any other embedded system. A general overview of the prototyping process is depicted in the following diagram:

Figure 2: Overview of Device Prototyping with Arduino

The first step in the prototyping process is to write the embedded program that we will load into the micro-controller board. The term "embedded" is derived from something being hidden. Since the program is loaded into a micro-controller board which cannot be easily seen or deciphered, therefore the program is referred to as an embedded program. Once the program has been written and compiled successfully, it is loaded into the Arduino Uno board.

Once the program is compiled and loaded into the Arduino Uno development board, the next step is to setup the device prototype. A device prototype is the...

Setting up the Arduino board

In this section we will briefly look at how to setup an Arduino Uno development board and its corresponding Integrated Development Environment (IDE).The process of the first time setup will depend upon the operating system of the computer and is available at the following Arduino Foundation website addresses. It is expected that the reader will perform the setup prior to proceeding further.

Depending upon the Operating System, the Arduino IDE can be downloaded from the following locations on the official Arduino Foundation website:
Windows: https://www.arduino.cc/en/Guide/Windows
Macintosh: https://www.arduino.cc/en/Guide/MacOSX
Linux: https://www.arduino.cc/en/Guide/Linux

As the majority of computer users worldwide use the Windows operating system, this book will provide some practical observations while setting up the Arduino Uno board on...

Arduino program structure and execution

In this section we will study the general structure of an Arduino sketch. After going through this section you will be able to understand the important parts of an Arduino sketch. This section will also explain how each part of an Arduino sketch gets executed in the Arduino development board.

Arduino C programs are called sketches. A basic sketch structure needs at least two functions in the program body. These functions are listed as follows:

  • setup()
  • loop()

These functions should always have a same name that is, setup() and loop(). The Arduino development board is pre-programed to execute a loaded sketch by looking for these two function names in the body of a sketch. So if these two function names are not present in the C sketch, then the Arduino IDE will not even compile the sketch successfully. Instead the following errors will be...

Understanding the first Arduino sketch

Now let us jump into some hands-on activity. In this section we will study an existing Arduino sketch that shipped with the Arduino IDE. The sketch we are going to study is the world famous "blink" program, which is like the Hello World of the embedded programming world. The Arduino IDE installation comes preloaded with a lot of example sketches. All the example sketches are available for use from the File > Examples menu.

Once you attain a minimum level of understanding, you will be able to start exploring more of these examples on your own. Let us inspect and understand the blink program. Fire up the Arduino IDE on your computer and navigate to the File > Examples > 01.Basic > Blink menu. The Blink program will open in a new Arduino IDE window.

The first point to note in the program is the one time configuration that...

Compiling, loading and running a sketch

The first step in the process is to connect the Arduino Uno development board to the Computer using the USB-A to USB-B cable. The USB-A end of the cable will go into the computer's USB-A port. While the USB-B end of the cable will get plugged into the USB-B port on the Arduino board.

Figure 6: USB A to USB B Connector

After the Arduino board has been firmly connected to the computer, launch (or re-launch if already open) the Arduino IDE so that the Arduino board get auto detected by the IDE.

Navigate to the menu, Tools | Port, there should be an auto detected port, COM6 (in the picture shown next). If the port is not selected by default, then go ahead and select it manually.

Sometimes it may take a few extra seconds for the board to get auto detected. If the board fails to get detected try to close the IDE and re-launch the IDE again...

Commonly used in-built C sketch functions

In this section we will quickly look at the commonly used in-built function in the Arduino C sketches. These functions will help us in performing basic tasks while interfacing with various devices. Unless you are attempting advanced sketches, the following functions will be very helpful in building most of the Arduino sketches. Apart from the below in-built functions, device specific header files and functions are also used - we will understand this aspect in the chapter for Day 2 while understanding how to use a header library for a sensor.

C Sketch function Purpose
pinMode(PIN-NUMBER, I/O-MODE) This function is used to specify whether a particular Arduino pin will be used in Input or Output mode.
digitalRead(PIN-NUMBER) This function is used to read digital input from a digital pin. The input value is either LOW or HIGH and...

Digital input and output

In this section, let us look at the commonly used in-built C functions that are used for digital I/O. The following two functions are used for sending a digital signal out via a digital pin. First the digital pin has to be configured in output mode (for sending) in the setup() function:

pinMode(PIN-NUMBER, I/O-MODE) 

Let us say we want to send a digital signal via digital Pin 7, then the following line of code will be used:

pinMode(7, OUTPUT) 

This is how we configure the digital pin in output mode so that it can send digital signals. The next step is to understand how to actually send a digital signal. For sending a digital HIGH signal the following line of code must be used:

digitalWrite(7, HIGH) 

Similarly, for sending a digital LOW signal the following line of code must be used:

digitalWrite(7, LOW) 

Note that some peripheral components might need...

Analog input and output

In this section, let us take a look at the commonly used in-built C functions that are used for analog I/O. To begin with we will learn how analog input is measured by the Arduino sketch. An Arduino sketch uses the following function to obtain an analog reading from its analog pins:

analogRead(<pin-number>) 

For example, if we want to read the analog signal value from analog pin A5, we must use the following function call:

int value;                // declare integer variable 
value = analogRead(A5); // read analog value

The above function will return an integer value between 0 and 1023, depending upon the voltage value on the pin. The number 0 to 1023 will be proportional to the voltage range of the Arduino Uno board i.e. 0 to 5 volts.

Next we will look at techniques to write analog signals on both analog as well as digital pins. Digital pins...

Try the following

Now that we have reached the end of this chapter, let us try to perform some interesting self-learning exercises. These exercises have been devised to simulate your thoughts and enable to utilize what you have learnt so far.

  • Increase the delay between the blinking of the on-board LED to 2 seconds by using the statement delay(2000) in the loop() function.
  • Decrease the delay between the blinking of the LED to 0.5 seconds. Remember 1 second = 1000 milliseconds.
  • Wrap the LED blinking portion of the code in a for loop, to run 10 times.

Things to remember

A list of important concepts that you should remember has been provided so that you can easily recall the main points learnt in this chapter.

  • In the Arduino parlance, a "program" is called a "sketch".
  • Only one sketch can be loaded at a time into the Arduino board.
  • The setup() function runs only once every time the board is either reset or powered up.
  • The loop() function keeps running infinitely.
  • Peripheral devices are connected using the digital and analog I/O pins.
  • Peripheral devices may be powered by using the 5 volt and 3.3 volt power supply pins.
  • The Arduino Uno board has 32 KB of memory. It must be used efficiently for managing complex scenarios.
  • Arduino power supply pins should NOT be used for high powered devices such as motors.
  • As the number of peripheral devices increase, the Arduino board's power supply pins may not be able...

Summary

In this chapter we concentrated on understanding the basics of writing a sketch; loading and executing the sketch in the Arduino board. We also learnt the most commonly used in-built C functions, followed by a detailed understanding to sending and receiving digital and analog signals. So far our journey was focused on the basics and the sketch that we studied was contained within the Arduino Uno board.

In the next chapter we are going to get introduced to building breadboard circuits with external hardware components and then learn how to interface them with the Arduino board. We will also take an in-depth look at various common electronic components used for Arduino prototyping. It is important to grasp the basic concepts as these will go a long way and make you fully self-reliant in your future endeavors.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • ? A carefully designed 10-day crash course, covering major project/device types, with 20+ unique hands-on examples
  • ? Get easy-to-understand explanations of basic electronics fundamentals and commonly used C sketch functions
  • ? This step-by-step guide with 90+ diagrams and 50+ important tips will help you become completely self-reliant and confident

Description

This book is a quick, 10-day crash course that will help you become well acquainted with the Arduino platform. The primary focus is to empower you to use the Arduino platform by applying basic fundamental principles. You will be able to apply these principles to build almost any type of physical device. The projects you will work through in this book are self-contained micro-controller projects, interfacing with single peripheral devices (such as sensors), building compound devices (multiple devices in a single setup), prototyping standalone devices (powered from independent power sources), working with actuators (such as DC motors), interfacing with an AC-powered device, wireless devices (with Infrared, Radio Frequency and GSM techniques), and finally implementing the Internet of Things (using the ESP8266 series Wi-Fi chip with an IoT cloud platform). The first half of the book focuses on fundamental techniques and building basic types of device, and the final few chapters will show you how to prototype wireless devices. By the end of this book, you will have become acquainted with the fundamental principles in a pragmatic and scientific manner. You will also be confident enough to take up new device prototyping challenges.

Who is this book for?

This book is a beginner’s crash course for professionals, hobbyists, and students who are tech savvy, have a basic level of C programming knowledge, and basic familiarity with electronics, be it for embedded systems or the Internet of Things.

What you will learn

  • ? Write Arduino sketches and understand the fundamentals of building prototype circuits using basic electronic components, such as resistors, transistors, and diodes
  • ? Build simple, compound, and standalone devices with auxiliary storage (SD card), a DC battery, and AC power supplies
  • ? Deal with basic sensors and interface sensor modules by using sensor datasheets
  • ? Discover the fundamental techniques of prototyping with actuators
  • ? Build remote-controlled devices with infrared (IR), radio frequency (RF),
  • and telephony with GSM
  • ? Learn IoT edge device prototyping (using ESP8266) and IoT cloud configuration

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 29, 2017
Length: 288 pages
Edition : 1st
Language : English
ISBN-13 : 9781788298544
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jun 29, 2017
Length: 288 pages
Edition : 1st
Language : English
ISBN-13 : 9781788298544
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 96.97
Internet of Things with Arduino Cookbook
€29.99
Learn Arduino Prototyping in 10 days
€29.99
Learning C for Arduino
€36.99
Total 96.97 Stars icon
Banner background image

Table of Contents

12 Chapters
Boot Camp Chevron down icon Chevron up icon
The Arduino Platform Chevron down icon Chevron up icon
Day 1 - Building a Simple Prototype Chevron down icon Chevron up icon
Day 2 - Interfacing with Sensors Chevron down icon Chevron up icon
Day 3 - Building a Compound Device Chevron down icon Chevron up icon
Day 4 - Building a Standalone Device Chevron down icon Chevron up icon
Day 5 - Using Actuators Chevron down icon Chevron up icon
Day 6 - Using AC Powered Components Chevron down icon Chevron up icon
Day 7 - The World of Transmitters, Receivers, and Transceivers Chevron down icon Chevron up icon
Day 8 - Short Range Wireless Communications Chevron down icon Chevron up icon
Day 9 - Long-Range Wireless Communications Chevron down icon Chevron up icon
Day 10 - The Internet of Things Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(13 Ratings)
5 star 76.9%
4 star 23.1%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Joydeep Jun 14, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good book for beginners..
Amazon Verified review Amazon
Suman Bhushan Aug 03, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is possibly the best jump starter book I have laid my hands on.It’s a solid book…very good work to put all important things in one single book. It also teaches all the required things from scratch.
Amazon Verified review Amazon
Amazon Customer Aug 24, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am really fortunate enough to buy this book after searching for last 3 months for an Arduino book for beginner. Very good book to start for Arduino.
Amazon Verified review Amazon
Narayan Hegde Mar 27, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very good book.
Amazon Verified review Amazon
AS Aug 30, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
What better way to teach the next generation how to learn Arduino.This is a must read for all technology enthusiastic, who want to learn how embedded system work in accordance with automation and IoT.This is a smart beginning to learn and implement (DIY) home automation which can be adopted from students to professionals.This book is very well written and structured with all necessary inputs in place to understand the core concept.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.