Book Image

Internet of Things with Intel Galileo

By : Miguel de Sousa, Ricardo Miguel F de Sousa
Book Image

Internet of Things with Intel Galileo

By: Miguel de Sousa, Ricardo Miguel F de Sousa

Overview of this book

Table of Contents (17 chapters)
Internet of Things with Intel Galileo
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Detecting luminosity


In the previous step, you saw how to use a PIR motion sensor to control a relay. That is interesting when it's dark, but during the daylight you'll have a waste of energy with the lightbulb being turned on. Keeping this in mind, let's improve our lighting circuit to only let the lightbulb turn on when the incident amount of light (luminosity) is low. To do so, we'll add a photoresistor to our circuit.

Photoresistors are light-dependent resistors. The incisive amount of light will define the resistor value. By using them, we are able to understand when it is night or day by setting the threshold values. Unplug your bulb plug from the wall socket and let's do some changes in our circuit. In the following figure, you can see how you must connect the photoresistor to the Galileo:

Wiring a photoresistor to Galileo

One side of the photoresistor should be connected to the 5 V pin. To the other side, we must connect the resistor and wire it to the Galileo's pin A0 using a jumper...