Pages: [1]   Go Down
Author Topic: Thermocouples, MAX31855 ADC and Uno Problems  (Read 3207 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have multiple thermocouples (TCs) going to MAX31855 ADCs (1 per TC), which all connect to a common SO bus going to an Uno.  The schematic is attached.  The setup works fine for a single TC, but all output readings go to zero when hooked up in series.  There is a common voltage bus (5V from Uno --> 3.3V using resistors), GND bus, clock (CLK) and serial output (SO) bus.  The chip select (CS) pins all go to separate pins on the Uno. 

At first I thought I was experiencing a loading problem, but after testing I found I was not.  If I have one TC/ADC running and 2nd TC/ADC hooked up except for the clock line, the 1st TC reads fine, but as soon as I attach the 2nd CLK pin the outputs both go to zero.  I essentially followed the same setup as shown in my second attachment (TC_Quad_Interface...).  I've tried using a Schmitt trigger, but that failed.  Any other ideas or advice would be much appreciated!

Austin

* MAX31855_9_final2.brd (329.49 KB - downloaded 50 times.)
* TC_Quad_Interface_V13.brd (43.26 KB - downloaded 36 times.)
Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I can't read eagle 6 files.

Code?

Are you driving the CSn lines high, except for the one you're reading?  The MAX31855 has an active low CS.

-j
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8653
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like the bypass capacitors are only connected at one end.  The bottom traces are missing completely.  There appears to be text across the top layer saying 1.42. Thera are a pile of un-routed traces.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the replies.  Here is the relevant portion of the code:
...
float getTemp(int ch)  {
   unsigned long value = 0;
   float temp = 0;
   char bita;
   digitalWrite(ch, 0);         //Switch to low (active)
   for (int i = 0; i < 32; i++) //Get 32 bits from the MAX31855 - see datasheet for specifics. 
     { digitalWrite(mClockPin, 1);     //set clock pin low
       bita = digitalRead(mDataPin);
       if (bita==1) value = value | 1; //If bit ==1 set lowest bit in value
       digitalWrite(mClockPin, 0);     //Set clock pin back to high
       if (i != 31) value = value << 1;// If we're not done yet, shift bits left by 1 to make room for next loop
     }
   digitalWrite(ch, 1);
   value = value >> 18; //shift out all but tc temp data and sign bit
   temp = (((value * 0.25) * 9) / 5) + 32; //Convert to Degrees F
   return temp;
}

The code utilizes a continuous loop that calls 'getTemp' for each of the thermocouple channels (1-9 in this case).  When getTemp(CH1) is called, for example, the CS line is set to low (active) and the data pin (SO) is read.  32 bits are pulled from the data bus before the temperature is returned, and the loop moves on to executing getTemp for the next channel (CH2).

As you can see, data should only be coming from one MAX31855 at a time, but when analyzing the circuit I was seeing signals from, say, CH2 when executing getTemp(CH1)!  This was why I tried using a Schmitt trigger, but it did not work.  I may have chosen the incorrect trigger though, so any advice there would be helpful! 

To johnwasser, I'm not sure what you're referring to as un-routed traces, but any trace that ends in a green circle is going to a pin (either to the Uno or the MAX31855).  The caps are open on one end because they are floating caps.  I was told this acts as a frequency filter for the incoming voltage from the Uno.  Is this incorrect?  Thanks for your reply.

Austin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I was referring to decoupling caps
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8653
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry, I was referring to decoupling caps

Decoupling caps connect to both Vcc and Ground.

As you can see, data should only be coming from one MAX31855 at a time, but when analyzing the circuit I was seeing signals from, say, CH2 when executing getTemp(CH1)!

Since all of the data output pins are connected together, how can you tell which chip the data is coming from?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So the data should only be coming from one chip at a time.  I call getTemp(*) for CH1-CH9 in order, and since the Chip Select (CS) pins for each chip come from a separate pin on the Uno, I should be able to call for data from each chip individually.  If I call getTemp(CH1), the CS pin for chip 1 receives a signal, sending temperature data to the SO data bus.  During this loop, any data that comes to the Uno should only be from that chip.  Does that make sense? 

As for the decoupling caps, I initially thought the same thing as you, but I based my design on the other *.brd file in my first post.  I also emailed Ryan Mclaughlin, who has designed breakout boards for the MAX chips, and made sure I wasn't missing a connection to ground.  He said I wasn't.  Do you think he is incorrect?  Thanks.

Austin
Logged

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are confused about decoupling caps.  Any component that only has one terminal connected has no purpose. Look at the datasheet - page 1 shows the correct use of decoupling caps for this device, and it's connected to Vcc and GND (and it should be as close to the device as possible).

Since your code does not work, there are no parts that are not relevant.  Post it all, and post it using the code tags so that it's readable.

-j
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8653
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So the data should only be coming from one chip at a time.  I call getTemp(*) for CH1-CH9 in order, and since the Chip Select (CS) pins for each chip come from a separate pin on the Uno, I should be able to call for data from each chip individually.  If I call getTemp(CH1), the CS pin for chip 1 receives a signal, sending temperature data to the SO data bus.  During this loop, any data that comes to the Uno should only be from that chip.  Does that make sense? 

Yes, it makes sense.  But you asserted that you were getting data from chip 1 and chip 2.  I asked how you knew that this was the case (since all the SO pins are tied together) and you didn't answer.

As for the decoupling caps, I initially thought the same thing as you, but I based my design on the other *.brd file in my first post.  I also emailed Ryan Mclaughlin, who has designed breakout boards for the MAX chips, and made sure I wasn't missing a connection to ground.  He said I wasn't.  Do you think he is incorrect?  Thanks.

I looked at that other board and it shows NO ground connections for anything.  This would prevent the chips, the LEDs and the decoupling caps from working.  I'm guessing the author provided an incomplete design.  He may be assuming a flood fill ground plane on the bottom side of the board but there should be vias to connect the top traces to ground where necessary.

The very first diagram in the datasheet (http://www.adafruit.com/datasheets/MAX31855.pdf) clearly shows a 0.1uF decoupling capacitor connected to Vcc and GND.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Pages: [1]   Go Up
Jump to: