Hola, conseguí un par se módulos para temperatura max 31855, para esto uso un termopar tipo k con arduino Due.
El problema que tengo es que obtengo datos muy erráticos , en temperatura ambiente me me marca 2024 grados Celsius, utilizo la librería y el sketch ejemplo de adafruit pero no me funciona.
Existe alguna forma de para ajustar temperatura?
De antemano les doy gracias por cualquier ayuda que me puedan brindar
Hola,
¿ y que temperatura se supone que tiene que indicar?
¿ si tocas con los dedos el termopar se mueve la temperatura?
¿como lo has conectado? Los termo pares tienen positivo y negativo, ademas no se puede alargar el cable con un cable normal de cobre.
Si pones el código podremos echarle un vistazo y ademas si pones la librería usada pues mejor. No tendremos que buscarla.
Sigo, sin buenos resultados, con otra libreria el resultado es el mismo, a temperatura ambiente, marca 2048 y con hielo -2048, no se como ajustarlo.... tengo otro max31855 pero trabaja igual... , posiblemente el DUE no trabaja con esta libreria, pero tambien tengo un UNO y ese ni siquiera lee temperatura.... alguna recomendacion?
Vamos a ver, quieres que te ayudemos pero tu no nos ayudas a nosotros.
No nos has puesto como lo conectas. Ya te dije que el termopar tiene positivo y negativo.
No sabemos en que pines tienes conectado el integrado. No sabemos si estas leyendo bien la temperatura.
No somos adivinos.
Pero por adivinar yo diria que tienes la sonda mal conectada o rota.
#include <SPI.h>
#include "Adafruit_MAX31855.h"
// Default connection is using software SPI, but comment and uncomment one of
// the two examples below to switch between software SPI and hardware SPI:
// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO 12
#define MAXCS 10
#define MAXCLK 13
// initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);
// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
//#define MAXCS 10
//Adafruit_MAX31855 thermocouple(MAXCS);
void setup() {
while (!Serial); // wait for Serial on Leonardo/Zero, etc
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);
En el modulo de temperatura esta de la siguiente forma conectado
Hola,
Intentalo conectar así
Y usa estra otra forma para inicializar el SPI
// Example creating a thermocouple instance with hardware SPI
// on a given CS pin.
#define MAXCS 10
Adafruit_MAX31855 thermocouple(MAXCS);
en lugar de la que estas usando.
Si con eso no te funciona visita esta pagina, donde esplica como conectar el MAX31855 sin usar la libreria de Adafruit, la unica pega es que esta en ingles.
Prueba con otro arduino, si no tienes consíguelo.
No digo que este mal pero un DUE a veces tiene comportamientos raros debido a su velocidad de procesamiento.
Supongamos que sea ese el problema y solo quiero descartarlo.
Hola.... bueno , mis disculpas por la insistir, solamente quiero mostrar y comentar lo que hecho, sin obtener resultados, pero quizás alguien pueda ver el fallo que estoy cometiendo.
Primero el sketch:
#include <SPI.h>
const int slaveSelectPin = 52;
void setup()
{
Serial.begin(9600);
// Initialize the bus for a device on pin 10
SPI.begin(slaveSelectPin);
//SPI.setClockDivider(slaveSelectPin, 84);
}
void loop()
{
// Read in 4 bytes of data
byte data1 = SPI.transfer(slaveSelectPin, 0, SPI_CONTINUE);
byte data2 = SPI.transfer(slaveSelectPin, 0, SPI_CONTINUE);
byte data3 = SPI.transfer(slaveSelectPin, 0, SPI_CONTINUE);
byte data4 = SPI.transfer(slaveSelectPin, 0, SPI_LAST); // Stop
// Create two 16-bit variables
word temp1 = word(data1, data2);
word temp2 = word(data3, data4);
// Is the reading negative?
bool neg = false;
if (temp1 & 0x8000)
{
neg = true;
}
// Is the MAX31855 reporting an error?
if (temp1 & 0x1)
{
Serial.println("Thermocouple error!");
if (temp2 & 0x1)
Serial.println("Open circuit");
if (temp2 & 0x2)
Serial.println("VCC Short");
if (temp2 & 0x4)
Serial.println("GND short");
}
// Keep only the bits that interest us
temp1 &= 0x7FFC;
// Shift the data
temp1 >>= 2;
// Create a celcius variable, the value of the thermocouple temp
double celsius = temp1;
// The thermocouple returns values in 0.25 degrees celsius
celsius *= 0.25;
if (neg == true)
celsius *= -1;
double lectura = 0;
for ( int i = 0 ; i < 30 ; i++ ) {
lectura += celsius;
delay(10);
}
lectura /= 30;
// Now print out the data
Serial.print("Temperature: ");
Serial.print(lectura);
//Serial.print(temp1);
Serial.println();
// Sleep for two seconds
delay(2000);
}
Según el datasheet, los bits de temperatura van del 18 al 30
Bueno, si no tengo conectada la termocupla si acitva los bit que avisan errores,
Utilicé un calibrador de procesor para simular temperaturas en el módulo, pero si me devuelve datos absurdos, utilicé una librería junto con el sketch de adafruit, y tampoco.
Utilicé el mega, pero me parece que no trabaja bien debido a que el módulo es de 3.3v .
Solamente brindo esta información a ver si alguien detecta algún fallo, y estoy atento a cualquier recomendación.
Muchas Gracias por su atención, estoy agradecido por la ayuda antes brindada.