Can I use LM339 to generate a triangular and sine waveforms?

wayneh

Joined Sep 9, 2010
17,496
Not by itself, no. But you can get a sawtooth wave and a square wave with simple op amp circuits. Sine waves require a more complex circuit.
 

Thread Starter

nma

Joined Feb 1, 2016
15
Not by itself, no. But you can get a sawtooth wave and a square wave with simple op amp circuits. Sine waves require a more complex circuit.
Thanks for the response. I had used LM339 to generate 100kHz square wave but having issues with using it to generate triangular and sine wave.

What is the maximum frequency you need?
100kHz please.

LM339 is a comparator, an op amp would be a better choice.
Okay. Please which of the op-amps for 100kHz?
 
Last edited by a moderator:

dl324

Joined Mar 30, 2015
16,846
The op-amp in the schematic is used for design in multisim but I used LM339.
Did you substitute comparators for both opamps? Did you add pull-up resistors to the comparator output(s)?

Post waveforms of the input/output of the integrator.
 

Thread Starter

nma

Joined Feb 1, 2016
15
Did you substitute comparators for both opamps? Did you add pull-up resistors to the comparator output(s)?

Post waveforms of the input/output of the integrator.
Yes I did substitute comparators for both opamps. I did not add a pull up resistor to the output of the integrator. I did not get an output. Attached is the input to the integrator.
 

Attachments

KL7AJ

Joined Nov 4, 2008
2,229
Not by itself, no. But you can get a sawtooth wave and a square wave with simple op amp circuits. Sine waves require a more complex circuit.
Actually, most el-cheapo function generators start with a square wave, and then use subsequent integration to obtain triangle and sine waves. The 339 is fine for generating the first square wave.
 

shortbus

Joined Sep 30, 2009
10,045
Yes I did substitute comparators for both opamps. I did not add a pull up resistor to the output of the integrator. I did not get an output. Attached is the input to the integrator.
Not using a pull up is why you didn't get an output. the 339/393 can only sink current not source it, there for they need a pullup resistor.
 

Thread Starter

nma

Joined Feb 1, 2016
15
Not using a pull up is why you didn't get an output. the 339/393 can only sink current not source it, there for they need a pullup resistor.
Thanks for the responses. I will add a pullup resistor and give you a feedback on the waveform.
 

Thread Starter

nma

Joined Feb 1, 2016
15
Actually, most el-cheapo function generators start with a square wave, and then use subsequent integration to obtain triangle and sine waves. The 339 is fine for generating the first square wave.
Please can you shade more light on what you are saying.
 

shortbus

Joined Sep 30, 2009
10,045
Thanks for the responses. I will add a pullup resistor and give you a feedback on the waveform.
Also, while a 339/393 is based on an opamp, its internal circuit is modified to be a comparator. You would be better off using a real opamp.
 

dl324

Joined Mar 30, 2015
16,846
Please can you shade more light on what you are saying.
Integrating a square wave will give a triangle wave, integrating a triangle wave will give a sine wave.

Do you understand the circuit you're simulating? Do you have R2 and R3 connected to the output of the first opamp? I don't see a connection dot.

What is the purpose of R6?
 

Thread Starter

nma

Joined Feb 1, 2016
15
Integrating a square wave will give a triangle wave, integrating a triangle wave will give a sine wave.

Do you understand the circuit you're simulating? Do you have R2 and R3 connected to the output of the first opamp? I don't see a connection dot.

What is the purpose of R6?
Yes. The two resistors are connected to the output of the first opamp. R6 is a pull-up resistor to sink the current. I still do not get an output that is triangular wave form. I used a breadboard to connect but cannot get anything.
 

Alec_t

Joined Sep 17, 2013
14,280
R6 should connect to +12V from the comparator output pin, not from the supply pin, if you're using a comparator instead of the opamp as per the circuit in post #1.
 
Last edited:
Top