What's changed: Initial version
4.2Sensors and actuators
Covers sensors, which convert temperature, acceleration, light, and similar phenomena into electrical signals; actuators (DC motors, stepping motors, servo motors), which convert electrical signals into physical motion; and PWM and H-bridge driving for controlling motor speed and position, building judgment for selecting sensors/actuators to fit requirements.
When an embedded designer says "drive a motor," what counts as the optimal actuator differs greatly depending on whether positioning accuracy is required, whether simple speed control of continuous rotation suffices, and whether feedback (detecting the current position) is needed. Sensors likewise require choosing the right method based on the physical quantity being measured, the required response speed, and power constraints. This section builds the judgment needed to decide which to choose and how to drive it, given the characteristics of representative sensors and actuators.
4.2.1Sensor types and selection
- Temperature sensors (thermistors, thermocouples, IC temperature sensors, etc.) differ from one another in response speed, measurement range, and output form (analog voltage versus digital). Accelerometers (predominantly MEMS-based) are used to detect vibration, tilt, and shock, and can also derive a tilt angle from the gravitational acceleration measured while stationary. Light sensors (photodiodes, CdS cells, etc.) detect illuminance and are also applied as proximity sensors for object detection.
- What matters in sensor selection is not the oversimplified idea that "higher accuracy is always better," but judging the tradeoffs among response speed, power consumption, and cost against the actual requirements. For example, in a battery-powered device that operates intermittently, a low-power sensor that can be woken only when needed is often more suitable than a high-accuracy sensor that requires continuous power.
4.2.2DC, stepping, and servo motors
- A DC motor rotates continuously in proportion to the applied voltage, has a simple, inexpensive structure and suits high-speed rotation, but the motor itself has no way to know its current rotation angle (position), so applications requiring positioning need a separate feedback sensor such as an encoder. A stepping motor rotates by a fixed angle (the step angle) for each input pulse, allowing accurate open-loop positioning simply by counting pulses, with no feedback needed, but it carries a risk of step-out (failing to keep up when the load is too large) and is unsuited to high-speed rotation or high torque.
- A servo motor has an internal position sensor such as an encoder plus feedback control circuitry, and uses techniques such as PID control to follow a target position or speed in a closed loop. It outperforms a stepping motor in maintaining the commanded position/speed even under disturbance (load variation), but the added feedback circuitry makes its structure more complex and costlier. It suits applications such as robot-arm joints that require both high precision and disturbance tolerance.
Most-tested: choosing among "a DC motor = continuous rotation, cheap, does not know its own position", "a stepping motor = positioning by pulse count, open loop, risk of step-out", and "a servo motor = closed-loop tracking via feedback, robust to disturbance but costlier". Expect to be asked not just to recognize that "positioning requires a stepping or servo motor" but also to choose between the two based on the presence or absence of disturbance.
4.2.3PWM and H-bridge driving
- PWM (pulse-width modulation) controls the effective voltage/power by varying the proportion of time the signal is High within a fixed period (the duty cycle). It is widely used for motor speed control and LED brightness control, and because it requires only fast digital on/off switching rather than an analog variable-voltage circuit, it generates less heat and is more efficient (aside from switching losses, it does not waste energy as heat).
- An H-bridge arranges four switching elements (transistors/FETs) in an H shape, forming a circuit that can reverse the direction of current to the motor. Turning diagonal pairs of elements on/off controls four states: forward, reverse, brake, and free (coasting). It is essential for controlling a DC motor's forward/reverse direction, and combined with PWM it allows both rotation direction and speed to be controlled using only digital signals.
Suppose a robot vacuum development team is evaluating a drive scheme for its wheels. Sorting out the requirements reveals two constraints: "turn precisely 90 degrees near a wall" and "maintain the commanded speed even under a disturbance such as a bump or carpet resistance." A stepping motor is an appealing candidate because it can control rotation angle precisely by pulse count, but it has a weakness: being open-loop, an unexpected load change such as carpet resistance can cause step-out, and any resulting position drift cannot be detected. The team therefore chooses a servo motor (or a DC motor with an encoder plus PID control, forming a pseudo-servo) that can track the disturbance via feedback control, and drives the wheels with PWM control through an H-bridge circuit, switching forward/reverse/brake electronically. For a momentary stop or a sharp direction change, such as a 90-degree turn near a wall, the H-bridge's brake mode—turning on both switches on the same side to short the armature for rapid braking, rather than the free mode that turns off both diagonal switches—is effective. The trap to avoid here is the misconception that "raising the PWM duty cycle also lets you control the motor's rotational position precisely"—PWM controls speed (the effective voltage), while positioning accuracy is a separate axis determined by the presence or absence of feedback (an encoder, etc.). Conflating speed control with positioning accuracy leads to a design that cannot detect position drift under disturbance.
| Motor type | Positioning | Disturbance tolerance | Cost |
|---|---|---|---|
| DC motor | None (needs a separate encoder) | Low | Low |
| Stepping motor | Yes (open-loop, watch for step-out) | Low | Moderate |
| Servo motor | Yes (closed-loop feedback) | High | High |
Trap: "a stepping motor is always more accurate than a servo motor" is wrong—being open-loop, a stepping motor can step out under load variation, with no way to detect resulting position drift, whereas a servo motor maintains the commanded position under disturbance via closed-loop feedback. Also wrong: "raising the PWM duty cycle also improves positioning accuracy"—PWM controls speed (the effective voltage); positioning accuracy is determined by the presence or absence of feedback.
4.2.4Section summary
- Sensor selection is judged not just on accuracy but on the tradeoff among response speed, power consumption, and cost
- A DC motor does not know its position and is cheap; a stepping motor provides open-loop positioning; a servo motor is closed-loop and disturbance-tolerant but costlier
- PWM controls speed (effective voltage); an H-bridge switches forward/reverse/brake/free—a separate axis from positioning accuracy
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. For a robot vacuum's wheel drive, the design wants to maintain the commanded speed and position even under unexpected load variation such as carpet resistance. Which motor best fits this requirement?
Q2. The design wants to control a DC motor's four states—forward, reverse, brake, and free—using only digital signals. Which circuit is essential for this purpose?
Q3. Regarding a design that controls a motor's rotation speed via the PWM duty cycle, which understanding is correct?
Keep track of your progress
The full study guide is free to read. Sign up free to practice with the question bank, track what you have read, review your mistakes, and highlight passages.

