Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arduino Wearable Projects

You're reading from  Arduino Wearable Projects

Product type Book
Published in Aug 2015
Publisher
ISBN-13 9781785283307
Pages 218 pages
Edition 1st Edition
Languages

Chapter 2. Working with Sensors

A sensor is a device that can detect changes or events and provide a corresponding output. The output is usually an electronic signal, for example, a light dependent resistor (LDR) outputs a voltage, which depends on the level of light cast on the sensors. When working with electronics, sensors are often divided into analog and digital sensors. Digital sensors can only detect two states, either on or off. The digital sensor can only distinguish if there is voltage going into the sensor or not. In code, this transfers into a 1 for voltage coming in and 0 if there is no voltage present. This is why they are called digital sensors, since they only operate in 0s and 1s. This means that these sensors only have two states, either on or off. A button, for example, is a digital sensor, which can only sense two states, if the button is pushed or not.

Analog sensors, however, can sense a range of values. The LDR, for example, is an analog sensor that changes the output...

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 $19.99/month. Cancel anytime}