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

Discussion in 'The Projects Forum' started by nma, Feb 9, 2016.

  1. nma

    Thread Starter New Member

    Feb 1, 2016
    15
    0
    Please can I use LM339 to generate a triangular and sine waveforms?
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,154
    3,060
    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.
     
  3. crutschow

    Expert

    Mar 14, 2008
    13,053
    3,244
    What is the maximum frequency you need?
     
  4. Brevor

    Active Member

    Apr 9, 2011
    279
    54
    LM339 is a comparator, an op amp would be a better choice.
     
  5. nma

    Thread Starter New Member

    Feb 1, 2016
    15
    0
    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.

    100kHz please.

    Okay. Please which of the op-amps for 100kHz?
     
    Last edited by a moderator: Feb 11, 2016
  6. dannyf

    Well-Known Member

    Sep 13, 2015
    1,830
    365
    Yes.
     
  7. nma

    Thread Starter New Member

    Feb 1, 2016
    15
    0
    Thanks. Good to know. I will send my circuit please so you help me check what I have done wrong.

    The op-amp in the schematic is used for design in multisim but I used LM339. Thanks
     
    Last edited: Feb 11, 2016
  8. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    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.
     
  9. nma

    Thread Starter New Member

    Feb 1, 2016
    15
    0
    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.
     
  10. KL7AJ

    AAC Fanatic!

    Nov 4, 2008
    2,040
    287
    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.
     
  11. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,018
    1,537
    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.
     
  12. nma

    Thread Starter New Member

    Feb 1, 2016
    15
    0
    Thanks for the responses. I will add a pullup resistor and give you a feedback on the waveform.
     
  13. nma

    Thread Starter New Member

    Feb 1, 2016
    15
    0
    Please can you shade more light on what you are saying.
     
  14. dannyf

    Well-Known Member

    Sep 13, 2015
    1,830
    365
    sounds like you know where your problem is - the said comparator has OC output.
     
  15. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,018
    1,537
    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.
     
  16. dl324

    Distinguished Member

    Mar 30, 2015
    3,250
    626
    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?
     
  17. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,809
    1,105
    Well, an approximation to one.
     
  18. nma

    Thread Starter New Member

    Feb 1, 2016
    15
    0
    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.
     
  19. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,809
    1,105
    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: Feb 16, 2016
Loading...