Mastering Arduino
eBook - ePub

Mastering Arduino

A project-based approach to electronics, circuits, and programming

Jon Hoffman

Share book
  1. 372 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Arduino

A project-based approach to electronics, circuits, and programming

Jon Hoffman

Book details
Book preview
Table of contents
Citations

About This Book

Mastering Arduino is a practical, no-nonsense guide that will teach you the electronics and programming skills that you need to create advanced Arduino projects.

Key Features

  • Covers enough electronics and code for users at any level
  • Includes complete circuit diagrams for all projects
  • Final robot project combines knowledge from all the chapters

Book Description

Mastering Arduino is an all-in-one guide to getting the most out of your Arduino. This practical, no-nonsense guide teaches you all of the electronics and programming skills that you need to create advanced Arduino projects. This book is packed full of real-world projects for you to practice on, bringing all of the knowledge in the book together and giving you the skills to build your own robot from the examples in this book. The final two chapters discuss wireless technologies and how they can be used in your projects.

The book begins with the basics of electronics, making sure that you understand components, circuits, and prototyping before moving on. It then performs the same function for code, getting you into the Arduino IDE and showing you how to connect the Arduino to a computer and run simple projects on your Arduino.

Once the basics are out of the way, the next 10 chapters of the book focus on small projects centered around particular components, such as LCD displays, stepper motors, or voice synthesizers. Each of these chapters will get you familiar with the technology involved, how to build with it, how to program it, and how it can be used in your own projects.

What you will learn

  • Explains the basics of electronics and circuits along with the Arduino IDE and basic C operations
  • Use sensors to build a mini weather station
  • Control LEDs using code
  • Power a robot arm using stepper motors
  • Remotely control your Arduino using RF, Bluetooth LE, and Bluetooth Classic
  • Make a sound tone generator with buttons

Who this book is for

Mastering Arduino is for anybody who wants to experiment with an Arduino board and build simple projects. No prior knowledge is required, as the fundamentals of electronics and coding are covered in this book as well as advance projects.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Arduino an online PDF/ePUB?
Yes, you can access Mastering Arduino by Jon Hoffman in PDF and/or ePUB format, as well as other popular books in Computer Science & Hardware. We have over one million books available in our catalogue for you to explore.

Information

Year
2018
ISBN
9781788831628
Edition
1

Bluetooth LE

In this book so far, all external communication with our Arduino projects has been in a closed environment. By closed environment, we mean that our project simply received information or direction from a remote control and no information was transmitted out from the project. There are numerous use cases where we need to transmit information from our Arduino project to an external device such as a smartphone or other IoT device. When there is a need such as this, one of the first technologies that is brought up is Bluetooth Low Energy, also known as Bluetooth LE or Bluetooth Smart.
In this chapter, you will learn:
  • What Bluetooth LE is
  • How the Bluetooth LE radio works
  • What the GAP profile is
  • What the GATT profile is
  • How to use the HM-10 Bluetooth LE radio module with the Arduino

Introduction

One of the most common misunderstandings of Bluetooth LE by people that are not familiar with the technology is that Bluetooth LE is a lightweight subset of Bluetooth Classic. This is not true, as Bluetooth Classic and Bluetooth LE are two fundamentally different protocols with different design goals.
Most wireless technologies, such as Wi-Fi and Bluetooth Classic, were designed to satisfy a wide range of use cases; however, the design of Bluetooth LE is a bit different. Originally created by Nokia and known as Wibree, the primary design focus of Bluetooth LE was to create a radio standard with the lowest possible power consumption and optimized for low cost, low complexity, and low bandwidth.
Bluetooth LE specifications were released as part of the Bluetooth 4.0 Core specifications in June of 2010. The Bluetooth Core Specifications are overseen and updated by the Bluetooth Special Interest Group (SIG).
You can find information about Bluetooth and download the specifications from their site at https://www.bluetooth.com; however, at over 2500 pages, I would recommend that you read this chapter instead of the Bluetooth specifications unless you are looking for help with insomnia.
The adoption rate of Bluetooth LE has been much faster than most other wireless technologies. The reason for this is the adoption of the Bluetooth LE standard in the mobile industry where Apple and Google have put significant effort into including reliable Bluetooth LE stacks with the iOS and Android operating systems and developing easy-to-use-and-understand Bluetooth LE APIs for developers. This makes it very easy for developers to create and interact with devices that have Bluetooth LE radios.
The reason that the mobile industry has been pushing for the adoption of Bluetooth LE is that devices that connect using Bluetooth LE consume far less power, hence the name Bluetooth Low Energy, as compared to other wireless technologies such as Bluetooth Classic and Wi-Fi. This leads to longer battery life for their phones, which leads to happier customers.
Bluetooth devices come in three types, where each type supports either Bluetooth Classic, Bluetooth LE or both. The following chart shows what each type supports:
Device Type
Bluetooth Classic Support
Bluetooth LE Support
Pre-4.0 Bluetooth
Yes
No
Single-Mode
No
Yes
Dual-Mode
Yes
Yes
While the Bluetooth 5.0 specifications were released in June of 2016, at the time this book is being written, there are very few Bluetooth modules for the Arduino that support this new specification. In fact, at this time, there is very little support for the Bluetooth 4.1 or 4.2 specifications either; therefore, in this book, we are going to focus on the Bluetooth 4.0 specifications, knowing that Bluetooth 5.0, 4.2 and 4.1 are all backward compatible with this standard.
In order to design IoT devices that use Bluetooth LE we really need to understand the technology so we know when actually to use it. Therefore, we will delve into this technology a lot further than we have with other technologies in this book. We will start off by looking at the radio specifications.

Bluetooth LE radio

Since we will be using Bluetooth LE 4.0 for all the projects in this book, the following specifications are for this standard:
Range
Up to 100 meters
Radio Frequency
2.402 - 2.481 GHz
Radio Channels
40 (37 data and 3 advertising)
Maximum OTA Data Rate
1 Mbit/s
Application Data Throughput
0.125 Mbit/s
Network Topologies
Point-to-Point
Network Standard
IEEE 802.15.1
Bluetooth LE has a maximum range of 100 meters, but this is very dependent on the surroundings. When the connected devices are indoors, the range will be dramatically reduced due to walls and other obstacles that the radio s...

Table of contents