1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

operational amplifier ---comparator

Discussion in 'General Electronics Chat' started by boro3, Mar 2, 2018.

  1. boro3

    boro3 Member

    Joined:
    Nov 26, 2017
    Messages:
    36
    Likes:
    0
    Hello to all,
    i have a question about op amp circuits.
    is it possible to use an comparator to compare an ac sinal with a dc signal? OPamp.png
    lets say the circuit is going from a plug board 110V rms,
    to a transformer with 5V rms on the second side.
    If i make the circuit as shown in the picture ive uploaded, and if R1 is =R2, so Vr is 2.5V.
    would Vout be high if the potential at point X is greater than 2.5V?
    what makes me unsure is, that the transformer doenst have a ground, so there is no reference point for X,
    i hope you understand what i mean, and sory for my painting skills :D
     
  2. dknguyen

    dknguyen Well-Known Member

    Joined:
    May 6, 2006
    Messages:
    7,545
    Likes:
    161
    Yes it is possible. Your circuit has a few issues though:

    1. The op-amp needs to share it's ground (0V) with the ground of the DC reference on the inverting input as well as the transformer secondary (i.e. a center-tap if it has one). If the transformer doesn't have a center-tap, then you need to work around that like using a symmetrical resistive/capacitive divider (or both in parallel) to simulate a center-tap. That is one way to provide a reference for point X.

    2. If a transformer says 5V on the secondary, that's 5V RMS, which means a peak voltage of 7.07V which is too high for your 5V op-amp. If you get a transformer that steps down to 3Vrms, then it will produce 4.24 peak voltage which is better.

    3. I'm not sure what those 3 components are at the non-inverting input are supposed to be resistive dividers or something else but if you have a 3Vrms output transformer then you don't need them, and if you have a 5Vrms output transformer then you don't need them either. Just use a series resistor followed by rail clamp diodes.

    4. Consider rail clamp diodes to on the non-invertting input of the op-amp even if you have a 3Vrms output transformer.
     
    Last edited: Mar 2, 2018
    • Like Like x 1
  3. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,973
    Likes:
    1,079
    Location:
    Loveland, CO USA
    There needs to be "ground" or ref. point on the transformer/resistor divider.
    Now. from the amplifier's point of view, it is looking for something that is 2.5V above its ground. (actually the 5V battery circuit needs a ground)
    So the way things are drawn neither input of the opamp has a ground and you have double troubles.

    Maybe we need to know what you want to do. Are you just trying to see if the 110VAC is there.
     
    • Like Like x 1
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  5. Grossel

    Grossel Member

    Joined:
    Sep 16, 2008
    Messages:
    980
    Likes:
    24
    Location:
    Norway
    No it makes no sense because you have two systems without a common ground. That basically means - because of stray capacitance, the circuit may seem to work fine (not in a simulation but on a bread board, and because it works for the wrong reasons and therefor your assumptions so to speak) but when unpluggin from main, it will likely behave very erratic.

    You may just do this:

    [edit]
    a little late answer due to drawing and some other thing to to in meantime. I think averyone trying to tell the same anyway.
     

    Attached Files:

    • Like Like x 1
  6. dknguyen

    dknguyen Well-Known Member

    Joined:
    May 6, 2006
    Messages:
    7,545
    Likes:
    161
    See attached. The rail diodes clamp the voltage if it gets higher than 5+0.7V or below -5-0.7V and protects the op-amp. The series resistor limits the current through the diodes so they don't burn out. These are not optional if you are using a 24:1 transformer or a transformer that has a 5Vrms output since it will actually output a peak of 7.07V.

    The resistive and capacitive divider make a virtual center-tap to provide a 0V from the transformer. It can't supply much current so it can only be used as a reference voltage (can't draw power through it). It's connected to the ground of the 2.5V reference and the op-amp so everything has the same reference voltage. You need this so all three parts of the circuit have voltages that make sense to every other part.

    Also ignore the op-amp text...it supposed to be a comparator.
     

    Attached Files:

    Last edited: Mar 2, 2018
    • Like Like x 1
  7. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,374
    Likes:
    191
    Location:
    Ohio - GMT-5
    ONLINE
    You are very close with your drawing, but you are correct - the circuit will not work without some kind of connection between the transformer secondary and the comparator circuit. Here is one way to do that. If the transformer secondary is 5 Vrms, then its positive peak voltage is 7.07 V. Dividing this by 2 reduces it to 3.54 V, which is within the power supply voltages of the opamp. Diode D1 protects the opamp from the transformer's -7.07 V negative peaks.

    Notice that there is no -5 V supply to the opamp. You don't say what your opamp part number is, so you might need one. The LM358 is designed specifically to operate with a single +5 V supply.

    ak
    AC-Comparator-1.gif
     
    • Like Like x 1
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  9. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,857
    Likes:
    515
    Location:
    L.A., USA Zulu -8
    For your interest, below is the LTspice simulation of AK's circuit:

    upload_2018-3-2_15-54-28.png
     
    • Like Like x 1
  10. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,973
    Likes:
    1,079
    Location:
    Loveland, CO USA
    Here we are trying to make the best circuit with out more feedback from Boro3.
    This give me the idea we need a opto isolator. A opto-isolator + resistor can read the voltage on the transformer side. Send that data across the isolation to a op-amp. This way the two different circuits can work with out a common ground.
     
    • Like Like x 2
  11. boro3

    boro3 Member

    Joined:
    Nov 26, 2017
    Messages:
    36
    Likes:
    0
    Thank you all for the answer,
    this Forum is awesome,


    so i can just connect the transformer with the ground of the op amp supply ?
    wouldnt this Kind of Connection be dangerous (short circuit etc)
     
  12. Grossel

    Grossel Member

    Joined:
    Sep 16, 2008
    Messages:
    980
    Likes:
    24
    Location:
    Norway
    If you deal with bare transformer where you can potentially touch the terminals on primary side - yes then it is potentially dangerous and you should consider dropping the project if you doesn't feel completely safe about it.
     
  13. boro3

    boro3 Member

    Joined:
    Nov 26, 2017
    Messages:
    36
    Likes:
    0
    what do you mean with bare transformer?
    it will be an isolated transformer.
     
  14. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,374
    Likes:
    191
    Location:
    Ohio - GMT-5
    ONLINE
    Some transformers do not have insulated wires coming out of the windings. they have pins that wires are soldered to. The exposed pin is dangerous on the primary side, because you can make direct contact with the 120 Vac.

    The schematic as shown is safe for the circuit. Transformer current into the circuit is limited by the 10K resistors, and the R1/R2 voltage divider attenuates the peak voltage to a value that the opamp can handle.

    Based on the information you have given us, there can be no "short circuit". One of the big advantages of transformer-isolated signals is that they can be connected together like this. If the output of the opamp goes off to some other circuit with its own power supply, then we need more information to evaluate any potential problems.

    ak
     
    • Like Like x 1
  15. boro3

    boro3 Member

    Joined:
    Nov 26, 2017
    Messages:
    36
    Likes:
    0
    i just want to make some experiments and learn electronics,
    ronsimpson has wrote about optoisolator and resistor,
    could you please write how the connections would be?



    and whats about this circuit, is it right ?
    this time i want to use the opamp as a differential amp.
    the output of the amp. could go for example to an oscilloscope .
    dif.amp.png
     
  16. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,857
    Likes:
    515
    Location:
    L.A., USA Zulu -8
    Why do you want it differential?
    What is its purpose?
     
    Last edited: Mar 4, 2018
  17. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,973
    Likes:
    1,079
    Location:
    Loveland, CO USA
    A opto isolator is a device with a LED on the left and a photo transistor on the right side. When current passes through the LED, it makes light, which turns on the transistor. Because the LED and transistor are not connected together there is isolation. (just light connects the two half's of the part)

    U1 LED is connected backwards compared to U2 LED. So one turns on when the transformer is positive and the other turns on when the transformer is negative. On the "OUT" put you will see U1 pulling up OR U2 pulling down . That should be a square wave (more or less)
    upload_2018-3-3_14-45-12.png
     
    • Like Like x 1
  18. boro3

    boro3 Member

    Joined:
    Nov 26, 2017
    Messages:
    36
    Likes:
    0
    @crutshow
    for security reason,
    in case the secondary side has more the 5v rms,
    if i use a 1:1 transformer,
    it wold be possible to connect the oscilloscope with resistive divider directly to the secondary side to measure the voltage over the resistor,
    but this could be a bit dangerous i think.

    if i use a diff.amp and there is an error, the max voltage going to the osci would be the supply voltage of the diff amp, wich is much less than 100v.
    am i right?



    osci.png
    ronsimpson
    thx for the explanation,
    i thought you meant, it would be possible to track the sinusoidal curve of the transformer output with the optoisolator :D
     
  19. boro3

    boro3 Member

    Joined:
    Nov 26, 2017
    Messages:
    36
    Likes:
    0
    Hello Guys,
    Nobody has an Answer?
    is it necessary to have a common ground between secondery side and opamp if i use it as differential amp?
    because the difference schould be independent of ground, so i can use it without connecting secondary side of the transformer with the ground of the opamp right?
     
  20. dknguyen

    dknguyen Well-Known Member

    Joined:
    May 6, 2006
    Messages:
    7,545
    Likes:
    161
    Yes, still necessary. Differential inputs only means that the MEASUREMENT is independent of ground. It doesn't mean that the signal is independent of ground. The internal function of the amplifier itself still needs currents to flow into the inputs and through ground and it still relates ground to the inputs in some way. An example of this is the way that the differential signal can't stray too far from ground or the amplifier won't work anymore, like how you can't apply 30V and 29V and still have the amplifier measure 1V because the common mode voltage at the differential inputs is too far away from ground.

    Differential measurement just means that ground is not used as the reference in the measurement. It is not the same thing as saying ground is no longer needed. It's a bit like measuring the distance between the 3rd and 4rth floor of a building:
    1. You can measure the floors with respect to ground and then subtract them to find their distance between each other (non-differential).

    2. Or you can measure the distance between the 3rd and 4rth floor directly (differential measurement). The ground doesn't play a role in the measurement, but the ground still needs to be there for the building to sit on. Without the ground for the building to sit on, everything stops working.

    If you're trying to measure the distance between the 499th and 500th floor, you might not be able to measure it at all even though your measuring tape is long enough to measure the distance between the floors directly (differential measurement) because you don't have a crane that can reach high enough for you to use your measuring tape (the diifferential input voltage is within op-amp limits but the common mode input voltage is too high).

    Everything still depends on ground to function even though the measurement doesn't depend on ground and nothing is being measured with ground as the reference.

    For it to be truly independent of ground, the differential inputs of the op-amp would have to be floating, which it is not.
     
    Last edited: Mar 5, 2018
    • Like Like x 1
  21. boro3

    boro3 Member

    Joined:
    Nov 26, 2017
    Messages:
    36
    Likes:
    0
    Thank you very much,
    my thought was to connect it like this ?
    dif.amp.png
     
  22. AnalogKid

    AnalogKid Well-Known Member

    Joined:
    Sep 22, 2011
    Messages:
    1,374
    Likes:
    191
    Location:
    Ohio - GMT-5
    ONLINE
    Because the 5 Vac secondary is completely floating, that probably will work.

    What is it you are trying to do? What is the output of the opamp used for?

    ak
     
    • Like Like x 1

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice