Pages: [1] 2   Go Down
Author Topic: MAX31855 problems  (Read 4374 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,
I recently designed a board in Eagle that incorporated the RBBB Arduino clone and Adafruits MAX31855 breakout board together on a single board.
I got the boards back a few days ago and started building. I soldered in all of the power supply components and tested (test ok), then added the rest of the RBBB components and tested (test ok), then added the MAX31855 and the level convertor and other associated components (couple of capacitors, signal diodes, etc).
When I uploaded the adafruit example sketch in order to test (modified to display on a LCD), it all went a bit pear shaped.

The internal temp of the MAX31855 and the thermocouple temp are both showing as 32F at room temp. Applying heat to the thermocouple makes no difference.

I tried resoldering all of my joints in case that was the problem (no dice).

Here is the code I am using
Code:
#include <LiquidCrystal.h>  //this library is modified by Lady Ada to support I2C
#include <Wire.h>
#include "Adafruit_MAX31855.h"

int thermoDO = 17;
int thermoCS = 18;
int thermoCLK = 19;
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);

LiquidCrystal lcd(0); //Default address for I2C LCD

void setup()  {
 
  pinMode(thermoDO, INPUT);
  pinMode(thermoCS, INPUT);
  pinMode(thermoCLK, INPUT);
  lcd.begin(16, 2);
    lcd.setBacklight(HIGH);
    lcd.clear();
}
void loop()  {
  // basic readout test, just print the current temp
  lcd.setCursor(0,0);
   lcd.print("IT= ");
   lcd.setCursor(3,0);
   lcd.print(thermocouple.readInternal());

   double c = thermocouple.readCelsius();
   if (isnan(c)) {
     lcd.setCursor(0,1);
     lcd.println("TC ERR!");
   } else {
     lcd.setCursor(7,0);
     lcd.print("C=");
     lcd.print(c);
   }
   //Serial.print("F = ");
   //Serial.println(thermocouple.readFarenheit());
 
   delay(1000);
}

Also I have attached my schematic.

Any advice would be greatly appreciated.

* PID combined.sch (1368.56 KB - downloaded 53 times.)
Logged

0
Offline Offline
Shannon Member
****
Karma: 216
Posts: 12556
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to call readError() to see the bottom 3 error bits from the chip - these are documented in the datasheet.

Also I couldn't read the schematic file in eagle for some reason - can you post an image so everyone can see it.
Logged

[ I won't respond to messages, use the forum please ]

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for your reply Mark.
I have attached an image of the schematic.

Currently reading up on readError()


* Schematic.JPG (59.9 KB, 787x531 - viewed 280 times.)
Logged

0
Offline Offline
Shannon Member
****
Karma: 216
Posts: 12556
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You've got a diode in the SDL line!  That's meant to be bidirectional.
Logged

[ I won't respond to messages, use the forum please ]

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SDL, I'm confused. Do you mean S0, SCK or CS ?
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried removing both of the diodes between the MAX31855 and the ATmega328, but I am still getting the same results.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 27386
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

These pins are used by the thermocouple library to fake an SPI interface to the MAX31855 apparently:

  pinMode(thermoDO, INPUT);
  pinMode(thermoCS, INPUT);
  pinMode(thermoCLK, INPUT);

comment them out & see what happens.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Still the same I'm afraid  smiley-confuse
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2928
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The diode in the clock line is ok but you will need a bidirectional level shifter in the data line and there is in the lower right of the schematic a transistor with a resistor and LED in the Emitter circuit and they are shorted out... design error of schematic error? that being the case I would compare it carefully with the breadboarded version... You did breadboard this thing and test it before you ordered boards didn't you?. The two schematic/design errors tell me that you didn't and I suspect you will find more. Except for copying reference design PCB artwork I have Never done a PCB W/O testing all of it breadboarded first... There will be enough to deal with by the time you get it working to more than keep you busy without finding and fixing your schematic errors before you can fix your project. Getting back to the 3V3 source and the 5V bus... I noticed what looks a great deal like the 3V3 reg from the Arduino board... Be aware that it will not sink current. If you take a regular R3 uno and tie a 4K7 resistor from 5V to 3V3 the 3V3 source will measure about 4V7... So unless your thermocouple converter has 5V tolerant inputs... build the interface, it takes a mosfet and 1 extra resistor for a bi-directional data bus. Make certain and "For Sure" that there is no electrical connection from the thermocouple and ground, it causes no end of accuracy ans stability issues If you don't... At least that's what we finally figured out...

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 27386
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Does this
#include "Adafruit_MAX31855.h"

need to be
#include <Adafruit_MAX31855.h>

Do you need something like this for the library?
thermocouple.begin(x,y);
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Docedison,
No I did not breadboard it, but I did have a MAX31855 breakout board from Adafruit and a RBBB Arduino clone, plus my own 4 button keyboard and transistor output for a SSR, all working together. So I merged the designs together into a single board.

CrossRoads, I based the code I am using from Adafruits example, except I am displaying on a LCD.
The original example is here
Code:
/***************************************************
  This is an example for the Adafruit Thermocouple Sensor w/MAX31855K

  Designed specifically to work with the Adafruit Thermocouple Sensor
  ----> https://www.adafruit.com/products/269

  These displays use SPI to communicate, 3 pins are required to 
  interface
  Adafruit invests time and resources providing this open source code,
  please support Adafruit and open-source hardware by purchasing
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries. 
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include "Adafruit_MAX31855.h"

int thermoDO = 3;
int thermoCS = 4;
int thermoCLK = 5;

Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
 
void setup() {
  Serial.begin(9600);
 
  Serial.println("MAX31855 test");
  // wait for MAX chip to stabilize
  delay(500);
}

void loop() {
  // basic readout test, just print the current temp
   Serial.print("Internal Temp = ");
   Serial.println(thermocouple.readInternal());

   double c = thermocouple.readCelsius();
   if (isnan(c)) {
     Serial.println("Something wrong with thermocouple!");
   } else {
     Serial.print("C = ");
     Serial.println(c);
   }
   //Serial.print("F = ");
   //Serial.println(thermocouple.readFarenheit());
 
   delay(1000);
}
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Docedison,
the 3V3 regulator is from the max31855 breakout board schematic from Adafruit. I have attached an image of the max31855 breakout schematic.

From your previous comments, does that mean this schematic is incorrect?


* adafruit max31855 breakout.JPG (58.4 KB, 998x550 - viewed 167 times.)
« Last Edit: July 10, 2012, 10:17:03 pm by Rosscopico0 » Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2928
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

About the only thing I see missing would be a pullup to 3V3 on the "Data" line to the '328.... unless it's internal. My comments about bread boards are still relevant. There are no software dependencies that I can see, it isn't fast as a speeding bullet, nor does it do anything really difficult SO IF the bread board combination worked ergo you didn't copy the breadboard faithfully enough and without a scope it becomes hard to prognosticate. I didn't in my earlier comments intend to be dismissive of your efforts but I know first hand how difficult it is to translate bread-boarded circuitry to a PCB and have no errors, likely I will Never forget some of my early boards. To make a difficult situation worse the error is likely something you've looked at so many times you simply can't see it any more. So now... are aall the power supplies clean and on voltage and are all the Vcc and GND/Vss points/sources correct, did you forget a ground or power connection?. If you used an autorouter it is possible that it didn't pick up all the power and ground nets correctly. The first one I used was case sensitive and would cheerfully connect VCC to VCC but Not to Vcc. Agnd was another one that got me once or twice. Power supplies consist of two points + and - if (again with an autorouter) you have Vss and ground in the netlist chances are that they aren't connected. First start with the basics... check each chip for correct power and ground and equally important, in good bread-boarding each assembly has it's own by passing on each supply lead if in.. for the sake of the design you figured that 1 470 uf cap was as good as 3 220 uF... guess again. Caps are CHEAP engineering time isn't so put as many caps... if not larger ones at least the same value. I have proven to myself and to several other "EnGineers" that 10 .1Uf caps are better that 1 10uF cap, if spread around the board, the other point is that By-pass caps work best when spread about the board carefully, besides the 'normal' ones low esr 10 20 uF tantalum or ceramic (X7R only) close to each Ic in addition to the Mandatory 100 nF caps on the Vcc AT EACH CHIP. Ground Planes are VITALLY important Especially around the low level circuitry. and there lies another of the grounding issues, do you have split ground planes? and are they connected together ONLY at the power entry point? This is of Vital importance for a low noise ckt board. Finally read the netlist and check it with a big marker against the schematic first... likely that will point out your errors. Meticulousness is a Virtue to be practiced Most Ardently.
I have done a whole bunch of PC boards and I have found that the above information above works as well as you work it. It was apparent that you hadn't looked over what you posted carefully and that was the sole reason for my rather condescending attitude. When drawing a schematic neatness, well spaced components and functionally grouped components help foster a more linear method of representing your thoughts graphically thus allowing you to concentrate on any one area of the design easily. The schematis represents all of the steps necessary for electrical connectivity and usually information on the parts therefore it is the Master database, Organize it carefully and make it work for you... IMO

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your extensive reply Doc.

This was my first attempt at creating a PCB, so I had (it seems mistakenly) thought that merging a few working schematics (and existing working, separate but wired together boards) would be a good place to start. To keep things simple I used the auto router in Eagle.

I have checked power supply to all chips (tested OK), I have checked all GNDs are connected (tested OK).

I can't see a 470uF capacitor anywhere on the schematic, so that confused me a bit.
When you say "By-pass caps work best when spread about the board carefully", is that to reduce noise issues?

I am currently working my way through the netlist.

I must say this is a great learning experience!

Logged

0
Offline Offline
Shannon Member
****
Karma: 216
Posts: 12556
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SDL, I'm confused. Do you mean S0, SCK or CS ?

Sorry, I meant SDA, a.k.a. A4 - that is an open-drain bus line that can (and must for I2C) be driven from either end, so a diode cannot be right).

Splitting I2C between 5 and 3.3V is possible with care so long as the 5V device recognises 3.3V as HIGH (which the Arduino does), and the pull-up resistors go to 3.3V, not 5V.  The drivers must not pull-up actively.
Logged

[ I won't respond to messages, use the forum please ]

Pages: [1] 2   Go Up
Jump to: