LM135 voltage ref


Closed Thread
Results 1 to 3 of 3
  1. #1

    Default LM135 voltage ref

    Hi everyone,
    I'm trying to study a pic based thermometer using LM135 and PIC16F876A, but the display value is jumping from high to low, I think it has something to do with the voltage reference but I'm not really sure how it must be done. Please check my schematic and codes that I'm using.


    *************************************
    CLEAR

    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50

    TRISA = %11111111
    ADCON1 = %00000011 ' Set PORTA.0,1,2,5 = A/D, PortA.3 = +Vref
    samples VAR WORD ' Multiple A/D sample accumulator
    sample VAR byte ' Holds number of samples to take
    temp VAR byte ' Temperature storage
    samples = 0 ' Clear samples accumulator on power-up
    LOOP:
    FOR sample = 1 TO 20 ' Take 20 samples
    ADCIN 0, temp ' Read channel 0 into temp variable
    samples = samples + temp ' Accumulate 20 samples
    PAUSE 250
    NEXT sample
    temp = samples/20
    Serout PortC.1, 6, [$FE, 1, #temp]
    samples = 0
    GOTO loop
    END

    *************************************


    Thanks in advance,
    joe
    Attached Images Attached Images  

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Try a capacitor between the signal pin of LM and ground. 22uF?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Thumbs down

    Hi,

    Let's see

    Ambient temp is ~ 300°K LM 135 outputs 3v

    ADC Counts = 3/5*256 = 153 ... that's OK


    mmmmmmh, what about connecting AN3 input to Vss ... and making it an input (!)

    or MUCH BETTER correcting your ADCON1 settings ...

    cause , for now, you do not have any Vref at all ...

    AND you've forgotten to connect the second GND ( or VSS ) PIN !!!

    Alain
    Last edited by Acetronics2; - 3rd April 2008 at 16:09. Reason: GND PIn !
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. high voltage high frequency H-Bridge
    By George in forum Off Topic
    Replies: 6
    Last Post: - 27th April 2009, 11:50
  2. Expanded Scale Voltmeter
    By Pic_User in forum Schematics
    Replies: 6
    Last Post: - 8th February 2008, 20:32
  3. make a low voltage output from a PIC pin
    By emptyset in forum General
    Replies: 1
    Last Post: - 8th February 2008, 19:20
  4. Help with final project
    By OvERKiLL in forum General
    Replies: 4
    Last Post: - 15th December 2006, 20:35
  5. Project-Read voltage in / different voltage out
    By andydoc in forum mel PIC BASIC
    Replies: 6
    Last Post: - 8th August 2005, 15:20

Members who have read this thread : 1

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