Problem With Op-Amp Comparator

Discussion in 'Homework Help' started by HeWasOnly3, Dec 6, 2010.

  1. HeWasOnly3

    Thread Starter New Member

    Sep 2, 2010
    Hi gurus, currently I'm trying to do a simulation on a question regarding comparator. First of all the question requires me to use an input of 200mVpp, 500 Hz(Which can be achieved by using a Function Generator) and output it to a square wave 0 to 5V. So for my attempt to do this question, I have used a non- inverting amplifier and a comparator to solve this question. Okay, the thing that I don't understand is that why my output is 743mV to 4.27V instead of 0V to 5V? Here is my circuit constructed using Multisim. Many thanks :D
  2. bertus


    Apr 5, 2008

    There are two main problems with the circuit.

    1) the input signal give both + and - signals, but the opamp is single powered.

    2) the second opamp compares to ground, but the signal probably wont go negative.

    Take a look at the attached PDF for single supply opamp circuits.

  3. HeWasOnly3

    Thread Starter New Member

    Sep 2, 2010
    Okay I have corrected the first mistake but it looks weird. You see if I connect both + and - of the input, I will have to set the Amplitude to 50mVp in order to achieve 200mVpp. In contrast to my previous circuit in which I use only + and ground input, I need to set Amplitude to 100mVp in order to achieve 200mVpp. I have read the pdf file that you have uploaded however I still cant get 0 to 5V square wave result. Here is my modified circuit.
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    What you are trying to build is a zero crossing detector with dual polarity output.

    Google should give you good ideas. has a few schematics for this.
  5. HeWasOnly3

    Thread Starter New Member

    Sep 2, 2010
    I have read that and tried the circuit, however it still wont produce 0 to 5V output hmmm....:(
  6. StayatHomeElectronics

    Well-Known Member

    Sep 25, 2008
    The output limitations are a function of the opamp. Their output does not typically reach the supply rails that power it. To get closer, there are "rail-to-rail" output opamps that achieve voltage outputs that are much closer to the supply rails. However, they also do not typically achieve the exact 0V and 5V that you are looking for.

    Here is an example data sheet for a "rail-to-rail" opamp. Page 5 has output characteristics. It shows that with low currents the high and low output, V(oh) and V(ol) get within millivolts of the supply rails, V(cc) and V(ee). However, with larger output currents the output voltages get further and further away from the rails.

    Opamps without the "rail-to-rail" capabilities start with their output further away even at low output currents...

    Last edited: Dec 7, 2010
  7. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    Adding a mosfet switch to the output might get you closer to your 0 volt / 5 volt levels.

    A logic level mosfet preferably, so the 4.something volt signal can push it into full conduction.