Thermostat with LM35 and LM311, questions regarding pull up resistor and switch

Discussion in 'The Projects Forum' started by shanipribadi, Nov 29, 2009.

  1. shanipribadi

    Thread Starter New Member

    Nov 28, 2009
    3
    0
    Hello, I got a class project of making a thermostat based on lm35. After reading many schematics online, I decided to make the circuit like in the following attachment. Basically it's a comparator with a fixed Vref of 342mv, hysteresis of 50 mv, and trip point of 324mv and 374 mv. It should drive a relay that will switch a heater (using a light bulb). Below the threshhold the lightbulb should be on. and above the threshhold it should be off.
    The thing is it didnt work. So I tried testing the components separately. So far the LM35 and LM311 works fine, using R1, R2, R3, R4 I got it working. If the temp is higher than threshold (342 mv) than LM311 will output around 360 mv linearly with temperature, while if it's lower it will output around 4mv.
    Satisfied with that, I put R5 like in the schematic (pull-up resistor), LM311 would output 4.98 V, the thing is the temperature is still under threshold. Checking the output of LM35, I found that the output is around 1.6 V (when it should be around 280 mv, 10mv/Centigrade). Apparently the pull-up resistor also pull-up the output of LM35.
    Anyone got any clue of what went wrong? Also does any one have any suggestion to make it work? Anyway, is the transistor required? Is it used to amplify the output of LM311? If so, then I wouldn't need the pull-up resistor right? But if I could use a pull-up resistor then could I ditch the transistor and power the relay using the output of LM311 (5V)? But I still need to figure out how to give a pull-up resistor for the LM311 without affecting the output of LM35.
    Help, anyone?

    Regards Shani HP

    p.s. the transistor is 2n2222 from fairchild, and the diode is 4004. Should I use a different diode?
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
    Hello,

    The reference voltage at the - input of the 311 is to high.
    It is (27 / (2+27)) X 5 = 4.655 Volts.
    You state it is 342 mV.

    Greetings,
    Bertus
     
  3. shanipribadi

    Thread Starter New Member

    Nov 28, 2009
    3
    0
    Oops.. sorry. I drew the picture wrong, but i use the correct one for the real circuit. It should be that R2 is 27K and R3 is 2K, so 2/(2+27)*5 = 344.8 mv

    updates:
    I tried using a pulldown resistor, but it moves the threshhold point too far. Haven't found the correct equation if im going to use a pulldown resistor to adjust the threshhold.
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
    Hello,

    Ok, that sounds right then for the reference voltage.
    What did you do with the power and ground pins of the LM311.
    Pin 8 should be + 5 Volts in your case.
    Pins 1 and 4 should be ground.

    See the internal connections of the LM311:

    [​IMG]

    Greetings,
    Bertus
     
  5. shanipribadi

    Thread Starter New Member

    Nov 28, 2009
    3
    0
    yep, I connected pin 1 and 4 to ground, while pin 8 is the +5 volts.
    The problem is that using that circuit, the positive feedback would cause the output voltage of lm35 (i checked using meter between output pin of lm35 and ground) to be very high, and will not go down no matter what.
    It's really confusing because I did not expect the output voltage of lm35 to be affected by the positive feedback. Btw, could it be that the ic is broken, i missconnected some of the pin once, and the op-amp and the sensor were overheated. Even though I tested them again separately and they worked fine (I tested the op-amp without a pull-up resistor, comparator output is around 7mv when off, and 350mv and rising when turned on)
     
  6. bertus

    Administrator

    Apr 5, 2008
    15,649
    2,348
    Hello,

    Not correct connecting of ic's can cause them to break.
    A LM311 always needs a pull up resistor as the output is open collector.
    Most times a 1K resistor is used in 5 Volts apllications as pull up resistor.

    You can check the LM35 by disconnecting it from the opamp and see what the output voltage is then.
    The feedback should not affect the output as the LM35 can deliver 10 mA at the output.
    You could always use 10K and 900K in the feedback loop.

    Greetings,
    Bertus.
     
Loading...