Shop OBEX P1 Docs P2 Docs Learn Events
Floating readings on ADC0838 — Parallax Forums

Floating readings on ADC0838

Sutton MurraySutton Murray Posts: 88
edited 2006-10-17 20:53 in BASIC Stamp
Hi

I have my ADC0838 set up to read LM34 sensors and Theristors. On the debug screen every 2 seconds it will give me the list of taken reading from ch0 to ch7. With one·LM34 connected to ch0 and a theristor connected to·ch2 (thermistor connections as to·Tracy recomendation-circuit attached), with the DEC command used,·i started logging·reading·as follows.
cho0-79 measing 0.77 volts
ch2-08 measing·2.59 volts

With theristor in the kitchen oven at 200 degree celsius
ch2 got to 247, 4.95volts

Removing the theristor from the oven and still playing around

The channels readings started getting jumpy
ch0 80
ch1 0
ch2 103
ch3 0
ch4 128
ch5 0
ch6 64
ch7 128
This with only 2 sensors still connected


Even after removing all sensors and removing the power, also removed the ADC0838 from its socket
Values changed to
ch0 32
ch1 0
ch2 0
ch3 0
ch4 64
ch5 0
ch6 32
ch7 64

I have changed out the ADC0838 with 2 other spares IC i have. At times the readings returned to what it should look like, after i while it will again starts to get·jumpy. I can't seems to stop it from jumping for at leased a few hours. When it is working correctly i still don't know what i have done or why it is working as it should.

Why am i getting these results? I have tried·changing·the wiring on the pc boards power connections to the IC, i still had no luck.·I have attached the latest wiring connection(note in this way connected it sometimes works other·times jumping).·I have several other components on the one pc board, not shown on the·attached given circuit.

Please can someone help me?

Comments

  • Sutton MurraySutton Murray Posts: 88
    edited 2006-10-11 16:17
    Any help someone
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-11 16:28
    One thing I'm not seeing on your diagrams is 0.1uF bypass capacitors on the power supply leads near each of the ICs. I don't know if this is the cause of your problems, but it's good design practice. Sometimes there's enough switching noise on the power supply lines to cause problems with false switching on complex devices like A/D converters, microprocessors, etc. I would check your connections too. Sometimes they loosen when you start to move things around. You might also post the code you're using to read the ADC. Without the ADC in it's socket, the displayed readings are meaningless. I don't know what your program is doing, but it obviously would be garbage without the ADC.
  • Sutton MurraySutton Murray Posts: 88
    edited 2006-10-11 16:49
    The code is attached.·I use this copied version of code to do the testing on the ADC. All items are soldered to a pc-board. I have gone over and over the pc board for faults or things like possible loose connections. I will be trying the 0.1uF caps to see if this solves the problem
  • metron9metron9 Posts: 1,100
    edited 2006-10-11 18:16
    For a test, Connect a 1.5V battery to all the input pins of the ADC , run the program and see if the input changes

    Then flip the 1.5V on and off to see if you get correct readings

    Could you have capacitance holding the readings high or if you have a scope, is there excessive noise?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
  • Sutton MurraySutton Murray Posts: 88
    edited 2006-10-11 18:55
    Mike the 0.1uF cap did not solve the probleme

    Metron9, i have connected the 1.5v battery to all channels all starting showning 128 on the debug screen. Switching each channel on and off works falling back between 0 and 128. But channels 4 to 6 did not fall back to 0 but between only to 2 to 8. channel 7 after a longer waiting period came back to 0.

    I got my self a parallax scope now recently. But how to test for the excessive noise, i hope you can guide me through this.
  • metron9metron9 Posts: 1,100
    edited 2006-10-11 20:04
    From what I read you are using 8 channels, the ADC0838 sends a string of 8 bytes to represent the values read on the 8 input pins

    EDIT>>>> Oops read the datasheet i see its microwire, I thought it read all 8 and then would send all 8 values at one time.

    You do not have a problem on any of the pins with the exception of 4, 5 and 6.

    Do a node check on all 8 input pins , Select a ground node, use the 1.5V static voltage on the inputs, program the chip to take one reading and hold, now check the voltages on each node. Also measure with no power on the circuit those same nodes from a common ground node. There has to be a difference in those pins or the serial communication between the chip and the stamp is not working correctly with a scope you can also check the timing of that aspect as well.

    Basically finding noise is the voltage you see on the plot wil have a frequency of alternating voltage around the voltage you are measuring. Say you have a 5V signal and you see a fuzzy line bouncing between 5.2 and 4.8 volts you could have a large ground bounce. Make sure the battery is connected to the common ground when you test as well.

    You must solve the pin 4,5 and 6 input problem with the static voltage before you can move on. Check your powersupply to the ADC chip as well for noise, (min and max voltage spikes)

    I was looking at the datasheet again, I don't know if it matters but try switching your calculation of INITBITS to before you activate the chip so you can follow it with the address.


    InitBits = %11000 | ((Channel & %001) << 2) | ((Channel & %110) >> 1)
    LOW CS ' Activate the ADC0838
    SHIFTOUT ADCIn,CLK,MSBFIRST,[noparse][[/noparse]InitBits\8]
    SHIFTIN ADCOut,CLK,MSBPOST,[noparse][[/noparse]ADCRes\9]

    ' not sure what the delay between the last shift out bit and the start of reading but it must be more than 32us perhaps a delay of one statement before reading the output would insure adc is finished processing.

    I am doing alot of guessing and throwing stuff on the wall just for ideas to jar the noggin into solving the problem.
    many ideas may be way off base but may also cause one to think of another reason, when in doubt put everything on the table I say.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!

    Post Edited (metron9) : 10/11/2006 9:24:22 PM GMT
  • Sutton MurraySutton Murray Posts: 88
    edited 2006-10-11 22:14
    You for sure gave me a list of things to try, thanks. I will be trying out your points. You mentioned the power supply to the ADC. All components needing 5v on the board is driver from a 7805 regulator even the stamp it self. Does this matter or should this rather be power by say a LM2940-5volt? Thanks again for your input, i will give my results after going through all the points.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-12 04:53
    1) As long as you've got a stable power supply with appropriate bypass capacitors (the 0.1uF ones), that should work fine.

    2) The only anomaly in the program is that it's not clear whether you've connected the proper pins of the ADC0838 to the Stamp in the way your program expects. The comments (from the original) mention pins 0 through 3. You've got pins 8 through 11 and in a different order. There's no specific requirement for which pins are connected to what as long as CS on the ADC0838 is connected to the pin that the program expects and similarly for CLK, DI/ADCIn, and DO/ADCOut. I believe SE on the ADC0838 needs to be connected to +5V and that's not clear from your diagram.
  • Sutton MurraySutton Murray Posts: 88
    edited 2006-10-17 08:53
    Mike

    As seen in my program the pins is not connected as in the the comments of the program. I have changed it as the made up board ended up using pins as used in my program. As far as i thought it was needed and as seen in my program i have changed the out and dirs commands to OUTD and DIRD . The voltages regulators have 0.1uF caps in my circuit. I have started over, made a complete new board with slight changed fitting the LM2940 in place of the LM7805 also another 0.1uF on the ADC. The 0.1uF i did try on my previous old board without any better results.

    Now all channels is working fine. I thought that the reasons are due to the changes From the LM7805 to the LM2940. But out of what you have said this should not have the effect. I have not even tried the points mentioned by Metron9. So why is it working now?

    Another question The circuit draws 0.04A, is this enough to let the LM7805 or as later fitted the LM2940 get very hot. I have no heatsink on this, as i thought that this is low current and a heat sink is not required. The LM gets so hot that you can't keep your fingers on it, is this normal? (Supply voltage is 16v at this stage). But will be used on 24v batterys.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-17 14:53
    Hello,
    ·
    ·· The Voltage Regulator will get hot with almost no current draw at those high voltages (16V).· Once you go to 24V it will only get hotter.· The regulator has to dissipate the overhead as heat to regulate down to 5V.· A heat sink is recommended at those extremes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • metron9metron9 Posts: 1,100
    edited 2006-10-17 19:49
    You might want to think about a switching supply like

    LM5009 - 150 mA, 100V Step-Down Switching Regulator

    Here is a link to designing power supplys

    http://www.national.com/appinfo/webench/power/SS/SS.cgi?flow=power&step=1A

    Typically you don't want to drop more voltage than the output on a linear regulator.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
  • Sutton MurraySutton Murray Posts: 88
    edited 2006-10-17 20:53
    Thanks all.

    Metron9, i like the link thanks. I will be working on this again
Sign In or Register to comment.