LM741 as Comparator & Opamp

Single or Dual Power Supply Voltage Config #basicTronic 02

J3
Jungletronics
6 min readApr 8, 2017

--

Hi, hobbyist!
This is LM741 (Github: https://goo.gl/4mkiiN)!

The LM741 are general-purpose operational amplifiers, Opamp, for short.

The LM741 can operate with a single or dual power supply voltage.

Here, in this first circuit, it’s on its single power supply voltage, as a comparator.

Open-Loop Amplifier

The LM741 can be operated in an open-loop configuration. The magnitude of the open-loop gain is typically large thus for a small difference between the noninverting and inverting input terminals, the amplifier output will be driven near the supply voltage. Without negative feedback, the LM741 can act as a comparator.

If the inverting input is held at 0 V or above, and the input voltage applied to the non-inverting input is positive, the output will be positive.

If the input voltage applied to the non-inverting input is negative, the output will be negative.

Minus+Minus=Positive / Minus+Plus=Negative

The circuit is oscillating a LED on and off. Cool!

But first, let me explain why the Arduino is set to interrupt every 10 microseconds.

Arduino is using FlexiTimer 2 library. It is collecting four data types.

The first data is for 490 Hz PWM, on pin 10.
The second one is for the low-pass filter (hold on…soon it’ll be clear).
The next data is a measuring of the output for this opamp LM 741’s pin 6.
And finally, the last data tell if LED is on or off.

What are all these data for?
We prepared a set of graphs.

Google Drive link

Graph 1 — opamp_lesson1
Clearly shows as the signal is attenuated by the low pass filter. Notice visually the voltage difference.

See the formation of 490 Hz PWM from Arduino pin’s 10

Graph 2 — all_experiment_LM741
In this graphic, we can clearly see when the LED is on and off (green mark).
See how the circuit is an inverter, it turns off when the voltage is high and turns on when low.

Green mark teels when LED is on or off

Link to datasheet: Google Drive link

Let’s see what we can understand about LM741 as a comparator.

As I said, LM741 is on its comparator configuration. I’m using a single rail.
Just a plain zero (pin 4) and five volts (pin 7) from Arduino. Basic!

Let’s examine this circuit to understand it a little better.

Arduino’s pin 10 is delivering from zero to five volts on pin 2, inverting one, via 220 Ohms resistor.
The low pass filter reduces the voltage and frequency.
The break frequency also called the turnover frequency or cutoff frequency (in hertz).
So, the initial 490 Hz ends up in 60 hertz.
This reduces the output range of pin 6 to 1.8 to 4.2 volts.
This passes through another 220 k resistor to further lower the voltage.
At the other end, we will have the voltage ranging from 1.7 to 2 volts, exactly the voltage to turn the green led on and off.

But, wait … the LM741 is not as talented as a comparator but as an operational amplifier.
Here is the configuration for this circuit: Closed-Loop Amplifier!

In a closed-loop configuration, negative feedback is used by applying a portion of the output voltage to the inverting input.

Unlike the open-loop configuration, closed-loop feedback reduces the gain of the circuit. The overall gain and response of the circuit are determined by the feedback network rather than the operational amplifier characteristics. The response of the operational amplifier circuit is characterized by the transfer function.

Let’s see the circuit above…

All we do is to switch to a split rail, better know as rail-to-rail, this is put a plus and minus 3 volts into both input of the LM714.

I hack a 4 x 1.3 volts battery pack. Looking over I found common ground and the other two pins deliver positive and negative voltage with Multimeter.
Awesome! Perfect!

The LM741 can be operated in either single-supply or dual supply. This application is configured for dual supply with the supply rails at ±3 V.

The input signal is connected to a function generator. A 1-Vpp, 10-kHz sine wave was used as the signal input. 5% tolerance resistors were used, but if the application requires an accurate gain response, use 1% tolerance resistors;-)

Application Curve
The waveforms in the SoundCard Oscilloscope show the input and output signals of the LM741 non-inverting amplifier circuit.

10 K Pot Volume Control with LM741

The first waveform shows the input signal, while the second waveform shows the output signal (through video is better!). The input signal is 615.7m Vpp and the output signal is 1.970 Vpp. With the 1.0-kO resistors, the theoretical gain of the system is 10. Due to the 5% tolerance, the gain of the system including the tolerance is below that:/ The gain of the system when measured was 5,4 approximately.

The Signal Generator App is delivering a sine wave voltage of roughly .4 volts. That is 400 millivolts, right?

Using Christian Zeitnitz SoundCard Oscilloscope we verified that the concept of feedback is related to volume control.

This is incredible, is not it?

Now let’s see the Arduino Code — LM741 As Amplifier:

For graphs it’s a simple matter of getting values from Arduino serial and set to a spreadsheet.

Please follow this sequence (see video):
Save data as .txt. They import into a spreadsheet. Insert the graph. And there you go!

As Arduino is not split railed its output is positive.

That is all!

This is a great example of how to analyze signals without having to buy an oscilloscope. Here we have a limited view, it is true, but it shows that we can turn around with little effort and obtain satisfactory results.

You are watching the Jungletronics channel.
This is your host, J3. Thank you!
As always leave your thoughts in the comments sect of my youtube channel.
And If You learned something with this Video, Give It a Thumbs Up!

— — — — —

LM741 As Comparator Arduino Circuit
LM741 As Amplifier Arduino Circuit

Download All Project’s Archive

References:

This example we are using Signal Generator App
Software: https://play.google.com/store/apps/details?id=radonsoft.net.signalgen

Soundcard Oscilloscope by Christian Zeitnitz

Related Posts

00#basicTronic — Battery Monitor Circuit — Zener Diodes & Quad Differential Comparator LM 339

01#basicTronic — LM358 Opamp Electret Amplifier Circuit — Debugging Circuit w/ SoundCard Oscilloscope

02#basicTronic — LM741 as Comparator & Opamp — Single or Dual Power Supply Voltage Config (this one:)

04#basicTronic — Electronic ScoreBoard v1.0–4510 & 4511 Seven Seg Project

05#basicTronic — 555 IC — Monostable Mode — Playing with 555 Timer — Part I — Monostable

06#basicTronic — 555 IC — Bistable Mode — Playing with 555 Timer — Part II — Bistable

07#basicTronic — 555 IC — Astable Mode — Playing with 555 Timer — Part III — Astable

08#basicTronic — Reaction Timer Circuit — Using the 555 in its three modes at once

09#basicTronic — DRV8825 Driver & Stepper Motor 24BYJ48 — Operation & Theory

10#basicTronic — Arduino to Arduino — Cheap AVR Programming — How To Flash Your Arduino Using Other Arduino Board

-Edited: Aug/2020 — Text correction and fix links;)

--

--

J3
Jungletronics

Hi, Guys o/ I am J3! I am just a hobby-dev, playing around with Python, Django, Ruby, Rails, Lego, Arduino, Raspy, PIC, AI… Welcome! Join us!