Sensors and Actuators

Sensors and Actuators

Definition: Sensors convert physical phenomena into electrical signals, while actuators convert electrical signals back into physical action, together forming the interface between electronics and the physical world.

How It Works

  • A sensor’s material or structure changes some electrical property, like resistance, voltage, or capacitance, in response to light, heat, pressure, or motion, which a circuit reads as data
  • Analog sensors output a continuously varying voltage or current proportional to the measured quantity; digital sensors output discrete values, often communicating over a protocol like I2C or SPI with a built-in ADC
  • An actuator does the reverse: it takes an electrical control signal and produces motion, force, heat, or another physical effect, often through a motor, solenoid, piezoelectric element, or heating element
  • Many actuators need more current or voltage than a microcontroller pin can supply directly, so a driver stage (transistor, MOSFET, relay, or motor driver IC) sits between the control signal and the actuator
  • Feedback loops close the sense-act cycle: a sensor measures the result of an actuator’s action, and a controller adjusts the actuator’s output accordingly (as in a thermostat or servo)
  • Some sensors are passive (like a thermistor, which just changes resistance) while others are active, generating their own small voltage in response to a stimulus (like a piezoelectric or photovoltaic sensor)
  • Actuator types split broadly into linear (produces straight-line motion, like a solenoid) and rotary (produces spinning motion, like a motor or servo)

Common Sensor and Actuator Types

  • Temperature sensors — thermistors, thermocouples, digital IC sensors (e.g., DS18B20)
  • Light sensors — photoresistors (LDRs), photodiodes, phototransistors
  • Motion/position sensors — accelerometers, gyroscopes, potentiometers, rotary encoders
  • Pressure/force sensors — strain gauges, piezoresistive pressure sensors, load cells
  • Proximity sensors — ultrasonic, infrared, capacitive, Hall-effect
  • Linear actuators — solenoids, linear motors, pneumatic/hydraulic cylinders
  • Rotary actuators — DC motors, stepper motors, servo motors
  • Other actuators — piezoelectric elements, relays, heating elements, speakers

Illustration

Under the Hood

Resistive sensor voltage divider output (common for thermistors, photoresistors, potentiometers):

Vout = Vin × (R_sensor / (R_sensor + R_fixed))

Thermistor resistance vs. temperature (simplified Beta equation):

R(T) = R0 × e^(β × (1/T − 1/T0))

Actuator (DC motor) torque relationship:

Torque ∝ Current (T = Kt × I)

Worked Problem 1: voltage divider with a photoresistor Given: a light-dependent resistor (LDR) has resistance 2 kΩ in bright light, paired with a fixed 10 kΩ resistor, supply Vin = 5 V, LDR on the bottom of the divider. Step 1: Vout = Vin × (R_sensor / (R_sensor + R_fixed)). Step 2: Vout = 5 V × (2 kΩ / (2 kΩ + 10 kΩ)) = 5 × (2/12). Answer: Vout ≈ 0.83 V in bright light; in darkness the LDR’s resistance rises to, say, 50 kΩ, giving Vout = 5 × (50/60) ≈ 4.17 V, a clear distinguishable swing for a microcontroller’s ADC to read.

Worked Problem 2: sizing a transistor driver for a solenoid actuator Given: a 12V solenoid draws 300 mA when energized, but a microcontroller GPIO pin can only source/sink about 20 mA. Step 1: Since 300 mA far exceeds the pin’s 20 mA limit, a switching transistor or MOSFET must be used to drive the solenoid, with the GPIO pin only driving the transistor’s base/gate. Step 2: Choose an NPN transistor with a current gain (hFE) of at least 50 so that a small base current can switch the full 300 mA collector current: I_base = I_collector / hFE = 300mA / 50 = 6 mA. Answer: a base resistor sized to deliver about 6-10 mA (with margin) from the GPIO pin safely switches the solenoid without exceeding either the pin’s or the transistor’s ratings.

Worked Problem 3: motor actuator torque from current Given: a DC motor has a torque constant Kt = 0.05 N·m/A, and draws 2 A under load. Step 1: Torque = Kt × I = 0.05 × 2. Answer: Torque = 0.1 N·m.

Worked Problem 4: strain gauge sensor bridge output Given: a strain gauge load cell in a Wheatstone bridge configuration has a rated sensitivity of 2 mV/V at full-scale load, excited with a 10 V supply. Step 1: Full-scale output = sensitivity × excitation voltage = 2 mV/V × 10 V. Step 2: Full-scale output = 20 mV. Answer: at full-scale load, the bridge outputs only 20 mV, which is why load cell signals almost always need an instrumentation amplifier stage before they can be read by a microcontroller’s ADC.

Quick Reference: Choosing an Actuator Driver

Actuator Current DrawRecommended Driver
Under 20 mADirect GPIO drive may be acceptable
20 mA – a few hundred mASingle transistor or MOSFET switch
Hundreds of mA – several ADedicated motor driver IC (e.g., H-bridge)
High current or high voltage ACRelay or solid-state relay (SSR)

Why It Matters

  • This sense-and-respond pairing is the foundation of automation and robotics, letting a microcontroller perceive its environment and then act on it
  • Nearly every “smart” device, from a thermostat to a self-driving car, is fundamentally a loop of sensing, deciding, and actuating
  • Choosing the right sensor and actuator types, and correctly interfacing them electrically, is often the hardest and most failure-prone part of an embedded design, more so than the software logic
  • Industrial automation, robotics, and consumer IoT all depend on cheap, reliable sensors and actuators to bridge the physical and digital worlds at scale

Common Pitfalls

  • Driving an actuator directly from a microcontroller pin without a transistor or driver IC, exceeding the pin’s current rating and damaging the chip
  • Forgetting flyback diodes on inductive actuators like relays, solenoids, and motors, letting the collapsing magnetic field spike voltage high enough to damage the driving transistor
  • Not accounting for a sensor’s response time, sampling faster than the sensor can physically settle and getting noisy or lagging readings
  • Ignoring a sensor’s power supply noise sensitivity, especially for analog sensors feeding an ADC, letting digital switching noise corrupt readings
  • Assuming a sensor’s output is linear across its full range when many (like thermistors or LDRs) are only approximately linear over a narrow band
  • Confusing a sensor’s resolution (smallest detectable change) with its accuracy (how close a reading is to true value); a sensor can have fine resolution but still be poorly calibrated
  • Running long sensor wires without shielding in electrically noisy environments, letting induced noise swamp a small analog signal
  • Underestimating an actuator’s inrush or stall current, which can be many times its rated running current and trip a poorly sized driver or fuse

Comparison: Sensor Signal Types

Passive SensorActive Sensor
Power source for signalRequires external excitation voltageGenerates its own signal
ExampleThermistor, LDR, strain gaugePiezoelectric sensor, photovoltaic cell, thermocouple
Typical circuitVoltage divider or bridgeDirect or amplified output

Comparison

SensorActuator
Signal directionPhysical → electricalElectrical → physical
Typical output/inputVoltage, current, digital dataMotion, force, heat, light
Example deviceThermistor, photodiode, accelerometerDC motor, solenoid, servo, relay
Power needsUsually low powerOften needs a driver stage for higher power
Role in a control loopProvides feedbackExecutes the control action

Comparison: Analog vs Digital Sensors

Analog SensorDigital Sensor
OutputContinuous voltage/currentDiscrete values over a bus (I2C, SPI, UART)
ADC neededYes, on the reading microcontrollerUsually built into the sensor itself
Noise susceptibilityHigher, especially over long wiresLower, digital signals are more noise-tolerant
ExampleThermistor, LDR, basic potentiometerDigital temperature sensor (e.g., DS18B20), IMU

History

  • Early sensors and actuators were purely mechanical or electromechanical, like bimetallic strip thermostats and mechanical relays, predating solid-state electronics by decades
  • The development of the transistor and later the integrated circuit in the mid-20th century enabled compact signal conditioning circuits, making small analog sensors practical to interface with electronics
  • MEMS (Micro-Electro-Mechanical Systems) technology, maturing through the 1990s and 2000s, shrank accelerometers, gyroscopes, and pressure sensors down to chip-scale, enabling their use in smartphones and wearables
  • The rise of cheap microcontrollers and standardized digital sensor buses (I2C, SPI) in the 2000s-2010s made sensor integration far more accessible to hobbyists, driving the maker and IoT movements

Example

A thermostat uses a temperature sensor (often a thermistor or digital IC sensor) to measure room temperature, feeding that reading to a microcontroller, which then drives a relay actuator to open a valve or switch on a heater when the temperature drops too low. A robotic arm pairs position sensors (potentiometers or encoders) on each joint with motor actuators, closing the loop so the controller can correct the arm’s position in real time.

FAQ

What’s the difference between a sensor and a transducer? They’re closely related; “transducer” is the broader term for any device converting one form of energy to another, while “sensor” specifically implies converting a physical quantity into a usable electrical signal for measurement.

Why do some actuators need a driver circuit while others don’t? It comes down to current and voltage: small actuators like a piezo buzzer might run directly off a GPIO pin, while motors, solenoids, and relays typically draw far more current than a microcontroller pin can safely supply.

Can a single component be both a sensor and an actuator? Yes, piezoelectric elements are a common example: they generate a voltage when physically stressed (sensor) and physically deform when a voltage is applied (actuator).

Why do sensors often need calibration? Manufacturing variation, temperature drift, and aging can shift a sensor’s output curve slightly from its ideal datasheet behavior, so calibration against a known reference improves accuracy.

What’s the difference between a sensor’s precision and its accuracy? Accuracy is how close readings are to the true value; precision is how consistent repeated readings are with each other, and a sensor can be precise (tight, repeatable readings) without being accurate (consistently off from the truth).

Dig deeper