6. Sensing the World

One of the most powerful tools you can plug into your Arduino is a sensor, a small electronic device that enables the microcontroller to take readings from its surroundings, reacting in accordance to its program. For example, you could program the Arduino to turn on a fan when a temperature reaches a certain level or to turn off a lamp when the sun comes up.

In Chapter 1, “Arduino Cram Session,” you learned a little about some sensors—ultrasonic, temperature, flex, and light. However, many more types are available! In this chapter, you learn more about additional sensors and how to control them, and then you use that knowledge to build a sensor-controlled project—a mood light that changes its color depending on environmental ...

Get Arduino for Beginners: Essential Skills Every Maker Needs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.