Sensors: the device's senses
A sensor notices something in the real world and turns it into an electrical signal the brain can read. Here is how sensors match your own senses.
| Your sense | Sensor | What it notices | Popular part |
|---|---|---|---|
| Seeing light | Light sensor (LDR) | Bright or dark | LDR |
| Seeing distance | Ultrasonic sensor | How far away something is, using sound echoes like a bat | HC-SR04 |
| Noticing movement | Motion sensor (PIR) | A person or pet moving nearby | HC-SR501 |
| Feeling hot or cold | Temperature sensor | How warm the air or water is | DHT11, DS18B20 |
| Feeling wet or dry | Soil moisture sensor | Whether a plant needs water | Capacitive soil sensor |
| Smelling | Gas sensor | Smoke or cooking gas in the air | MQ-2 |
| Hearing | Sound sensor | Claps and loud noises | KY-038 |
| Touching | Touch sensor | A finger tap | TTP223 |
| Knowing who you are | RFID reader | A special card or key tag | RC522 |
| Knowing where you are | GPS module | Your location on Earth | NEO-6M |
| Feeling tilt and shakes | Motion sensor (IMU) | Tilting, falling, shaking | MPU6050 |
Two kinds of signals
- Digital (yes or no): "Is someone there?" The answer is either yes or no, like a light switch.
- Analog (how much): "How bright is it?" The answer is a number on a scale, like a volume knob.