Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Internet of Things with Arduino Cookbook

You're reading from   Internet of Things with Arduino Cookbook Build exciting IoT projects using the Arduino platform

Arrow left icon
Product type Paperback
Published in Sep 2016
Publisher Packt
ISBN-13 9781785286582
Length 188 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Marco Schwartz Marco Schwartz
Author Profile Icon Marco Schwartz
Marco Schwartz
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Connecting an Arduino to the Web FREE CHAPTER 2. Cloud Data Monitoring 3. Interacting with Web Services 4. Machine-to-Machine Interactions 5. Home Automation Projects 6. Fun Internet of Things Projects 7. Mobile Robot Applications Index

Using distance sensors


For now, we are able to control our mobile robot, but except if we directly look at it, we have no way of knowing if there is an obstacle in front of it.

This is where ultrasonic sensors come into play: they are an easy, inexpensive way to know precisely if there is something in front of the mobile robot, and at what distance. In this recipe, we'll add an ultrasonic sensor to our robot and integrate it into the interface.

Getting ready

The first thing you need is, of course, an ultrasonic sensor. For this project, I used an URM37 ultrasonic sensor from DFRobot:

This is the back of the sensor, showing all the pins:

You can now mount the sensor on the robot's chassis, putting the sensor in front of the robot.

Then, you can refer to the documentation at http://www.dfrobot.com/wiki/index.php?title=URM37_V4.0_Ultrasonic_Sensor_(SKU:SEN0001) to find the pins of the sensor.

Basically, you need to connect the VCC pin to the VCC pin of the Arduino board, GND to GND, and pin number...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime