LESSON 31
Sensors: Types & How They Work
A tour of how everyday sensors convert light, heat, motion, and pressure into an electrical signal a circuit can read.
A sensor is any component that converts a physical quantity — light, temperature, pressure, motion, sound — into an electrical signal. Nearly every project beyond blinking an LED involves reading at least one. While the physics behind each sensor type differs, most fall into a few familiar categories you already have the tools to understand:
- Resistive sensors change their resistance with the quantity being measured. A photoresistor (LDR) lowers its resistance as light increases; a thermistor changes resistance with temperature. Paired with a fixed resistor in a voltage divider, the changing resistance becomes a changing voltage your ADC can read.
- Voltage-output sensors directly output a voltage proportional to the measurement — many analog temperature sensors (like the TMP36) work this way, so you can feed them straight into an ADC with no extra circuitry.
- Digital sensors handle their own analog measurement internally and report a finished value over a communication protocol like I2C (Lesson 33), which is common on more precise sensors — accelerometers, humidity sensors, and pressure sensors frequently work this way.
- Switch-like sensors simply open or close a connection — a push button, a tilt switch, or a magnetic reed switch (used in door sensors) are the simplest sensors of all, read as a plain digital HIGH/LOW.
When choosing a sensor for a project, the datasheet (Lesson 39) will tell you which category it falls into, its supply voltage range, and how to interpret its output — details that matter far more than the sensor's name.
Sensor to signal A sensor captures a physical quantity (here, incoming light) and outputs it as an electrical signal down a single wire.
KEY TAKEAWAY
Sensors turn physical quantities into electrical signals — through changing resistance, a direct output voltage, a digital communication protocol, or a simple on/off switch.