Book Image

Android Things Quick Start Guide

By : Raul Portales
5 (1)
Book Image

Android Things Quick Start Guide

5 (1)
By: Raul Portales

Overview of this book

Android Things is the IoT platform made by Google, based on Android. It allows us to build smart devices in a simple and convenient way, leveraging on the Android ecosystem tools and libraries, while letting Google take care of security updates. This book takes you through the basics of IoT and smart devices. It will help you to interact with common IoT device components and learn the underlying protocols. For a simple setup, we will be using Rainbow HAT so that we don't need to do any wiring. In the first chapter, you will learn about the Android Things platform, the design concepts behind it, and how it relates to other IoT frameworks. We will look at the Developer Kits and learn how to install Android Things on them by creating a simple project. Later, we will explore the real power of Android Things, learning how to make a UI, designing and communicating with companion apps in different ways, showcasing a few libraries. We will demonstrate libraries and you will see how powerful the Android Things operating system is.
Table of Contents (10 chapters)

Servos

Besides relays, servo motors are one of the most interesting and versatile components that are frequently used on IoT projects. A servo motor can turn itself to a determined angle with high precision. They can be used to steer a robot car, orient a camera, as actuators on a robotic arm, and so on. They are -obviously- controlled using PWM.

Robotic arms and camera brackets rely on servos

Servos use PWM in a particular way. They do not read the duty cycle in the way you would expect; they do check the length of the pulse. That length is not related to a percentage of the period, but an absolute number. A servo expects this value to be sent about every 20 ms, so we will work at 50 Hz. Repeating the signal is important to make the servo return to that position if it was moved -i.e. by brute force- but without an external interaction, the servo will simply stay in the last...