Shop OBEX P1 Docs P2 Docs Learn Events
ADC problem — Parallax Forums

ADC problem

ArchiverArchiver Posts: 46,084
edited 2004-03-27 01:19 in General Discussion
Hi: I'm trying to read pressure from a transducer. The digital
value returned from the following code corresponds very closely to
analog input, and it's very linear. But I'm really struggling
trying to convert into PSI. The code below is the only thing I've
found that works without giving totally erratic values, but the
values are simply the digital value of the binary...not the actual
pressure. The 0-100 psi transducer is 5 volt, and has a 0.5 volt
null value. I'm using an ADC0831 and have set up pin 5 on it with a
10K pot which is set to 2.9 volts (full scale at the max pressure of
about 70 psi).

anyone? thanks


'{$STAMP BS2}

x VAR Byte
y VAR Byte

here:

LOW 0
PULSOUT 1,1
x=0
FOR y= 1 TO 8
PULSOUT 1,1
x=x*2
x=x+(IN2+44)
NEXT
HIGH 0
DEBUG ? x
PAUSE 500

GOTO here
Sign In or Register to comment.