Continue to Site

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.

  • 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.

beginner: validation of a window comparator circuit

Status
Not open for further replies.

nyoo

Member
Could someone please help a muddled beginner with a window comparator circuit design?

See attached. It is a composite of several designs.
The IC1 is an LM393.
The relay will control a 115VAC, 0.5A motor. I liked the T77S1D10-12 relay: 10A and 12VDC and 720 ohms.
The resistors are 5%, 0.25 watt.

The range of temperatures when the relay should be closed (i.e., when motor should be on) is 43° Celsius to 74° Celsius; that corresponds to an LM335 range of 3.15V to 3.45V.

I have several doubts.
1. The LM335 datasheet says, "Operates from 450uA to 5mA." Is the 8.2K resistor correct?
2. As configured, will the LM335 feed both halves of the IC1?
3. What values of R1, R2, R3 give Vref1 = 3.15V and Vref2 = 3.45V? Could you show me how you calculated them? Should the R2 be a trimpot?
4. The T77 comes in 3A and 10A varieties, same price. Is there any downside to using the 10-amp version for a 0.5-amp motor?

And then, what feels like a difficult question.
5. The relay is good for 200,000 operations, so I'd like to add hysteresis. How do I add hysteresis to a window comparator?

Thank you very much for your help.
 

Attachments

  • window comparator.jpg
    window comparator.jpg
    16 KB · Views: 1,749
The range of temperatures when the relay should be closed (i.e., when motor should be on) is 43° Celsius to 74° Celsius; that corresponds to an LM335 range of 3.15V to 3.45V.

I have several doubts.
1. The LM335 datasheet says, "Operates from 450uA to 5mA." Is the 8.2K resistor correct?

8.2K will give about 1mA which should be fine.

2. As configured, will the LM335 feed both halves of the IC1?

Yes.

3. What values of R1, R2, R3 give Vref1 = 3.15V and Vref2 = 3.45V? Could you show me how you calculated them? Should the R2 be a trimpot?

If the required accuracy of your setpoints is better than 5% then you need a trimpot. If so, then you should break the divider into two separate dividers (2 resistors and 2 trimpots) so you can adjust each setpoint separately without interaction.

Also the accuracy of your setpoints depends upon the accuracy of the 12V supply. For good accuracy you would should add a reference voltage to supply the resistor dividers.


4. The T77 comes in 3A and 10A varieties, same price. Is there any downside to using the 10-amp version for a 0.5-amp motor?

No downside unless the 10-amp verison requires more coil current.

And then, what feels like a difficult question.
5. The relay is good for 200,000 operations, so I'd like to add hysteresis. How do I add hysteresis to a window comparator?

You would add resistors in series with the positive input and then resistors from the output to each positive input.
There is a fundamental problem with your design. The polarity is such that both comparator outputs are high (relay off) in the window and the relay is on outside the window, the opposite of what you want. To correct this, replace the PNP with an NPN transistor. Connect the emitter to ground with the relay connected between +12V and the transistor collector. The transistor base would go to the comparator paralleled outputs with the 1k going between +12V and the transistor base.
 
The 1k resistor used to turn on an NPN transistor must be 2k minimum because the minumum output current of a low power LM393 comparator is only 6mA.
 
I'm obliged. Most of my questions are now answered. However, two things are still a little blurry.

"If the required accuracy of your setpoints is better than 5% then you need a trimpot. If so, then you should break the divider into two separate dividers (2 resistors and 2 trimpots) so you can adjust each setpoint separately without interaction."

I'm having a hard time visualising this. Would anyone have the time to provide a quick sketch? What size are the resistors? What size the trimpots? Where, relative to the connections to the IC?

I will add a reference voltage, and swap the PNP transistor for an NPN, thanks.

"You would add resistors in series with the positive input and then resistors from the output to each positive input."

Sorry, my skill with the short-hand is quite limited. You're saying I provide feedback to both positive inputs; I see that. But a quick sketch would help a lot. What size resistor(s) going back from the output. Where do those "series" resistors go?

Thanks.
 
"If the required accuracy of your setpoints is better than 5% then you need a trimpot. If so, then you should break the divider into two separate dividers (2 resistors and 2 trimpots) so you can adjust each setpoint separately without interaction."

I'm having a hard time visualising this. Would anyone have the time to provide a quick sketch? What size are the resistors? What size the trimpots? Where, relative to the connections to the IC?

You could use potentiometers to set your window limits as the attachment suggests. My calculations show a 20k pot for each comparator should do the trick. If you try this, however, be sure to use the PNP transistor, since both comparators, as in the original circuit, are sinking current.;)

Questions?
 

Attachments

  • window comp sugg..JPG
    window comp sugg..JPG
    31.6 KB · Views: 436
You could use potentiometers to set your window limits as the attachment suggests. My calculations show a 20k pot for each comparator should do the trick. If you try this, however, be sure to use the PNP transistor, since both comparators, as in the original circuit, are sinking current.;)

Questions?
Crutschow already explained why the PNP won't work, and he explained how to connect an NPN, which will work.
 
Thanks, Allvol, for the sketch. So, it's simple: 20K variable resistor and attach the wiper. Easy when you know. Thanks also for reinforcing how to check for the variable voltage on a live circuit.

Double hysteresis.

Could someone please clarify concerning the double hysteresis? I think the circuit already has resistors in series with the positive input: the 8.2K for IC1B, the wiper (now) of a trimpot for Vref2. Lot of small beginner questions, though.

Do I need more resistors, or is enough to have the 8.2K and the trimpot? Do I connect the feedback resistors between these resistors and the ICs, as I see in most sketches? Should both feedback resistors be the same size, or are the two Vref voltages sensitive enough to require a difference? (I can convert the voltage to a temperature range, which I'd like to keep to about datasheet says 10 mV per °C, and I'd like 5-8 degrees Celsius.)

Thanks.
 
Last edited:
How much hysteresis (in degrees Celcius) do you want?

Edit: I guess you answered that. You want 5-8 deg. on each edge of the window, is that correct?
Just curious: Why do you want a motor to be on when the sensed temperature is between 43 deg and 74 deg?
 
Last edited:
Ron, this circuit will control a pump that carries hot water from a solar heat store (a box of hot water, 150 gallons or 600 litres) from my garden to my house. The lowest temperature that will give up the heat into the house, without a fight, is about 43 C. (Might rethink this to 40 C, given the cost of heating oil.) The run of pipe between garden and house is buried and insulated with extruded polystyrene, which has a maximum service temperature (before it begins to melt) of 74 C.

I'm so clumsy with soldering, especially external connections, that I wanted to keep the circuit to a single heat sensor.

Yes, to answer your question, on each edge of the window.
 
Last edited:
If your +12V supply is regulated, you should be able to use the circuit below.
Some of the members will say that this is a typical over-designed Roff circuit, :rolleyes: but it should be super-stable, and the upper and lower threshold limits do not interact.
If +12V is not regulated, we might have to make a small change.
EDIT: Oops! Forgot a resistor.
 

Attachments

  • thermal window controller.PNG
    thermal window controller.PNG
    38.4 KB · Views: 513
Last edited:
Yes, 12V supply is regulated. Is this in aid of the double hysteresis?
No, it relates to using +12V at the top of R10. This voltage needs to be stable in order for the upper threshold to be stable.
 
Wow, Ron, I can follow that! Thank you for your efforts.

Now, about the part of the circuit over on the left, around the LM431? What does that do? It looks like it's a regulator similar to an LE33CZ, but there must be a reason why you didn't use a "canned" solution.
 
Wow, Ron, I can follow that! Thank you for your efforts.

Now, about the part of the circuit over on the left, around the LM431? What does that do? It looks like it's a regulator similar to an LE33CZ, but there must be a reason why you didn't use a "canned" solution.
You could use LE33CZ. I wasn't aware of it. The 3.3V reference is halfway between your upper and lower thresholds, and provides a "stiff" voltage to tie the pots to, giving you lots of resolution on the adjustments (each pot has only 300mV across it) and very little drift due to the temperature coefficients of resistive dividers (which you would otherwise have) and potentiometers.
 
Ron,

It will be built as specified, substituting only the LE33C for the LM431 subcircuit. Do you have time for three hopefully final questions?

I've never encountered a circuit with a 100 ohm trimpot before; and here, at R5 and R8, there are two. You can probably tell that I cannot count voltage drops yet. You did mean 100 ohm, I hope, and not 100K ohm?

The minus on C2 should be a plus? And C1 doesn't seem to be attached, was it supposed to be part of the LM431 subcircuit?

And thanks, Ron and all.
 
Ron,

It will be built as specified, substituting only the LE33C for the LM431 subcircuit. Do you have time for three hopefully final questions?

I've never encountered a circuit with a 100 ohm trimpot before; and here, at R5 and R8, there are two. You can probably tell that I cannot count voltage drops yet. You did mean 100 ohm, I hope, and not 100K ohm?

The minus on C2 should be a plus? And C1 doesn't seem to be attached, was it supposed to be part of the LM431 subcircuit?

And thanks, Ron and all.
You are having a problem viewing the schematic. There is nothing missing when I view it, and there is a plus sign on C2. Can you click on the schematic and make it larger? If not, your monitor must be low resolution or something.
The pots are indeed 100 ohms, not 100k. It is a common value.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top