Book Image

Arduino Android Blueprints

Book Image

Arduino Android Blueprints

Overview of this book

Table of Contents (17 chapters)
Arduino Android Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 6. Android Phone Sensor

In this book so far, we have used an Android device to control Arduino projects and get readings from sensors connected to the Arduino board. In this chapter, we will do something different: we will use the phone's sensors to control an Arduino board.

We will connect a servomotor to an Arduino board so that it can be controlled from the Android phone. A servomotor is basically a motor whose angular position can be precisely controlled by a microcontroller. We will use BLE once more to receive commands from the Android device.

On the Android side, we will basically measure data coming from the phone's gyroscope sensor continuously and convert this data into meaningful commands for the servo. The goal is that the servo motor continuously follows the movement of the Android device.

In this chapter, you will learn how to:

  • Connect a servo motor to the Arduino platform

  • Write a sketch to receive commands via BLE

  • Write an Android application to control the servomotor using...