An operational amplifier (op-amp) is a high-gain differential voltage amplifier -- most commonly realized as an IC, though discrete implementations exist -- with two inputs (inverting and non-inverting) and one output, designed to be used with external feedback networks that set its closed-loop behavior. Originally developed for analog computation, op-amps are now ubiquitous in signal conditioning, filtering, amplification, and impedance buffering throughout embedded hardware design.
In practice
Op-amps appear in embedded systems wherever analog signals need to be conditioned before reaching an ADC or after leaving a DAC. Common tasks include amplifying small sensor signals (thermocouples, strain gauges, photodiodes), level-shifting a signal into the ADC's input range, and low-pass filtering to prevent aliasing. A real op-amp's behavior is governed by its gain-bandwidth product (GBW), input offset voltage, input bias current, common-mode rejection ratio (CMRR), slew rate, and supply voltage range, among other parameters that frequently matter in embedded designs such as output swing, current drive capability, input noise, input common-mode range, and supply current. These parameters vary widely: a general-purpose part like the LM358 has a GBW of roughly 1 MHz and an input offset up to a few millivolts, while a precision part like the OPA277 targets sub-10-µV offset, and a high-speed part like the OPA657 targets GBW in the gigahertz range. Choosing the wrong part for the signal frequency or noise budget is a frequent source of design problems.
In battery-powered embedded designs, rail-to-rail input/output (RRIO) op-amps are commonly used because they allow the signal to swing close to both supply rails (typically within millivolts under light loads and nominal conditions, though the exact headroom depends on the part, load current, and temperature), maximizing dynamic range from a single low-voltage supply (3.3 V or 1.8 V systems). Zero-drift (chopper-stabilized) op-amps such as the MCP6V01 or LTC2057 are used when DC accuracy matters over temperature, at the cost of higher supply current and potential high-frequency noise artifacts from the chopping clock.
Feedback topology determines closed-loop function. An inverting amplifier, non-inverting amplifier, voltage follower (buffer), summing amplifier, integrator, differentiator, and active filter are all built from the same device by changing the resistor and capacitor network around it. Instrumentation amplifiers -- whether discrete (three op-amp topology) or integrated (INA128, AD8221) -- are the standard approach for amplifying small differential signals riding on a large common-mode voltage, as covered in "How to Analyze a Three-Op-Amp Instrumentation Amplifier" and "How to Analyze a Differential Amplifier."
A common pitfall in embedded work is neglecting supply bypassing on op-amp power pins. Each op-amp supply pin should have a decoupling capacitor placed as close as possible to the pin; a 100 nF ceramic is a common starting point for many parts, but always consult the datasheet layout recommendations, as high-speed, multi-channel, or very low-power devices may require different values or additional network elements such as a larger bulk capacitor. "The Other Kind of Bypass Capacitor" discusses how supply noise couples into analog signal paths and why bypassing strategy matters. Another pitfall is driving a capacitive load directly from an op-amp output, which can cause instability; a small series resistor (typically 10-100 ohms) between the output pin and the load is usually sufficient to restore phase margin.
Discussed on EmbeddedRelated
Frequently asked
What is the 'ideal op-amp' assumption and when does it break down?
The ideal op-amp model assumes infinite open-loop gain, infinite input impedance, zero output impedance, infinite bandwidth, and zero input offset voltage. These assumptions simplify circuit analysis and are a reasonable starting point for understanding closed-loop behavior. In practice, every parameter is finite and frequency-dependent. Gain-bandwidth product limits closed-loop bandwidth (a 1 MHz GBW part configured for a gain of 10 gives only ~100 kHz of usable bandwidth), input bias currents through feedback resistors create DC offset errors, and output impedance rises at high frequencies. 'Have You Ever Seen an Ideal Op-Amp?' explores this gap between the textbook model and real device behavior.
How do I choose between a general-purpose op-amp and a precision or zero-drift op-amp for my sensor interface?
Start with your error budget. If the sensor signal is large (hundreds of millivolts) and DC accuracy matters at the 1% level, a general-purpose part with a few millivolts of input offset is likely acceptable. If you are amplifying a thermocouple or bridge sensor producing tens of microvolts, a millivolt offset will dominate the error; use a precision or zero-drift part (e.g., MCP6V01, AD8628, LTC2057) with specified offsets in the single-digit microvolt range. Also check input bias current against your source impedance: bias current flowing through feedback or source resistors creates additional offset. For AC-coupled or high-frequency paths, GBW and
slew rate matter more than DC offset.
Can I use an op-amp as a comparator?
Technically you can operate an op-amp open-loop as a comparator -- the high open-loop gain will drive the output to one rail or the other depending on which input is higher. However, general-purpose op-amps are not designed for this use and perform poorly: they are not specified for overdrive recovery, their outputs may not be compatible with digital logic levels, and they can exhibit slow or indeterminate transitions with small input differentials. Dedicated comparators (LM393, TLV3201) have output stages designed for rail-to-rail switching, defined propagation delay specifications, and
open-collector/open-drain outputs suited to logic interfacing. Use a comparator when the task is threshold detection.
Why does my op-amp circuit oscillate?
Op-amp oscillation is almost always a stability problem caused by insufficient phase margin in the closed-loop system. Common causes include: driving a capacitive load (cable or
ADC input capacitance) that adds a pole and shifts phase; a feedback network with stray capacitance across the feedback resistor that creates unintended phase shift; or pushing a unity-gain-stable op-amp into a gain configuration it was not characterized for. Remedies include adding a small series resistor at the output (10-100 ohms), adding a feedback
capacitor to reduce high-frequency gain, or choosing an op-amp specified as stable at the required noise gain. Check the manufacturer's stability application notes for the specific part.
How does an op-amp relate to building a simple software low-pass filter in an embedded system?
An analog RC low-pass filter, often buffered by a voltage-follower op-amp to avoid loading the RC network, is the hardware complement to a digital single-pole IIR low-pass filter running on the
MCU. 'Ten Little Algorithms, Part 2: The Single-Pole Low-Pass Filter' describes the digital equivalent. In practice both are used together: an anti-aliasing RC (or active) filter limits the signal bandwidth before the
ADC, and a digital filter further smooths the digitized data. The op-amp buffer prevents the ADC input capacitance or other downstream impedance from disturbing the RC filter's time constant.
Differentiators vs similar concepts
Op-amps are often confused with comparators and instrumentation amplifiers. A comparator is a related open-loop circuit optimized for fast rail-to-rail switching and logic-compatible outputs; using a general-purpose op-amp as a comparator usually gives slower, less predictable transitions. An instrumentation amplifier (in-amp) is a closed-loop, fixed-topology circuit -- either three op-amps wired in a standard configuration or an integrated part like the INA128 -- optimized for high CMRR and accurate differential gain; it is not a general-purpose building block in the same way an op-amp is.