Raspberry Pi Sensors
eBook - ePub

Raspberry Pi Sensors

Rushi Gajjar

Buch teilen
  1. 192 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Raspberry Pi Sensors

Rushi Gajjar

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Raspberry Pi Sensors als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Raspberry Pi Sensors von Rushi Gajjar im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Computer Engineering. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

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...

Inhaltsverzeichnis