16f877 with LM335 problem


Closed Thread
Results 1 to 40 of 47

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Setting up the LM35 and an opamp as voltage doubler

    Thanks Ioannis.

    This (schema) is where I have come up to now - using the simple simplest, maybe too simple (...) The opamp acts as a voltage doubler (seems enough for what I need).

    BTW, I'm using a 16F690 with 10 bits ADC.
    Name:  rsz_ampli_op_2x.jpg
Views: 3924
Size:  9.6 KB
    At 24°C, the LM35 outputs 1,199V so the opamp's Vout shows 2,396V.

    Now, what is the LM35 going to output at 0°C or even less, around -20°C?

    Since 1,199V represent 24°C, can I say that at 0°C, I will have 0,959Volts (LM35 Vout)?

    Talking "temperature", what is the reference when adjusting temperature sensors at home?

    Is it this?
    Name:  rsz_digital_thermometer_hyrometer_30010106.jpg
Views: 3516
Size:  9.3 KB
    Noooooooooooooo......

    NB: You're absolutely right about Kelvins. In the field, talking with cooling systems engineers, to make sure we don't get messed up while setting up machines, we (wrongly) use Kelvins to express a temperature difference or threshold and degrees to set a temperature value
    Roger

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,161


    Did you find this post helpful? Yes | No

    Default Re: Setting up the LM35 and an opamp as voltage doubler

    I don't think it will work for minus temps the way you got it.

    Your output as I said earlier, would be directly from the LM35, meaning from the output pin AND the GND pin of the LM35. NOT the circuit Ground.

    Now, that leads us to another problem. Your new output will be 0 volts at 0 C, positive at positive temps but negative below zero (LM35 output would seem more negative than the LM35 ground). So the opamp would not be able to handle this negative voltageas you designed it.

    You are going to need a differential amplifier, such as the first opamp in my design.

    Ioannis

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: Setting up the LM35 and an opamp as voltage doubler

    Okay,

    I'll give a try to your circuit.

    Will a LM358N opamp do the job or does it absolutely need to be LMC662?

    Another thing, having in mind the accuracy I need is not that critical (+/- 2°C is okay), what is a "simple" way to measure a freezer's temperature?

    Would a thermistor do the trick in an acceptable way too?
    Roger

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,161


    Did you find this post helpful? Yes | No

    Default Re: Setting up the LM35 and an opamp as voltage doubler

    A thermistor is far from linear. I would not use it now, at least without first trying other things.

    I came up with a simpler solution to your problem. Drop the op-amp and drive the LM35 output to one ADC of your PIC. Now drive the raised GND of the LM35 to another ADC input of your PIC.

    Since the two voltages, referenced to ground, are positive, you can do a calculation in your program. (LM35output-LM35Gnd)*100 and you will have your temp. Be careful here because the subtraction will give you a negative result if the real temp is below zero.

    So now you have a circuit absolutely minimal.

    I would suggest to use a PIC with 10bits ADC and increase the resolution with oversampling to 12 bits with Darrel Taylor's oversampling routines when you have it working.

    Ioannis

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: Setting up the LM35 and an opamp as voltage doubler

    Thanks Ioannis,

    You're right: less than that is almost impossible

    Now drive the raised GND of the LM35 to another ADC input of your PIC
    I need to ADC measure the raised GND only once since it will never change - or am I missing something?

    And "yes", for sure I'll have values to measure that will be below 0°C; in fact, they will have to be always under 0°C or I'll have a problem with the food inside the freezer
    Roger

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: Setting up the LM35 and an opamp as voltage doubler

    The two diodes connected to the ground of LM35 will change their value due to temperature change.

    So this is the reason for why two ADC channels are needed.

    Since I'll have to locate the LM35 inside the freezer, shall I put these two diodes as close as possible to the LM35, meaning, the sensor and the diodes will be located inside the freezer? Or is it not necessary?
    Roger

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,161


    Did you find this post helpful? Yes | No

    Default Re: Setting up the LM35 and an opamp as voltage doubler

    You got it right about the temp instability of the diodes.

    And since both (diode and LM35) have positive coefficient regarding the temperature, i'd put both in the same thermal spot.

    Remeber, NOT to use the LM35D

    Ioannis

Similar Threads

  1. 16F877 HSERIN problem with 3th party software
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th March 2009, 17:11
  2. LCD problem with 16F877
    By alexx_57 in forum General
    Replies: 10
    Last Post: - 25th July 2007, 13:47
  3. problem using 16f877
    By yrch in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th February 2006, 18:58
  4. 16F877 20MHz problem
    By swordman in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st July 2004, 10:02
  5. 16F877, DS18S20 and Serial Comm Problem
    By YellowTang in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th April 2004, 10:36

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts