Shop OBEX P1 Docs P2 Docs Learn Events
Need a stable reading — Parallax Forums

Need a stable reading

JBJB Posts: 5
edited 2004-12-09 23:28 in BASIC Stamp
I am using BS2 and ADC0831.
I have attached my code herewith which I got from the manual.

I just want a stable reading coming out of the A/D. I can see a voltage representation as well as 8 bits binary representation of the analog input I am using but my readings seen on debug screen are fluctuating like anything.

I assumed that the reading out of the ADC would display simply the amplitude voltage of the analog input which is what I am looking for.

I need to send the 8 bits binary data to Labview and am displaying a digital value in there.

Any advice please.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2004-12-09 22:32
    I think you need to leave the default state of the 'CS' high -- but I could be wrong.

    Also, doesn't it take some time for the ADC to make its reading? Are you giving it that time?

    And do you have a common ground?
  • NewzedNewzed Posts: 2,503
    edited 2004-12-09 22:38
    JB, add a .1uf bypass right at your ADC input, and put a 1K resistor in series with your temp sensor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    4 digit serial LED

    http://hometown.aol.com/newzed/index.html
    ·
  • achilles03achilles03 Posts: 247
    edited 2004-12-09 23:05
    Yeah, I think Allanlane is right... you need to leave the CS high for a bit. Put a few "pause 5" statements in there (like after high CS and again after low CS). I had another ADC that had problems until I put in a few pause statements.

    Dave
  • JBJB Posts: 5
    edited 2004-12-09 23:07
    I tried putting a .01 microF Cap as well as 1K resistor. That does not help.

    I also tried keeping the CS high and that gives 11111111 and 5V reading.

    The code I attached has been retrieved from the manual so I know it is right.

    I am however not able to get a stable reading for the output coming out of A/D.

    Can someone please help.
  • JBJB Posts: 5
    edited 2004-12-09 23:09
    Tried putting PAUSE 5 after HIGH CS and LOW CS.
    That does not change the fluctuations.
  • JBJB Posts: 5
    edited 2004-12-09 23:28
    Thanks guys. I figured it out.

    I had my Temp Sensor on separate board and my BS2 on separate board. And though both of them were grounded, they didnt have common ground.

    Thanks alot for your help.
Sign In or Register to comment.