Help thermostat opamp with lm35

Discussion in 'General Electronics Chat' started by joerack, Jun 11, 2016.

  1. joerack

    Thread Starter Member

    Jun 2, 2016
    30
    1
    Hello, I thought about opening a new thread as this is slightly different

    I'm still trying to build a thermostat with an opamp and a lm35

    It works perfectly as a thermostat wih 123dcircuits, but I cannot for the life of me, build the physical circuit, I'm getting simply the same voltage with and without the LM35, the opamp is simply not doing it's job.

    Somebody is saying that a lm741 is not advisable, and that I need a single voltage opamp, could you please shed some light on this
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,086
    3,025
    If you read the data sheet for the 741, you'll find that it cannot sense voltages that fall within a couple volts of either power rail. Your simulator may be using an ideal op-amp rather than a real model of the 741. The signal from your LM35 is too close to ground, so the 741 cannot use it. An LM358 (and many other op-amps) can sense to very near the negative rail and would work in this circuit.

    Better yet, learn about the LM393 comparator. You're using an op-amp configured as a comparator. A purpose-built comparator does a better job, although an op-amp is fine for this application.
     
  3. joerack

    Thread Starter Member

    Jun 2, 2016
    30
    1
    thanks for the answer. I have a lm324, would that solve my problem?
     
  4. dl324

    Distinguished Member

    Mar 30, 2015
    3,211
    619
    If you check the datasheet you'll see that the input common mode voltage range includes 0V.

    Do everyone a favor and post a schematic so it'll be easier to follow your circuit. I see an opamp being used as an amplifier, not a comparator.
     
    Last edited: Jun 11, 2016
  5. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,377
    494
    Like you say, if they are using 741, they could provide -9 volts to power the other rail of 741. That way they can get withing the 0 volts provided by LM35.
     
  6. dannyf

    Well-Known Member

    Sep 13, 2015
    1,767
    356
    tough to read your picture. a real schematic would be more helpful.

    a 741 can be made to work here.
     
  7. wayneh

    Expert

    Sep 9, 2010
    12,086
    3,025
    Yes, and a common trick for doing that is to just use another 9V cell.
    But the LM324 should work as-is.
     
  8. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,377
    494
    I completely agree.
    It is simply a question of what OP has near by and their knowledge/experience. I have 4 pack of 9 volts batteries near by so I would probably grab another battery. I got some op amps, but they are further away and will need more work to setup.
     
  9. joerack

    Thread Starter Member

    Jun 2, 2016
    30
    1
    Is this good enough?

    I've just started studying comparators, so I really don't know how to add a schmitt's trigger to this circuit
     
  10. dl324

    Distinguished Member

    Mar 30, 2015
    3,211
    619
    No. It is too difficult to discern circuit function from something like that. Something more like this:
    upload_2016-6-11_11-46-38.png
     
    Last edited: Jun 11, 2016
  11. wayneh

    Expert

    Sep 9, 2010
    12,086
    3,025
    I think it would be best to step back and define what you want your circuit to do. I read "thermostat" as an on/off switch, but the circuits shown are not really configured that way. And I don't see any load being switched.

    If you want to amplify the LM35 output before feeding that to a thermostat, that's fine, but it requires a different circuit.

    I posted a completed project that, while overkill, might help you see how to use the LM35 in a thermostat.
     
  12. dannyf

    Well-Known Member

    Sep 13, 2015
    1,767
    356
    in cases like this, the typical trick is to give it a common mode signal. you just need a volt or two to get it to work.
     
  13. joerack

    Thread Starter Member

    Jun 2, 2016
    30
    1
    I would need a temperature alarm circuit that starts with a lm35, amplifies with an opamp and increases the voltage enough to make a 9/12v fan spin when the temperature of the place to be controlled exceeds a set level.

    I can do it with arduino instead of the opamp, easy enough, but I would like to implement it without coding.

    I'm thinking that even if the opamp were to do it's job, i would need at least 90/100% of the power to make the fan spin
    Probably it would be best to keep a lower threshold and use a relay
     
  14. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,377
    494
    Question 1.
    The fan spins only when one temperature is detected? Meaning that when temperature is X, fan is on. When temperature is below X, the fan is off.

    Question 2.
    When the fan is on, the fan runs at a single speed. You are not doing that whole variable speed thing. Right?
     
  15. wayneh

    Expert

    Sep 9, 2010
    12,086
    3,025
    And even if you want variable speed, the better way to do it is with PWM. Just like turning it on and off once like a thermostat, doing PWM switches power to the fan via a MOSFET switch.
    You don't need to amplify the LM35 signal if you're doing a thermostat, and need a range of a couple degrees. An op amp or comparator will do fine by itself. If you want tighter control, down to 0.1 degrees or so, then you'll need to amplify the signal first with an op amp.
     
  16. joerack

    Thread Starter Member

    Jun 2, 2016
    30
    1
    this project looks like a very good attempt. I tried in building it with the lm324 as suggested, but the same issue appeared.
    probably the lm324 cannot detect the very low lm35 voltage
    what if I were to change the lm324 with a lm311

    And one more thing: is there a way to simplify the circuit? like removing the transistor on the second opmamp's histeresis feedback?
     
  17. dannyf

    Well-Known Member

    Sep 13, 2015
    1,767
    356
    absolutely.
     
  18. joerack

    Thread Starter Member

    Jun 2, 2016
    30
    1
    keeping the Hysteresis?
    Could you please show me how, I'd be very grateful
     
  19. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,377
    494
    Assuming room temperature (25°C), the output of LM35 will be 250 mV or 0.25 volts.
    It seems to me that you either have something fried or you are doing something wrong.
     
  20. joerack

    Thread Starter Member

    Jun 2, 2016
    30
    1
    I am getting 250mvish.
    The op-amp simply isn't doing it's job...
     
Loading...