Go Down

Topic: MAX31855 library (Read 30395 times) previous topic - next topic

robtillaart

Hi,

please post the sketch you are using, so I can try to recreate the error.


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

druidino

I used the sketch you published at the top of this post but also the adafruit library on github, but anyone works for the same reason, I thought was my IDE version too old, but i'm working with an old mac and i can't upload new versions.

robtillaart

which version of the library are you using?

see attachment for latest version 0.1.04
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

druidino

I tried but those are errors...:(

MAX31855.cpp:19:22: error: MAX31855.h: No such file or directory
MAX31855.cpp:21: error: 'MAX31855' has not been declared
MAX31855.cpp:21: error: expected constructor, destructor, or type conversion before '(' token
MAX31855.cpp:29: error: 'MAX31855' has not been declared
MAX31855.cpp: In function 'void begin()':
MAX31855.cpp:31: error: '_cs' was not declared in this scope
MAX31855.cpp:31: error: 'OUTPUT' was not declared in this scope
MAX31855.cpp:31: error: 'pinMode' was not declared in this scope
MAX31855.cpp:32: error: 'HIGH' was not declared in this scope
MAX31855.cpp:32: error: 'digitalWrite' was not declared in this scope
MAX31855.cpp:34: error: '_sclk' was not declared in this scope
MAX31855.cpp:35: error: '_miso' was not declared in this scope
MAX31855.cpp:35: error: 'INPUT' was not declared in this scope
MAX31855.cpp: At global scope:
MAX31855.cpp:38: error: 'uint8_t' does not name a type
MAX31855.cpp:75: error: 'uint32_t' does not name a type


robtillaart

MAX31855.cpp:19:22: error: MAX31855.h: No such file or directory

looks like the library is in the wrong place

check - http://www.arduino.cc/en/Guide/Libraries -

Which version of the IDE are you using?
MAC / WINDOWS / LINUX?


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

druidino

I'm working on a mac. The library was on the wrong place, I move it in the right folder but I have alwais some truble, tomorrow I will try to understand how it works, because the file .cpp opens only one line and the IDE done errors. Thank you very much for your time!

Richy_T

#21
Jun 30, 2015, 06:17 am Last Edit: Jun 30, 2015, 06:29 am by Richy_T
Just looking for some advice here, I don't think this is related directly to the library...

I bought a 31855K board off of ebay. The labelling is a little different from how the chips are named. I am driving Vcc from the 3.3V pin, GND from GND, Pin 5, CL I am running over a voltage divider to SCK, Pin6, CS I am running over another voltage divider to CS and DO is directly connected to SD on the board.

The voltage dividers are 10K to ground, 4K6 to the data pins and I pull off the middle. My scope seems to show these nice and close to 3.3V on the output.

The issue I'm seeing is that te[...]

Well, it just started working. Odd. I'll just leave this here for now in case it helps anyone or anyone has any advice.

The issue I was seeing was that the temperature seemed to be stuck at 5C whichever way the thermocouple wires were connected. As said, that appears not to be an issue now but it does appear to be reading about 7C low at 80C. Some of that could be due to the thermocouple housing (my comparison is to a naked junction) but that seems like a lot. Not a huge deal as I'll need to calibrate it against another measuring system anyway (I'm adding web monitoring to a control system).

The only difference from before was that the laptop I was using was on battery power and now I'm on the charger. I don't think that should have affected things though.

robtillaart

#22
Jun 30, 2015, 10:10 pm Last Edit: Jun 30, 2015, 10:11 pm by robtillaart
Quote
The only difference from before was that the laptop I was using was on battery power and now I'm on the charger. I don't think that should have affected things though.
"never assume anything"
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Dantos

#23
Jul 23, 2015, 08:48 pm Last Edit: Jul 23, 2015, 10:28 pm by Dantos
Hi Rob,

I have a this MAX31855 board : (http://www.aliexpress.com/snapshot/6764519324.html?orderId=68103515336828) with one VCC, a GND, SO, CS and SCK.

I connected the VCC with the 3.3 V from a Arduino Uno, GND with GND, pin5 with SCK, pin 6 with CS and pin7 with SO.

I do get a temerature reading, looks like it is not too far of most of the time. But I do get sometimes a faulty reading and also a lot of status != 0. I used your demo sketch.

To make it weirder, it does not matter if the VCC is connected or not..
 
Any idea?

Thanks in advance,
Erik
 

robtillaart

Hi Erik,

If it is on a breadboard you might have to check wiring.
There is nothing better than (well) soldered hardware.

Can you check with a DMM that 3.3V is indeed 3.3 volts?

Can you show some sample output?

A faulty value can be a flipping or missing bit.
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Dantos

Hi Rob,

I checked the voltage, it is 3.3V. Measured it directly on the 31855.
I will try again with shorter  wires.

I do not use a level converter, is this required for the SO, CS and SCK? If so , I may have killed the device, though it is give me temp readings.

I will post the readings after testing again. What demo_ will give you most information?


Thanks for you help!

Best regards,
Erik



robtillaart

a demo that shows the raw readings is often useful as the raw reading contains some status info
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Dantos

Hello Rob,

Here  are some readings: first part is when the probe is laying on the table, the second set is when I hand the probe in my hand.  The probe is not picking up heat from my hand, looks like I'm grounding it..?

The actual temperature in the room is around 21 degrees at the moment.



Start max31855_demo1: 0.1.04

stat:      4
-0.25
1.00
0.00
3.00
5.25
2.25
3.25
3.00
2.00
2.50
3.00


Start max31855_demo1: 0.1.04

stat:      4
1.25
15.25
15.50
16.50
16.50
16.00
16.25
17.00
16.25
17.00
17.00
16.00
16.25
15.75
16.50
17.25
16.75
16.25
16.75
16.00
11.25


robtillaart

status 4 means

#define STATUS_SHORT_TO_VCC     0x04

see .h file
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Dantos

#29
Jul 25, 2015, 09:56 pm Last Edit: Jul 25, 2015, 10:59 pm by Dantos
Status  4 happens once during startup, after that I do not get the status again. Looks like a boot issue. I slightly modified the source, so the tepmerature is only printed when the status = 0.


//
//    FILE: max31855_demo1.ino
//  AUTHOR: Rob Tillaart
// VERSION: 0.1.02
// PURPOSE: thermocouple lib demo application
//    DATE: 2014-01-02
//     URL:
//
// Released to the public domain
//

#include "MAX31855.h"

const int doPin = 7;
const int csPin = 6;
const int clPin = 5;

MAX31855 tc(clPin, csPin, doPin);

void setup()
{
  Serial.begin(115200);
  Serial.print("Start max31855_demo1: ");
  Serial.println(MAX31855_VERSION);
  Serial.println();

  tc.begin();
}

void loop()
{
  int status = tc.read();
  if (status != 0)
  {
    Serial.print("stat:\t\t");
    Serial.println(status);
  }
  else {
    double temp = tc.getTemperature();
    Serial.println(temp);
  }
  delay(1000);

}

Update : I tested with another thermocouple,  because I thought it was very  strange that the reading changes when I picked it up.  Now I get proper readings!

Thanks for your help!


Go Up