The same op amp schematic behaves on one board and oscillates on another because of decoupling and grounding. This page shows how to decouple every pin and route the ground so the board is stable the first time.
The op amp supply pin needs a low high-frequency impedance or the transient current from output swings makes spikes on the rail that couple back to the input through the limited power-supply rejection, raising noise or causing self-oscillation. Put a 0.1 microfarad ceramic from each supply pin to ground within a few millimetres, via straight down to the plane. Add a 10 microfarad tantalum or electrolytic at the supply entry for bulk, and for fast or high-current parts a 1nF in parallel covers the top band.
Keep analogue ground and digital ground separate and join them at one point with a ferrite bead or 0 ohm resistor so digital return current cannot lift the analogue ground. Tie the op amp ground pin straight to the AGND plane with a short wide trace, and on a multilayer board use a whole layer as ground with a nearby via on every layer change. Never let signal return travel far, and never bond analogue ground to chassis at multiple points to form a ground loop. Keep power ground on its own return.
Layout traps: a decoupling cap centimetres from the pin fails at high frequency and the board oscillates; input and output traces run parallel for a long distance and parasitic coupling feeds output back to input; the feedback resistor ground is floating or thin and ground bounce changes the gain; an op amp used as a comparator with a floating input picks up noise; no bulk cap at entry lets inrush skew the bias. First measure the AC component at the supply pin, then check the ground loop.
| Item | Correct | Wrong and result |
|---|---|---|
| Per-pin decouple | 0.1uF ceramic at pin | cm away fails, oscillates |
| Entry cap | 10uF tantalum | none, inrush skews bias |
| AGND/DGND | single-point join | mixed, digital noise in |
| Ground plane | whole layer or wide | thin trace, bounce shifts gain |
| Signal isolation | input away from output | parallel long, oscillates |
| Layer-change via | nearby ground via | far return picks noise |
| Comparator use | use real comparator | floating input flips |
Decoupling and grounding set the stability and noise floor of any op amp circuit. Decouple every supply pin with 0.1 microfarad at the pin, bulk 10 microfarad at entry, join AGND and DGND at one point, keep a low-impedance ground plane, separate input from output, and ground nearby. Measure supply AC and the ground loop when debugging.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: PCB design per GB/T 4588.3; EMC installation per IEC 61000 series. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.