Shop OBEX P1 Docs P2 Docs Learn Events
bs2 with lm335 temp sensor and adc0804 need help writing a program — Parallax Forums

bs2 with lm335 temp sensor and adc0804 need help writing a program

betaboybetaboy Posts: 8
edited 2005-02-16 04:01 in Learn with BlocklyProp
can anyone help me write a program using those parts?
·

Comments

  • edited 2005-02-14 01:42
    The Industrial Control text is available for free download from www.parallax.com -> Stamps in Class Tutorials.· It has circuits and example programs for the LM34.· I think these examples will get you a running start.
    ·
    The LM34 is similar to the LM335 in that its output varies by 10 mv/degree, and it is measured with the ADC0831 and the BASIC Stamp in the Industrial Control text.·
    ·
    The differences are in the pin map and the fact that it's calibrated for degrees Kelvin instead of Fahrenheit.· It also has a different pin map, so you'll need to check the datasheet for which pin goes to Vss, Vdd, and Vout/adj.·
  • edited 2005-02-14 02:31
    Whoops, just noticed you said 0804, not 0831!

    Go to www.national.com and get the datasheet for the ADC0804. Build the circuit shown on page 24, but instead of LEDs, connect the ADC0804's DB0...DB7 to the BASIC Stamp's P0...P7. Also, get rid of the momentary switch and connect P8 to the /WR/INTR node. Then, you can use a test program like this to display the ADC values:


    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    measurement VAR Byte
    
    ' Kickstart converter
    
    HIGH 8
    LOW 8
    HIGH 8
    INPUT 8
    
    ' Main routine
    
    DO
    
      measurement = INL
      DEBUG HOME, "Binary value: ", BIN8 measurement, CR,
                  "Decimal value: ", DEC3 measurement
      PAUSE 100
    
    LOOP
    




    Post Edited (Andy Lindsay (Parallax)) : 2/14/2005 2:35:19 AM GMT
  • betaboybetaboy Posts: 8
    edited 2005-02-16 04:01
    ·turn.gif thank you very muchturn.gif
Sign In or Register to comment.