Shop OBEX P1 Docs P2 Docs Learn Events
AD595 problems — Parallax Forums

AD595 problems

bhaanbhaan Posts: 37
edited 2005-08-07 18:23 in BASIC Stamp
Can anyone tell me what I am doing wrong?

I am trying to read thermocouples with an AD595 thermocouple interface, then using the LTC1298 to convert the signal to digital data for the BS2.· The problem is that I am not getting consistent readings and sometimes the readings seem to be off.· I have spent some time looking thru old forums and other parallax data and have not been able to figure out why I can't get good readings.· I know that I probably did something wrong but I can't figure out what it is, does anyone have any ideas/suggestions?·

The code I used to read the LTC1298 is pasted below, I got the code from a parallax article I found.· The ADC can read 2 channels and I only need one, so I have just been ignoring the second reading.· The pdf attachment is my schematics, and the second is just a picture of the end of my thermocouple the way I understand to make them.· I should also mention that the circuit is wired up·on a breadboard (for testing purposes), if that matters.
Thanks,
Brian



'{$STAMP BS2}
'{$PBASIC 2.5}
·
·
CS············ CON······ 0
DIO_n·······CON······ 2
CLK··········CON······ 1
·config······· VAR······ Nib
AD··········· VAR······ Word
StartB······· VAR······ config.BIT0
sgIDif········ VAR······ config.BIT1
oddSign······VAR······ config.BIT2
msbf·········· VAR······ config.BIT3
·
HIGH CS
HIGH DIO_n
·
again:
· FOR oddSign = 0 TO 1
··· GOSUB convert
··· DEBUG "channel ", DEC oddSign,": ", DEC AD, CR
··· PAUSE 2000
· NEXT
· GOTO again
·
convert:
· config = config | %1011
· LOW CS
· SHIFTOUT DIO_n, clk, LSBFIRST, [noparse][[/noparse]config\4]
· SHIFTIN DIO_n, clk, MSBPOST, [noparse][[/noparse]AD\12]
· HIGH CS
RETURN

Post Edited (bhaan) : 7/20/2005 6:21:41 PM GMT
320 x 240 - 9K

Comments

  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-07-20 20:38
    In order to troubleshoot, split the problem down the middle. Can you put a known voltage, from a potentiometer or battery, say, directly into the LTC1298? And on the sensor side, measure the voltage output from the AD595 with a multimeter?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bhaanbhaan Posts: 37
    edited 2005-07-20 21:18
    That is what makes me think I have something wired wrong or the program is wrong.· I did recheck the ADC when I put a known voltage to it, and I did read the AD595 voltage with a multimeter.· Here's the results....

    I.
    With 1.88Vdc applied to a single channel of the ADC, the reading my computer received was:
    channel 0:· 1634
    channel 1:· 1580
    channel 0:· 1605
    channel 1:· 1576
    channel 0:··1603
    channel 1:· 1578
    channel 0:· 1655
    channel 1:· 1583......
    This really confuses me because I only applied the 1.88Vdc to one channel and both channels had a reading.· A zero reading would occasionally be shown too.

    II.
    when I put multimeter on the AD595, it consistently read about 4.7mV.· This confuses me too because the output should be 10mV/degree and this was measured at about 76 degF(24 degC).
  • bhaanbhaan Posts: 37
    edited 2005-07-21 13:17
    I moved everything to a different breadboard and things seem to be a little more consistent.· The only difference that I can tell after I moved them was that where they were I had 2 1000microF capacitors near them, would that·effect them (noise)?· I still seem to have a problem using longer thermocouples, and it makes a difference if I measure them stretched out or coiled up.· I don't know if I have a bad connection or what, but it seems to change when I put my hand over the insulated part of the thermocouple·too.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-07-21 15:17
    The LTC1298 uses the power supplyy as its reference, so 5 volts is divided into 4096 steps of 1.2207 volts. When you see a reading of 1580 steps, that means the input voltage is,
    V = 1580 * 1.2207 = 1.929

    On the Stamp, you do that with the */ operator

    milllivolts = AD */ 3125
    DEBUG DEC millivolts/10, ".", DEC1 millivolts

    The reason both channels follow along is that the input impedance is very, very high and their is a small amount of coupling between the channels.

    The results are suspect. I'm not sure where to start. The AD reading with a 1.88 volt input should be about 1540 steps, but you were seeing higher than that on both channels. Which channel had the real input? Also, you are right, the output from the AD595 should be 10mV per degree. Was it grounded properly to your meter?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bhaanbhaan Posts: 37
    edited 2005-07-22 00:36
    It seems to be working now.· I think my problem was that I had two power sources because I was using two breadboards and I failed to connect the grounds, so I connected the grounds and it seemed to help.· The stamp was on one power source and the AD595 and LTC1298 were on another.

    Now, another problem, I am trying to measure multiple thermocouples off of one AD595, so I have an ADG507 analog multiplexor.· I would like the thermocouples to connect to a terminal strip and then to the ADG507.· Can I use copper wire to connect from the terminal strip to the ADG507?· It is my understanding that you can do this if the connection points are at the same temperature, is that right?
  • Lgrant1350Lgrant1350 Posts: 7
    edited 2005-07-22 03:26
    Hi guys,
    I'm just learning so sorry if I'm way out of line but aren't the ends of the thermocouple supposed to be melted together ? It doesn't look like they are in the photo.
    Larry
  • bhaanbhaan Posts: 37
    edited 2005-07-25 13:57
    I think your right Larry, but I have been told to do it both ways before, so I'm no expert.· I think melting the ends together is ideal, but I do have an old thermocouple unit that reads thermocouples and I always read them with that first just to make sure they will work and I haven't had much trouble with twisted ones.

    Post Edited (bhaan) : 7/25/2005 9:52:55 PM GMT
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-07-26 07:42
    [noparse][[/noparse]quote] Can I use copper wire to connect from the terminal strip to the ADG507? It is my understanding that you can do this if the connection points are at the same temperature, is that right?

    That is correct, but remember that even small temperature differences can have what may be an unexpected large effect. For example, if the terminals are on the outside of a box and there is a lamp or a body nearby, or a breeze, or a microprocessor heating up the inside of the box, you can easily add up a a couple of degrees of error. Arrange the system to keep everything at the same temperature (isothermal).

    If you don't have it already, add a resistor of ~10 kohms or 1kohm to common (ADG507 common) on each leg of each thermocouple, where it attachs to the terminal at the input to the ADG507. That can reduce noise problems. When the ADG507 selects one thermocouple, the others that are not selected are still there and act as antennas to pick up AC hum and noise, which can be quite large and even overcome the common mode voltage of the mux chip. The resistors reduce the extraneous noise substantially. Shielding the thermocouples can also help. Also noise problems are much less if you can insulate the thermocouple tip from the body being measured, as direct contact means a bigger antenna.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bhaanbhaan Posts: 37
    edited 2005-07-26 16:17
    I guess I am back to testing my AD595 without wiring the ADG507 in yet because I am·not quite convinced that I am getting good readings from my AD595.· I am using my multimeter to measure the output.· Sometimes I think that I get·decent readings (on the cold side), but I feel like my readings change even if I physically sit a little farther from the chip or move my arm away from it.· I mentioned noise earlier as a problem, but I don't really have it near any AC lines, my computer is the closest thing and even it is probably 3 feet away.· I mentioned that I am doing my testing on a breadboard,·my breadboard has 2 grounding strips on the sides of it, and my readings seem to change even if I switch which side I ground it to.··Even if I use 5Vdc versus 15Vdc to measure room temp I seem to get different readings.· Also, I am assuming that in the schematic(see attachment) that the data sheet shows, the common is ground?· I have connected pin 13 to ground, and I connected pin 1 to pin 4 and then to ground.·
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-07-27 01:31
    I'd say, dump the breadboard (white block?). Instead, build it up the inside a small box, with dead bug wiring, with the chip upside down in good contact with a metal plate. Keep the wiring inside the box short and connected directly to the pins of the chip. It is an expensive chip, so you can plug it into a 14 pin IC socket and do the wiring dead bug style to the socket. In particular, bring the thermocouple leads directly to the pins 1 and 14. Use a bypass capacitor across the power supply, pin 11 to pin 4. Connect a resistor of 10k from one side of the thermocouple to common, to fix the common mode voltage. On the schematic, that is shown as a dotted line from the pin 1 side to common.

    It 's really important to keep this in a box at a uniform temperature. Don't load the output (either signal or alarm), because any power dissipation can create a temperature gradient that affects the result.

    http://www.emesys.com/OL2therm.htm <--- thermocouple app note

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bhaanbhaan Posts: 37
    edited 2005-07-27 20:31
    I tried wiring it up dead bug style in a box with the back of the AD595 against a metal plate along the bottom of the box·and I seem to have the same problems.· Also, whenever I put a capacitor from pin 11 to pin 4 it brings my reading to zero.· I am really confused as to why my readings seem to change whenever I move my arm near it or sit close to it.· I have tried putting aluminum foil around different places to see if it will help by blocking noise, but I don't notice any difference.··I have tried connecting pin 14 to pin 1 in place of a thermocouple and I still get the same problems.· I think I will buy a new AD595 and test it to see if I somehow damaged the current AD595 that I am using.·

    First maybe I should explain what I am trying to do and maybe you will know of a better way to do it.· I am trying to read a total of 24 thermocouples with one of·the BS2 modules, 4 of the thermocouples should be able to read up to 2000 degF, and the other 20 only need to be able to read up to around 500 degF.· I was planning to do this by using AD595's and an ADG507 multiplexor.· I would be willing to buy something that is already on the market, but I have had trouble finding anything to interface to a BS2 and go up to 2000 degF.

    I don't have much electronics experience, so the help I am receiving is much appreciated.
  • bhaanbhaan Posts: 37
    edited 2005-07-28 14:14
    One thing I just·tried and it seemed to work is when I have pin 14 connected to pin 1 (measuring the chips temp), and then I put a capacitor from pin 10 to pin 11.· This seemed to work and not be affected by me moving my hand near it and stuff and give the right reading even, but it doesn't seem to work when I put a thermocouple in.
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-07-28 14:56
    It sounds like there might be an oscillation on the output (instability). If you have a 'scope, or with a multimeter set on AC, look for oscillations. Is there any capacitance or cable attached to the output? Is the power supply clean? The data sheet also suggests 100 pF from pin 9 to pin 10 for overcompensation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bhaanbhaan Posts: 37
    edited 2005-07-29 23:55
    I don't have a scope so I put my meter on the Vac setting.· It would read in the range of·about 15mV, but if I moved my arm by it it would jump up into the 20's and then back down to the 14 - 17 mV range.· The output just has a jumper wire from pin 9 to pin 8, then I take a jumper wire from pin 8 to my multimeter.· When I put a 100 pF capacitor between 8 and 9 I don't seem to notice much difference.· I am unfamiliar with what you mean by a "clean" power supply.· The AD595 is the only thing I have on the circuit right now, I have tried using a 7805 voltage regulator.· I have a Basic Stamp Homework board, and so I tried it using the homework boards power supply/ground and I didn't seem to notice·any change.· I did get another AD595 and I don't seem to notice any difference in their performance.· I forgot about this, but I do have a wireless keyboard and mouse, maybe I'll do my testing in a different place tomorrow.· I can't figure out what I am overlooking, this chip looks so simple to use.
  • bhaanbhaan Posts: 37
    edited 2005-07-31 16:59
    I did take my circuit to a different location and it worked great!· It read accurately and consistently.· I don't think it was my wireless keyboard because it seemed to not work no matter where I went in this building, but when I took it and tested it at home, it worked just fine.· I don't know what the problem was/is, but the building I am in is located near some sort of tower(radio or cellphone·maybe).· I do know that my keyless entry on my car does not have very much range here, so·maybe I am just in a bad location.· It worked wired up the same way I had it from day one.
  • bhaanbhaan Posts: 37
    edited 2005-08-02 19:36
    If I use a multiplexor(ADG507) with my AD595 and my LTC1298, is there a time period that I have to pause after switching the multiplexor so that my AD595 and LTC1298 can get a good reading?·
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-08-03 04:46
    There shouldn't be need for much of a delay at the speed that the Stamp and ADC work. No more than a few milliseconds. You will need to look at the results though, as the Stamp kicks out a series of measurements on one channel, you can see if there is a trend.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bhaanbhaan Posts: 37
    edited 2005-08-04 15:57
    I have collected data from 8 thermocouples and one potentiometer.· 7 of the thermocouples were at room temp, and one was in a refrigerator(~6 degC), and the potentiometer was set on a constant setting and it connected to the second channel of the ADC.· The program would select channel 1 on the multiplexor, pause 100 ms, read data, select channel 2, pause 100 ms, read data.....

    The reason I put one thermocouple in the fridge was just to give at least some variance to the temps, and I used a pot because the graphs of the thermocouple readings seemed to all·spike at the same time and I wanted to see if the pot would too.· I am wondering why my data looks like this, there is some event going on that is causing my data to almost offset, but the pot is unaffected for some reason.· One conecern I have is my Voltage Reference for my LTC1298, all I had was a 7805 regulator and a capacitor,·but I plan on using an LM336 when I am convinced things will work.·

    The first chart is of all the channels and their mV reading, the second chart is of all the channels individually and it's pretty easy to see a major trend.· Another thing to note is that the pot and the first channel seemed to be the best, the spikes or the offset seemed to get worse in order of the channel being selected (1 had the smallest spike, and 8 had the biggest spike typically).· The second graph shows this, the pot is the bottom line, then channel one, then channel two(yellow) all the way up to 8.

    I know there is a major trend here, but what is causing this?· Is it as simple as my reference voltage?· I'll attach a schematic later this afternoon.

    Post Edited (bhaan) : 8/4/2005 8:02:31 PM GMT
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-08-05 06:39
    The reference voltage is fine, I think. The potentiometer is attached directly to one input channel and does not exhibit unsteady readings. The thermocouples/multiplexer/AD595 are attached to the other input. Remember that those channels have a high gain amplifier inside the AD595, so those channels are much more subject to noise pickup. It looks to me like the kind of effect that comes from aliasing. That is, the sensitive input is picking up 60 hertz from the power lines and amplifying it along with the signal. Your pbasic program is reading values at regular intervals that have a "beat" frequency with the noise, and that is what you see as fluctuations in your readings.

    The layout of the circuit and the shielding are all important. The power supply has to be well filtered with no ground loops under the signal path. One thing I notice is a _12_ volt input supply (wall wort?) and a _15_ volt regulator.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bhaanbhaan Posts: 37
    edited 2005-08-05 15:22
    The power supply, is an "SR Components" "AC adaptor·Class 2 transformer".· I do have a 15 volt regulator coming off of it, but it is a class 2 power source·and·actually measures at around 17 VDC.· I don't know exactly what you mean by a "well filtered" power supply with "no ground loops."· I have a·1000 microF·capacitor where the power supply comes in before the regulators. ·Do you have any recommendations on what power supply I should use or how I should set it up? ·I only bought this one because it was convenient and cheap(probably a mistake), I am willing to get something else though.·


    Here is the same test, with 7 thermocouples at room temp,·1 in the fridge, only there's no pot in this one.· All I changed was I added a 10k Ohm resistor from pin 14 to ground, there was one already from pin 1 to ground.· The data looks pretty good but still has small consistent·spikes.


    One more question, what is the best way to read up to 2000 degF?· Should I use a pot as a voltage divider·before my LTC1298?· I saw on an eme systems article (http://www.emesystems.com/OL2therm.htm) that you can put a resistor between pin 5 and 9.· Do you loose alot of accuracy by putting a resistor between 5 and 9?· Wouldn't it be better to have the AD595 on a 15 volt supply and scale its output with a pot?

    Post Edited (bhaan) : 8/5/2005 9:46:20 PM GMT
  • DaveGDaveG Posts: 84
    edited 2005-08-05 15:50
    Brian,

    You might try the following things to help reduce noise.
    LTC1298:
    1. Add a .1mfd from the CH1 input(potentiometer) to ground.
    2. Try grounding CH1 and see if CH0 cleans up.
    2. Add a 1 mfd tantalum capacitor from V+ to ground. The spec sheet mentions this.

    AD595:
    1. Add a .1mfd bypass capacitior from V+ to ground.

    Dave
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-08-06 17:17
    The 10kohm resistor from 14 to ground to match the one from pin 1 to ground is a good idea, because it equalizes the load on the two sides of the differential input.

    By ground loop, I mean something like the following. Suppose you connect the resistor from pin 1 to ground point A, and the resistor from pin 14 to ground point B that is located two inches away on the prototyping board. Now suppose there are currents flowing in the circuit, to power the Stamp and all the other stuff. Due to those currents, which fluctuate with time, the voltage at ground point A is not exactly the same as the voltage at ground point B. A might be a couple of millivolts different. Not much, but that is a huge difference when it appears at the input of the AD595 amplifier. Therefore, it is important that those two resistors be connected to the same ground point, with no "ground loop" between them.

    Also, suppose that one of the resistors is connected to the ground point directly, with very short leads, while the second one is connected via a loop of wire that runs parallel to the power line for the BASIC Stamp or near the wall wort power supply. That lead will pick up voltages from the CPU power line or from the AC power line or from a nearby radio tower. The first resistor does not pick up those signals, so the difference appears as a signal in your AD595 amplifier, and then as noise in your thermocouple readings. Those two resistors need to be wired with care and concern for ground loops and noise pickup. Also be careful with the ground connections for the multiplexer and the AD595. Analyze your whole circuit layout with concern for those issues! Bypass capacitors are a part of this issue. Be sure there are good bypass capacitors right near the digital circuitry and the power supply. You don't want the power currents to have to come back all the way across the circuit board to pass through bypass capacitors near the analog circuitry! That situation can lead to bad behavior! Allways know where your currents are hanging out!

    As it stands, you have all the thermocouples attached to the inputs of the AD607 multiplexer, operating on a power supply of 0 and 15 volts. (I am not familiar with that mux, but I think you could also operate it off of a lower supply voltage, or off of a split supply.) The input common mode voltage is zero volts. When a thermocouple is selected, it is connected through to the AD595 input, where the 2 10kohm resistors enforce a common mode voltage of zero. That leaves 7 thermocouples unselected and floating with respect to ground. I don't know if the following is happening in your system, but it _can_ happen when the thermocouples are long or when they are attached to large conductive bodies. They act as antennas and pick voltage from the AC lines, and especially insidious signals from nearby radio towers and switching power supplies. Those signals are large enough to be detected by the substrate diodes on the mux chip, and all bets on the interchannel isolation are off. The AC signals feed through into the selected channel. There are things you can do to lessen that effect. One is to put 10kohm resistors and 0.1uf X7R bypass capacitors to ground on both sides of each and every thermocouple at the input side of the mux. The pickup is usually a common mode signal, but putting bypass on both sides prevents it from becoming differential. Another help is to use split supplies for the mux, or some other scheme to move the common mode voltage away from the mux Vss supply. That makes the bad signals less likely to turn on the substrate diodes, as the signal has to reach a higher level to do so.

    As to the measurement at 2000 degrees F (1093 degC). The resistor from pin 5 to pin 9 is a good solution, well within the accuracy of thermocouples. The resistor simply reduces the gain of the amplifier below the nominal 10 millivolts per degree Celsius. You might want to make it 4 millivolts per degree Celsius. When looking at a large temperature range, you may need to take into account a linearity correction.

    Have you also considered using the Maxim direct to digital thermocouple chips? (MAX6675). That woud avoid a lot of your analog design problems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • bhaanbhaan Posts: 37
    edited 2005-08-07 18:23
    I followed your advice on ground looping and it helped a ton.· The multiplexor I am currently·using is the ADG507, not ad607.· I think I will switch to one that operates on 5 volts though.· Now my thermocouples vary by less than a half a degree.· I will have some long lengths(20 to 30 feet)·of thermocouples and so what you say about them picking up noise scares me a little.

    The first thing I did when I started this project was get some MAX6675's because I read your article and they were very easy to use(especially after reading your article).· One thing I found out later though was that I had to read up to 2000 degF(1093 degC), and I beleive the MAX6675 can only read up to 1875 degF(1024 degC).··Is there any way to read up to 2000 degF with the MAX6675?· Since I have to read 24 thermocouples do·they each need their own bypass capacitor?· I would rather use the MAX6675's in order to cut out all the analog worries I have.

    Your adivce is very helpful and much appreciated.

    Post Edited (bhaan) : 8/9/2005 1:10:16 PM GMT
Sign In or Register to comment.