The wonderful thing about digital electronics and microcontrollers is that they are smart. They can read sensors and make decisions based on what those sensors tell them. Sensors are components that collect information about the environment around them and convert that into something a microcontroller can understand.
You can use sensors to make projects that react to all sorts of stimuli (like temperature, sound, and the proximity of an object), but in this project, we’ll start small with a night-light that reacts to changes in light level, shown in Figure 5-1.
FIGURE 5-1: Finished Night-Light project