Component guide · Intermediate · 4 min read
Op-Amps for Beginners
LM358, LM741 and LM324 Circuits
By Geekobot Learning Team · Updated 24 Oct 2026
On this page
An operational amplifier (op-amp) amplifies the voltage difference between its two inputs by a huge amount; feedback resistors turn that into a precise, useful gain. The LM358 (dual) and LM324 (quad) work from a single 3 to 32 V supply and suit Arduino projects; the LM741 needs a dual supply and is best left to textbooks. A non-inverting amplifier's gain is 1 + Rf / Rg.
Key specs at a glance
- LM358
- Dual, single supply 3 to 32 V, output swings to about VCC - 1.5 V
- LM324
- Quad version of the LM358
- LM741
- Single, dual supply ±5 to ±18 V, output to about ±(V - 2)
- MCP6002 / TLV2462
- Rail-to-rail, 1.8 to 5.5 V: best for 3.3 V boards
- Non-inverting gain
- 1 + Rf / Rg
- Inverting gain
- -Rf / Rin
- Pinout (DIP-8, LM358)
- 1 out A, 2 -in A, 3 +in A, 4 GND, 5 +in B, 6 -in B, 7 out B, 8 VCC
What an op-amp does
The output tries to make the two inputs equal by driving in whichever direction closes the gap, limited only by the supply rails. With no feedback the gain is over 100,000, so the smallest difference slams the output to a rail: that is a comparator. With a resistor from the output back to the inverting input, the op-amp settles at a gain you choose. That one idea covers amplifiers, buffers, filters, oscillators and sensor front-ends.
LM358 vs LM741 vs LM324 vs rail-to-rail types
| Op-amp | Channels | Supply | Output swing | Choose it for |
|---|---|---|---|---|
| LM358 | 2 | 3 to 32 V single | 0 to VCC - 1.5 V | General Arduino projects on 5 to 12 V |
| LM324 | 4 | 3 to 32 V single | 0 to VCC - 1.5 V | Several channels on one chip |
| LM741 | 1 | ±5 to ±18 V dual | About ±(supply - 2 V) | Textbook circuits with a split supply |
| MCP6002 / MCP6004 | 2 / 4 | 1.8 to 6 V single | Rail to rail | 3.3 V and 5 V sensor circuits, ESP32 |
| TL072 / TL082 | 2 | ±5 to ±18 V dual | Not rail to rail | Audio, low noise |
| LM393 / LM339 | 2 / 4 comparators | 2 to 36 V | Open-collector | Threshold detection (not an amplifier) |
- LM358
- Channels:
- 2
- Supply:
- 3 to 32 V single
- Output swing:
- 0 to VCC - 1.5 V
- Choose it for:
- General Arduino projects on 5 to 12 V
- LM324
- Channels:
- 4
- Supply:
- 3 to 32 V single
- Output swing:
- 0 to VCC - 1.5 V
- Choose it for:
- Several channels on one chip
- LM741
- Channels:
- 1
- Supply:
- ±5 to ±18 V dual
- Output swing:
- About ±(supply - 2 V)
- Choose it for:
- Textbook circuits with a split supply
- MCP6002 / MCP6004
- Channels:
- 2 / 4
- Supply:
- 1.8 to 6 V single
- Output swing:
- Rail to rail
- Choose it for:
- 3.3 V and 5 V sensor circuits, ESP32
- TL072 / TL082
- Channels:
- 2
- Supply:
- ±5 to ±18 V dual
- Output swing:
- Not rail to rail
- Choose it for:
- Audio, low noise
- LM393 / LM339
- Channels:
- 2 / 4 comparators
- Supply:
- 2 to 36 V
- Output swing:
- Open-collector
- Choose it for:
- Threshold detection (not an amplifier)
Three circuits you will actually use
1. Voltage follower (buffer). Output to -in, signal to +in. Gain = 1. Use it so a high-impedance sensor or divider can drive an ADC without loading.
2. Non-inverting amplifier. Signal to +in, Rf from output to -in, Rg from -in to ground. Gain = 1 + Rf / Rg. With Rf = 100 kΩ and Rg = 10 kΩ, gain = 11: a 0.2 V thermocouple-like signal becomes 2.2 V for the ADC.
3. Inverting amplifier. Signal through Rin to -in, Rf from output to -in, +in to a mid-supply reference. Gain = -Rf / Rin. On a single supply, bias +in at VCC / 2 with two equal resistors so the output has room to swing both ways.
Single-supply gotchas
- An LM358 on 5 V can output only about 0 to 3.5 V. Signals above that clip. Use a rail-to-rail op-amp (MCP6002) for 3.3 V and 5 V boards.
- Inputs must stay within the common-mode range: for the LM358 from 0 V to VCC - 1.5 V.
- Add a 100 nF decoupling capacitor at the supply pin.
- Unused op-amps in a dual or quad package should be wired as followers with +in at mid-supply, not left floating.
Op-amp as a comparator (and why LM393 is better)
Without feedback, an LM358 compares +in with -in and outputs high or low: handy for a light or temperature threshold switch with a potentiometer setting the reference. Add a 1 MΩ resistor from output to +in for hysteresis so the output does not chatter. For speed and clean logic levels, a dedicated comparator such as the LM393 (open-collector output with a pull-up) is better; that is the chip on most sensor modules.
Reading an amplified sensor with Arduino
The amplifier's output goes straight to an analog pin. Keep the gain such that the maximum signal stays below the ADC reference (5 V on an Uno, 3.3 V on an ESP32), and average several readings to reduce noise.
Try it: Op-amp gain calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Using an LM741 on a single 5 V supply and getting no output swing.
- Expecting an LM358 to output 5 V on a 5 V supply.
- Running an op-amp without decoupling, which makes it oscillate.
- Leaving unused op-amp inputs floating.
- Choosing feedback resistors below 1 kΩ (loads the output) or above 1 MΩ (noise and bias errors).
Frequently asked questions
What is an op-amp used for?
Amplifying small sensor signals, buffering high-impedance sources, filtering, comparing voltages, generating waveforms and driving ADC inputs cleanly.
Can I use an LM358 with 3.3 V?
It works down to 3 V, but the output only reaches about 1.8 V on a 3.3 V supply. A rail-to-rail op-amp such as the MCP6002 is the better choice for 3.3 V boards.
What is the gain formula for a non-inverting amplifier?
Gain = 1 + Rf / Rg, where Rf is the feedback resistor from output to the inverting input and Rg goes from the inverting input to ground.
LM358 vs LM741: which should I buy?
The LM358. It runs from a single supply, has two op-amps and works in typical 5 V and 12 V projects. The LM741 needs a split supply and offers no advantage today.
What is the difference between an op-amp and a comparator?
A comparator is an op-amp optimised for switching its output fast between two levels, usually with an open-collector output. An op-amp is built for linear operation with feedback. Either can compare, but comparators do it better.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 2 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- LM358 datasheet (Texas Instruments)
- LM741 datasheet (Texas Instruments)
- MCP6001/2/4 datasheet (Microchip)
- Horowitz and Hill, The Art of Electronics, chapter 4
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




