CrazyEngineers
  • Application specific problems: DC voltage comparator circuit

    PrinceTan

    Member

    Updated: Oct 26, 2024
    Views: 1.4K
    Hi fellow CEians,

    I have a project currently requiring to compare a voltage to 24V reference and it must trigger a relay output when the input voltage is lower than 24V reference. Both voltages are DC supply. I planned to use LM393 and provide it with the same 24V reference as supply. Can it be done? Does the parameter of input common mode voltage range affect my application? I'm guessing it does, meaning I need to use a voltage divider to drop both input and reference voltage to below 24V? Any help is appreciated.

    Regards,
    Prince.
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • arunchary

    MemberNov 8, 2012

    yes it can be ,please follow the circuit as in pdf
    Are you sure? This action cannot be undone.
    Cancel
  • Vishal1485

    MemberNov 9, 2012

    can't get your terms because you seems to use comparator and then reference voltage as 24V. then relay would be triggered when the input voltage threshold voltage or reference
    voltage
    Are you sure? This action cannot be undone.
    Cancel
  • PrinceTan

    MemberNov 11, 2012

    I wanted to compare an input voltage (variable voltage from a battery, around 24V) to a reference voltage of 24V dc which will also serve as the supply voltage to the comparator. Then the output will be on (trigger the relay) when the input voltage (from battery) is lower than the reference voltage of 24V.
    Are you sure? This action cannot be undone.
    Cancel
  • PrinceTan

    MemberNov 11, 2012

    arunchary
    yes it can be ,please follow the circuit as in pdf
    Dear Mr. Arunchary
    Do you mind explaining why does it have to be that complicated? Can I just connect the relay to the output of the comparator, LM393; and have the 24V reference connected to the non-inverting terminal while the input voltage connected to the inverting terminal? Sorry I don't know how to draw out the circuit and post it here. I'm just an engineering student with little to no experience in constructing analog circuits.

    On another note, a comparator or op-amp with 24V supply cannot accept a 24V input through either of the differential inputs right? That is defined by the input differential common mode voltage range is it?
    Regards,
    Prince.
    Are you sure? This action cannot be undone.
    Cancel
  • arunchary

    MemberNov 11, 2012

    thank you Mr prince u r the engineering guy, sorry for that ,i dont know u know better than me, and one more thing i had given an idea more over its not lm339 its lm358 and lm339 can be operated till 24v,please go through the data sheet there its mentioned till vcc we can compare the voltage.any ways its not my advice or suggestion, i did an experiment on proteus simulator,.. circuit diagram which i tested is mentioned in pdf. thank you
    regards
    arun.
    Are you sure? This action cannot be undone.
    Cancel
  • PrinceTan

    MemberNov 13, 2012

    arunchary
    thank you Mr prince u r the engineering guy, sorry for that ,i dont know u know better than me, and one more thing i had given an idea more over its not lm339 its lm358 and lm339 can be operated till 24v,please go through the data sheet there its mentioned till vcc we can compare the voltage.any ways its not my advice or suggestion, i did an experiment on proteus simulator,.. circuit diagram which i tested is mentioned in pdf. thank you
    regards
    arun.
    Dear Mr. Arunchary
    I get the impression that you are not very happy when you type the reply, maybe its just me. But I am indeed blur about this, and that is the reason why I posted here SEEKING FOR HELP. Most circuits I found online are quite complicated like the ones you posted and I ended up scratching my head wondering why all the extra components are needed. If you don't feel like babysitting me, I wouldn't mind it as well. Thanks again anyhow for the reply and the circuit.
    Regards,
    Prince.
    Are you sure? This action cannot be undone.
    Cancel
  • PrinceTan

    MemberNov 15, 2012

    Can anybody please answer this question: Can a voltage comparator (or op-amp) IC like LM393 or LM358's output directly be fed into driving a 24V relay? This is the problem that I encountered: I fed reference voltage into non-inverting terminal while the voltage that I intend to compare is fed into the inverting terminal. I had a voltage divider to drop both input voltages down to half of the supply voltage and directly fed the output through a resistor to a 24V relay. But I get 0V output all the time. There's nothing wrong on the pin connection, I also checked to see that the comparator received the correct voltages at all points. If you don't mind babysitting me, please do reply; thanks in advance.
    Are you sure? This action cannot be undone.
    Cancel
  • Jeffrey Arulraj

    MemberNov 16, 2012

    Why not implement a zener diode in the input side to serve such a purpose
    Are you sure? This action cannot be undone.
    Cancel
  • Jeffrey Arulraj

    MemberNov 16, 2012

    I am not a great expert in this field but friends just solved this issue I guess here is his word verbatim

    Not sure what your actual circuit is, but LM393 has an open collector output, the output voltage will be always 0 unless you connect a pullup. With exact equal input voltages, the comparator output will reflect the offset voltage. There should be at least a small voltage difference. To control a relay, you'll usually want to add hysteresis to the comparator circuit to avoid relay chatter.​
    Hope this clears you my friend
    Are you sure? This action cannot be undone.
    Cancel
  • Jeffrey Arulraj

    MemberNov 16, 2012

    The comparator will give 0 V which is the difference between the two ip Voltages that is what He means

    I think you get it

    Other wise post the schematic then I can be of a little more help to you
    Are you sure? This action cannot be undone.
    Cancel
  • grsalvi

    MemberNov 17, 2012

    PrinceTan
    Hi fellow CEians,

    I have a project currently requiring to compare a voltage to 24V reference and it must trigger a relay output when the input voltage is lower than 24V reference. Both voltages are DC supply. I planned to use LM393 and provide it with the same 24V reference as supply. Can it be done? Does the parameter of input common mode voltage range affect my application? I'm guessing it does, meaning I need to use a voltage divider to drop both input and reference voltage to below 24V? Any help is appreciated.

    Regards,
    Prince.
    I cant help you much with comparator and transistor part,but as far as
    relay is concerned , read below :
    relay


    Please refer to circuit above.

    a) The point B and point A of relay is connected to circuit which you want to control
    by closing and opening relay.

    b) Through point 1 ,we feed DC voltage which energies coil of relay labeled number 2.
    Whenever a 12V DC is fed into this coil (2) ,the relay switch (6) is closed ,hence
    closing circuit and completing the main circuit (which you connected to point B and point A) .

    c) Now how to control closing and opening of relay switch (6) ???
    For that a transistor is connected in series with relay coil (2). The transistor is labeled (3).

    d) So ultimately , you can control relay by switching ON or OFF transistor (3).

    e) You have to give a small signal to base of Transistor (3), to turn it ON or OFF .
    In Our case we would give it through PLC.

    f) You can use anything to supply a small signal enough to turn ON transistor.
    This signal is fed at point (4).

    f) As base of transistor gets signal,transistor current flows and the relay coil circuit (2) gets
    completed.
    This eventually closes relay switch (6).


    If this concept fits with your project and you have doubts ,feel free to ask here.😀

    Note :i) don't search for label 5 , i skipped it by mistake.😉
    ii) The relay is electromagnetic type.
    Are you sure? This action cannot be undone.
    Cancel
  • PrinceTan

    MemberNov 18, 2012

    jeffrey samuel
    I am not a great expert in this field but friends just solved this issue I guess here is his word verbatim


    Hope this clears you my friend
    Dear Mr. Jeffrey Samuel,

    Yes, I did connect a 2k7 resistor to act as a pullup. Still there's no output. I even attempted to connect the output to a transistor acting as a switch to activate the relay, still, no results. A friend of mine helped me do similar testing and the output even shows negative voltage. I'm so lost. However, I do note something: when the inverting input > non-inverting input, I measured 1.7M ohm resistance on the output side; when the non-inverting input > inverting input, the output resistance is measured to be 110 ohm. Is it possible that all 3 IC that I purchased are all faulty? Anyways, I appreciated your feedback. Thanks.

    Sincerely,
    Prince.
    Are you sure? This action cannot be undone.
    Cancel
  • PrinceTan

    MemberNov 18, 2012

    grsalvi
    I cant help you much with comparator and transistor part,but as far as
    relay is concerned , read below :
    relay


    Please refer to circuit above.

    a) The point B and point A of relay is connected to circuit which you want to control
    by closing and opening relay.

    b) Through point 1 ,we feed DC voltage which energies coil of relay labeled number 2.
    Whenever a 12V DC is fed into this coil (2) ,the relay switch (6) is closed ,hence
    closing circuit and completing the main circuit (which you connected to point B and point A) .

    c) Now how to control closing and opening of relay switch (6) ???
    For that a transistor is connected in series with relay coil (2). The transistor is labeled (3).

    d) So ultimately , you can control relay by switching ON or OFF transistor (3).

    e) You have to give a small signal to base of Transistor (3), to turn it ON or OFF .
    In Our case we would give it through PLC.

    f) You can use anything to supply a small signal enough to turn ON transistor.
    This signal is fed at point (4).

    f) As base of transistor gets signal,transistor current flows and the relay coil circuit (2) gets
    completed.
    This eventually closes relay switch (6).


    If this concept fits with your project and you have doubts ,feel free to ask here.😀

    Note :i) don't search for label 5 , i skipped it by mistake.😉
    ii) The relay is electromagnetic type.
    Dear Mr/Mrs grsalvi,

    Thank you for the detailed explanation. I am aware of the transistor usage for switching on and off the relay. Have taken this into consideration when troubleshooting the comparator circuit but still, no positive results. Either I have damaged the comparator IC by reversing the polarity (which I'm quite sure I haven't) or all 3 IC that I have purchased are faulty.

    Sincerely,
    Prince.
    Are you sure? This action cannot be undone.
    Cancel
  • Jeffrey Arulraj

    MemberNov 18, 2012

    Faulty IC's are so lame just test individual IC's if they are working or not.

    Then pls put the circuit you are using then we can help you more easily ..
    Are you sure? This action cannot be undone.
    Cancel
  • PrinceTan

    MemberNov 20, 2012

    Dear all CEians,

    I have successfully got the circuit up and running. My final circuit uses LM358 as the LM393 output is open drain configuration and I don't know how to use it to perform my requirements. Will upload the circuit sometime later as I can't upload it using this current computer. Thanks so much for those who care to enlighten me on this matter, I appreciated it very much.

    Regards,
    Prince.
    Are you sure? This action cannot be undone.
    Cancel
  • PrinceTan

    MemberNov 21, 2012

    Here it is as promised.. Hope this can help others..
    Are you sure? This action cannot be undone.
    Cancel
  • Shadn

    MemberMay 10, 2015

    Hi all,

    I have a also a similar problem. I have got two voltage sources in my circuit; a 9V Battery and a super-cap charged by a solar cell which provides about 5 V. I need a comparator circuit which always pick and connect the higher voltage as the power supply of the circuit. (Infact it must switch to the super-cap as the battery is below 5V).
    Can I use the same circuit?
    Hi all,

    I have a also a similar problem. I have got two voltage sources in my circuit; a 9V Battery and a super-cap charged by a solar cell which provides about 5 V. I need a comparator circuit which always pick and connect the higher voltage as the power supply of the circuit. (Infact it must switch to the super-cap as the battery is below 5V).
    Can I use the same circuit?
    Are you sure? This action cannot be undone.
    Cancel
  • Shadn

    MemberMay 10, 2015

    Hi all,

    I have a also a similar problem. I have got two voltage sources in my circuit; a 9V Battery and a super-cap charged by a solar cell which provides about 5 V. I need a comparator circuit which always pick and connect the higher voltage as the power supply of the circuit. (Infact it must switch to the super-cap as the battery is below 5V).
    Can I use the same circuit?
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register