EAZYLife STEM LAB · MODULE 09

Operational Amplifiers and Basic Analog Circuits

Understand how op-amps compare voltages, amplify small signals and condition sensor outputs. Build two low-voltage LM358 circuits and measure their behaviour.

Free open lesson Two practical builds Low-voltage only
COMPARE · AMPLIFY · CONDITION
01 · THE OP-AMP

A differential amplifier with feedback

An operational amplifier has two high-impedance inputs and one output. The non-inverting input is marked (+), the inverting input (−). The output responds to the difference between input voltages. Its open-loop gain is very high, so even a small input difference can drive the output towards a supply limit.

Op-amp symbol and signal flow

+ input− inputOutputV+V−A

Functional symbol, not a physical pinout. Use the exact IC datasheet to identify package pins.

Two operating modes: negative feedback can make a controlled linear amplifier. Without linear feedback, the circuit can act as a threshold detector, although a dedicated comparator is usually better for switching.

02 · REAL DEVICE PINOUT

Meet the LM358 dual op-amp

The LM358 contains two independent amplifiers in one 8-pin package. This diagram shows the common 8-pin DIP/SOIC pin assignment. Check the exact package and manufacturer datasheet before wiring.

LM358 top-view pinout

1 · OUT A2 · IN− A3 · IN+ A4 · V− / GND8 · V+ / +5 V7 · OUT B6 · IN− B5 · IN+ BLM358TOP VIEW

With the notch/dot upward, pin 1 is top-left. Pins count down the left side, then up the right.

Power and bypassing

  • Pin 8: positive supply, +5 V in these activities.
  • Pin 4: negative supply, connected to 0 V/GND.
  • Place a 100 nF ceramic bypass capacitor close between pins 8 and 4.
  • Keep inputs within the specified common-mode range.
  • Do not leave the unused amplifier inputs floating; configure it safely according to the datasheet.
03 · NEGATIVE FEEDBACK

Why the circuit feeds output back to an input

In a linear negative-feedback circuit, the output moves until the voltage difference between the inputs becomes very small, provided the output has not saturated and the device remains within its operating limits. This is called a virtual short. The inputs are not physically connected.

Feedback concept

Vin (+)Feedback (−)VoutAFeedback path

Conceptual illustration. Practical resistor feedback is shown in the build schematic below.

If the output cannot reach the voltage demanded by the feedback network, it clips or saturates and the virtual-short approximation no longer applies.

04 · COMMON CONFIGURATIONS

Inverting, non-inverting and comparator circuits

Inverting amplifier

Signal enters through Rin to the inverting input. Rf connects output back to that input. The non-inverting input is held at a reference.

Av = −Rf / Rin

Non-inverting amplifier

Signal enters the non-inverting input. Rf and Rg form a feedback divider at the inverting input.

Av = 1 + (Rf / Rg)

Comparator

Compares two voltages. If V+ is higher than V−, output moves high; if V+ is lower, output moves low. Actual output levels depend on the device and load.

Voltage follower

Output connects directly to the inverting input and signal enters the non-inverting input. Ideal gain is one; it can buffer a high-impedance source within device limits.

05 · PRACTICAL 1 · COMPARATOR

Build an adjustable voltage-threshold indicator

Use one LM358 channel as a low-voltage comparator. One potentiometer creates a reference voltage and another creates a test voltage. Observe the output as the test voltage crosses the reference. This is a learning experiment, not a precision or safety alarm.

Components

  • LM358 and exact datasheet
  • Two 10 kΩ potentiometers
  • Two 10 kΩ fixed feed resistors
  • One red LED and 2.2 kΩ resistor
  • 100 nF ceramic bypass capacitor
  • 5 V regulated supply, breadboard, wires and multimeter

Comparator schematic · channel A

REF wiperTEST wiper0–2.5 V0–2.5 VLM358 Apin 3 (+)pin 2 (−)pin 1 OUT+5 VGND2.2 kΩ + LEDLED anode to +5Vcathode to OUTPin 8 = +5 VPin 4 = GNDR + LED

Each potentiometer is wired as a divider with its top end fed from +5 V through a 10 kΩ resistor and its bottom end at GND. This limits the wiper range to about 0–2.5 V. LED is connected from +5 V through 2.2 kΩ to pin 1, so it lights when the output is low.

  1. With power disconnected, place the LM358 across the breadboard centre gap. Identify pin 1 from the notch or dot.
  2. Connect pin 8 to +5 V and pin 4 to GND. Place the 100 nF capacitor close between pins 8 and 4.
  3. For the reference control, connect one 10 kΩ fixed resistor from +5 V to the top of a 10 kΩ potentiometer. Connect its bottom end to GND and its wiper to pin 3 (+).
  4. Repeat for the test control using the second resistor and potentiometer. Connect its wiper to pin 2 (−).
  5. Connect +5 V through the 2.2 kΩ resistor and LED in series to pin 1. LED anode faces +5 V; cathode faces the output.
  6. Check for shorts before applying 5 V.
  7. Measure both wiper voltages relative to GND. Turn the test control slowly through the reference voltage and observe the LED.
  8. Record the reference voltage, test voltage and LED state at the transition. Repeat at a different reference setting.

Expected behaviour: pin 1 moves high when Vref at pin 3 is above Vtest at pin 2, and low when Vtest rises above Vref. The LED is wired active-low, so it lights in the low-output state. Offset and noise can cause uncertainty close to the threshold.

The LM358 is not a dedicated comparator. It can recover slowly after saturation and does not have a comparator-style output stage. For robust switching, use a suitable comparator IC and design hysteresis. Never use this experiment as a mains, battery-protection or life-safety circuit.

06 · PRACTICAL 2 · NON-INVERTING AMPLIFIER

Build a low-voltage DC signal amplifier

Use the second LM358 channel as a non-inverting amplifier. A small adjustable DC input is amplified by a resistor-set gain. A multimeter is sufficient for this first experiment; an oscilloscope and signal generator can later be used to study frequency response.

Components

  • Same LM358 and 5 V supply
  • 100 nF bypass capacitor
  • Rf = 10 kΩ feedback resistor
  • Rg = 10 kΩ resistor to ground
  • 10 kΩ potentiometer and 10 kΩ feed resistor
  • Breadboard, wires and multimeter

With equal Rf and Rg, ideal gain is 2.

Non-inverting amplifier schematic · channel B

Rf 10kRg 10kInput → pin 5 (+)Pin 6 (−)Pin 7 outputGNDLM358 B

Pin 5 receives the input. Rf connects pin 7 to pin 6; Rg connects pin 6 to GND. Pin 7 is the amplified output.

  1. Keep pin 8 at +5 V, pin 4 at GND and the 100 nF bypass capacitor close to the IC.
  2. Build the input divider: +5 V through a 10 kΩ fixed resistor to the top of the 10 kΩ potentiometer; bottom of pot to GND. Connect the wiper to pin 5 (+). Its maximum is about 2.5 V.
  3. Connect Rf = 10 kΩ from pin 7 to pin 6.
  4. Connect Rg = 10 kΩ from pin 6 to GND.
  5. Measure pin 5 input voltage and pin 7 output voltage relative to GND.
  6. Adjust the input slowly. Record five input/output pairs and compare with Vout ≈ 2 × Vin.
  7. For a conservative first test, keep the input at or below about 1.5 V (ideal output about 3.0 V). Do not increase it expecting the output to reach +5 V; the actual upper swing depends on load and device.

Example: 0.6 V at pin 5 with gain 2 gives an ideal output of 1.2 V. Small differences are expected from resistor tolerance, input offset and device behaviour. If output stops following input, check feedback wiring and output limits.

07 · IDEAL GAIN CALCULATOR

Explore resistor-set gain

Ideal closed-loop gain2
Ideal output before clipping1.2 V

Illustrative limit only. Real output swing depends on supply, load and selected device.

This calculator uses ideal gain equations and a user-entered symmetric output limit. It does not model common-mode range, asymmetric output swing, bandwidth, slew rate or load effects.

08 · REAL-WORLD LIMITS

Read the datasheet before trusting the circuit

Standard LM358 characteristics

  • Original LM358 supply range: 3 V to 30 V total, according to the current TI datasheet. Verify exact variant.
  • Input common-mode range includes the negative rail, but upper limit is typically about 1.5 V below the positive rail.
  • Output can approach the negative rail under suitable light-load conditions, but it does not reach the positive rail.
  • Gain-bandwidth product: about 0.7 MHz typical; slew rate: about 0.3 V/µs typical for the standard LM358.
  • Output current, offset, bias current, load and temperature affect performance.

Device selection checklist

  • Supply voltage and polarity.
  • Input common-mode range across the full signal.
  • Output swing at the actual load.
  • Gain-bandwidth and slew rate for signal frequency/amplitude.
  • Offset, bias current, noise and resistor tolerance.
  • Stability with capacitive loads and output protection.
  • Exact package pinout and unused-channel configuration.

Single-supply does not mean rail-to-rail. With 5 V supply, the standard LM358 input range is not guaranteed up to +5 V, and its output high level remains below +5 V. These activities keep inputs around 0–2.5 V and do not expect a 5 V output.

Read the Texas Instruments LM358 datasheet. LM358B/BA variants have different specifications; do not mix their figures with the original LM358.

09 · TROUBLESHOOTING

When the output does not behave as expected

  • Output stuck high or low: check pin numbering, supply rails, input polarity and common-mode range.
  • Gain is incorrect: verify Rf and Rg values, feedback connection and that output is not clipping.
  • Comparator chatters near threshold: noise and offset can cause repeated switching. Designed hysteresis adds a stable switching band.
  • Unexpected voltage: measure both inputs, supply pins and output relative to the same ground.
  • IC becomes warm: disconnect power and check output shorts, excessive load, pinout and supply polarity.
  • Noisy readings: add local bypassing, shorten high-impedance wiring and separate motor currents from analog ground.
KNOWLEDGE CHECK

Test your understanding

1. What sets ideal non-inverting gain?

2. What does virtual short mean?

3. Is the standard LM358 output rail-to-rail?

KEEP LEARNING · GO FURTHER

Free to learn. More support when you need it.

Explore these open lessons at your own pace. For personalised explanations, project-specific troubleshooting, guided practical training or masterclasses, EazyLife offers paid support tailored to your learning goals.

Free or sponsored lesson referrals may be available through active programmes; they are not guaranteed.

Enquire about guidance