Raspberry Pi Sensors
eBook - ePub

Raspberry Pi Sensors

Rushi Gajjar

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

Raspberry Pi Sensors

Rushi Gajjar

Book details
Book preview
Table of contents
Citations

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 Raspberry Pi Sensors an online PDF/ePUB?
Yes, you can access Raspberry Pi Sensors by Rushi Gajjar in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Engineering. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781784393618

Raspberry Pi Sensors


Table of Contents

Raspberry Pi Sensors
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Meeting Your Buddy – the Raspberry Pi
A glance at the Raspberry Pi board
Setting up for the first time
Installing the operating system
Purchasing your SD card
Downloading the required software
Windows
Mac OS X
Linux
Expanding the root filesystem
Logging in to the RasPi
Opening the desktop
Connecting the Raspberry Pi to the Internet
Internet connection through Wi-Fi dongle
Internet connection through Ethernet from a PC
Editing the command-line file of the RasPi
Turning on the RasPi
Changing cmdline.txt again to add the PC's Ethernet port IP address
Sharing the Internet connection between your PC and an Ethernet connection
Installing and opening the free SSH client on your PC
A crash course on Linux
The terminal and shell
Useful and frequently used Linux commands
Installing useful libraries
git-core
wiringPi
python-gpio
Be ready with Python and C
Writing and executing the Python program
Writing and executing the C program
Practice makes you perfect
Summary
2. Meeting the World of Electronics
Basic terminologies of electronics
Voltage
Current
Resistor
Capacitor
Open circuit and short circuit
Series and parallel connections
Pull-up and pull-down resistors
Communication protocols
UART
Serial Peripheral Interface
Inter-Integrated Circuit
Useful tips and precautions
Understanding the GPIO port
It's time to glow LEDs!
Shell script and GPIO
LED blink and Python
Let's blink the LED with C code
Summary
3. Measuring Distance Using Ultrasonic Sensors
The mysterious ultrasonic sensor
Distance calculation
Building the project!
Hardware setup
Software setup
Initial configuration
Setting the GPIO pins on the default mode
Sending and receiving the pulses
Calculation of distance
Fixing common problems
Is it showing the distance incorrectly?
Is the module not responding?
Are you measuring the distance less than 2 cm?
A wearable device for the visually impaired
Building the hardware
Software setup
Summary
4. Monitoring the Atmosphere Using Sensors
Sensor selection process
Criticality of an application
Selecting a sensor package
Sensor properties
Purchasing the sensor
Available sensors
InsideDHT – temperature and humidity sensors
Introducing the photoresistor (photocell)
Building the project
Hardware setup
Breadboard setup
Preparing the code
Code the DHT sensor and measure relative humidity and temperature
Code the LDR sensor and measure light variations
Putting all the parts together
Troubleshooting common problems
Received DHT data is not valid
The LDR sensor gives a zero value
Is the voltage correct?
Summary
5. Using an ADC to Interface any Analog Sensor with the Raspberry Pi
Analog-to-digital convertors
Data reception and signal conditioning
Amplification
Sampling and quantization
Types of ADC
Resolution of the ADC
The math behind ADC
Data output
MCP3008 for analog-to-digital conversion
Channels
Ground
SPI
Reference voltage
Supply voltage
Making your own sensor station
Generic software preparation
Using your sensor station – make a temperature logger
Know the LM36 temperature sensor
Write the application
Summary
6. Uploading Data Online – Spreadsheets, Mobile, and E-mails
Internet of Things
Sensor nodes
Communication
The cloud
Data analytics
Security concerns
Hardware setup
Synchronizing the clock with the Internet
Uploading data on Google spreadsheets
Live feed on mobile phones
Getting notified by e-mails
Integrating everything
Common problems faced
Summary
7. Creating an Image Sensor Using a Camera and OpenCV
Image processing
OpenCV
Camera interfacing with the RasPi
The RasPi camera modules
USB webcam
Live streaming using a network camera
Porting OpenCV
Testing
Create a motion detector
Preparing shell to compile OpenCV and wiringPi
Amazing projects for you
Summary
A. Shopping List
Basic requirements
Sensors
Integrated chips
Components
Others
Index

Raspberry Pi Sensors

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2015
Production reference: 1240415
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-361-8
www.packtpub.com
Cover image by Rushi Gajjar

Credits

Author
Rushi Gajjar
Reviewers
David Alcoba
Siddharth Bhave
CĂ©dric Verstraeten
Commissioning Editor
Amarabha Banerjee
Acquisition Editor
Owen Roberts
Content Development Editor
Natasha Dsouza
Technical Editors
Tanmayee Patil
Shiny Poojary
Sebastian Rodrigues
Copy Editors
Karuna Narayanan
Vikrant Phadke
Project Coordinator
Rashi Khivansara
Proofreaders
Simran Bhogal
Safis Editing
Clyde Jenkins
Indexer
Rekha Nair
Graphics
Sheetal Aute
Disha Haria
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade

About the Author

Rushi Gajjar is an embedded systems hardware developer and a lifetime electronics enthusiast. He works in the field of research and development of high-speed single-board embedded computers and wireless sensor nodes for the Internet of Things. Apart from that, he studied MTech in embedded systems by being involved in research at VIT University, Vellore.
Prior to this, his extensive work as a freelancer in the domain of electronics hardware design introduced him to rapid prototyping development boards such as the Raspberry Pi. In his spare time, he loves to develop projects on Raspberry Pi that include vision, data logging, web servers, and machine learning automation systems. He loves to teach Raspberry Pi projects to school students.
His vision encompasses connecting every entity in the world to the Internet to enhance the human living experience. His hobbies include playing the tabla, photography, and travelling.

Acknowledgements

First of all, I must say thanks to my acquisition edito...

Table of contents