Do you remember how we compared the human body to robots in Chapter 1, The World around Us? Microcontrollers are like the brains in human beings. Similar to human brains, microcontrollers work on a simple input-output concept. So, what is this input-to-output concept?
Anything that is taken in or put in a system is called an input; similarly, output is what is given out of the system.
Look at the following diagram-it shows what a system looks like. This system could be a microcontroller or a human brain:
Microcontrollers receive the input information; they process that information and then produce an output. The human brain processes a lot of information too, even before birth. All day, every day, it processes information such as sounds, images, visuals, smells, touch, pain, expressions, and so on. What do you think is the input to the brain? The sense organs in humans provide this input to the brain.
Sense organs are the inputs to the human brain. Let me tell you how they work. Sense organs have small receptors (a small unit that responds to particular environment condition such as light and smell.) that take the information about various physical conditions to the brain via information channels called neurons. The following block diagram shows how it works in the human brain:
Microcontrollers use various sensors to understand the environment around them. To see, the controllers use cameras; to measure temperature, they use temperature sensors; to measure their orientation and speed, they have special sensors too!
In summary, sensors are devices that help the micro controller learn about the environment around it. Now that we know a little bit about sensors, aren't you curious and excited about how they work? The next section is going to tell you the science behind the sensors.