Shop OBEX P1 Docs P2 Docs Learn Events
LTC1298 connected to Basic Stamp 2 and question about the AD0831 and AD592 — Parallax Forums

LTC1298 connected to Basic Stamp 2 and question about the AD0831 and AD592

pimp200277pimp200277 Posts: 22
edited 2007-06-05 23:18 in BASIC Stamp
Hi,
··· Is there some kind of special way to wire the LTC1298 ADC converter to the basic stamp 2 in order to get adc to read correctly? I have been trying for 4 months to get this converter to work and I have had no luck.· I had a LM35DZ temperature sensor connected to the ADC then to the basic stamp 2. I figured all I needed to do for the ADC was apply 5volts,ground and the input from the sensor to 1 of the 2 channels on the ADC but I still get an incorrect reading. Anyway's I have had enough with this analog to digital converter.

So I am thinking of buying the ADC0831 and AD592 temperature sensor from parallax.
Is the Analog to Digital Converter 0831 easier to use with basic stamp 2?

Comments

  • ghost13ghost13 Posts: 133
    edited 2007-06-04 01:22
  • pimp200277pimp200277 Posts: 22
    edited 2007-06-04 02:50
    Thanks for the reply but I have Already looked at that AppNote.
  • pimp200277pimp200277 Posts: 22
    edited 2007-06-04 02:55
    Trying something new now. Right now I go this:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    ' Pin Assignments
    CS CON 9 ' Chip Select
    DIO_10 CON 10 ' Data I/O pin 10
    CLK CON 11 ' Clock

    ' LTC1298 configuration
    config CON %1011 ' Configuration bits for ADC.

    AD VAR Word ' Variable to hold 12-bit AD result.
    pH VAR Byte ' pH value of the water

    HIGH CS ' Deactivate ADC to begin.
    HIGH DIO_10 ' Set data pin for first start bit.

    again:
    GOSUB convert ' Get data from ADC.
    DEBUG "A/D Reading: ",DEC AD,CR
    PAUSE 500 ' Wait a half second.
    GOTO again ' Endless loop.

    This basically just keeps reading the 12-bit binary number and displays it on the screen.
    So what I want to do now is convert the Binary number that the ADC puts out into Voltage.
    Then take that voltage and divide it by 0.25. Any Ideas?
  • pimp200277pimp200277 Posts: 22
    edited 2007-06-04 21:50
    I think my problem is the ADC LTC1298 it reads voltages between 0 to 5volts and my temperature sensor outputs voltage in millivolts.

    Is there an analog to digital converter that reads millivolts?
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-06-05 12:47
    5 volts is 5000 millivolts [noparse]:)[/noparse]· The ADC divides the input into· many small measurements. How many depends on how many "bits" the ADC is.··8 bit gives you 256 divisions, 10 bit gives 1024, 12 bit gives 4096, etc.· I have an example of an ADC0831 and an LM34. It reads from 60 to 188F, with the 8 bit ADC0831 this is 256 divisions, so I get 1/2 degree resolution. You often have to scale your input electronically to fit the range of you ADC. Maybe using a resistor divider or an op amp.· What exactly is the range of temperatures you·want to measure?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick
  • pimp200277pimp200277 Posts: 22
    edited 2007-06-05 14:13
    I want to measure the temperature: -55° to +150°C
  • bennettdanbennettdan Posts: 614
    edited 2007-06-05 14:53
    The LTC1298 has a 1.22 millivolt resolution what does yoursensor output?
  • pimp200277pimp200277 Posts: 22
    edited 2007-06-05 15:59
    The sensor output voltage is from·+6.0v to -1.0volts
    with a Linear +10.0 mV/°C Scale Factor
    I am using a LM35DZ sensor: http://www.national.com/ds/LM/LM35.pdf

    Post Edited (pimp200277) : 6/5/2007 4:11:39 PM GMT
  • RDL2004RDL2004 Posts: 2,554
    edited 2007-06-05 20:17
    The LTC1298 uses its power supply as the voltage reference, so you're locked in to·a 0-5 volts input range, divided into 4096 counts (1.22 mV per as benettdan pointed out). You'd have to scale your sensor’s output to fit.
    ·
    I think there’s a sensor version in·NSC's LM series that does degrees kelvin which might be a bit easier to use.
    ·
    On the other hand, do you really need the entire -55C to +155C range?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Rick
  • pimp200277pimp200277 Posts: 22
    edited 2007-06-05 21:56
    No, I won't need the Entire range. I am using the sensor to measure the temperature in a fish tank which I am using to represent a pool for my senior design project which is an Automated Pool Cleaning system.

    Ok, I will just take a op-amp and build an amplifier circuit and input the sensor output in·Millivots·into the circuit to get from Miilivolts to a Volts output then input the volts into the LTC1298.

    Post Edited (pimp200277) : 6/5/2007 10:03:27 PM GMT
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-06-05 23:18
    Mr . P,

    For a fish tank you will use a small segment of the range, but there is no need for an amplifier. Just put the output from the LM35DZ right into an LTC1298 input. Then use a formula the same as the one I gave you for pH, to convert the raw count into degrees Celsius, with a resolution of 0.1 degree:

    degC = 8000 ** AD  ' convert raw AD to Celsius * 10
    DEBUG "Celsius = ",DEC degC/10, ".", degC1
    



    The resolution of the converter is 1.2207 mV, which translates to about 0.1 degree Celsius. That is good enough even for salt water tropical fish. The LM35DZ will need to be calibrated against a more accurate thermometer, if you really need accuracy.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.