This is my first experience with Particle. I am using a Photon connected to a MAX31865 to read a PT100 Temperatures sensor. The idea is to integrate it further with Smarthings to implement a simple ON/OFF PWM tempreature controller using a Smart Outlet.
So far I have been able to flash firmware and I am getting the temperature value streamed through the USB and I am also able to see publicartionof the event in the Console (A String with the temperature value).
When I try to store values in a Google Spreadsheet using IFTTT I am not able to trigger the IFTTT applet though. I have read a number of examples and posts on the subject, tried reconnecting services in IFTTT, tried renaming the event; etc posts and still I cannot seem to trigger the applet.
I can say the config of the Particle Service in IFTTT OK because I have been succesful in triggering an SMS message to my phone when my photon changes its online status, so I suspect something is wrong regarding either the publishing or instancing the Event Name in IFTTT.
This is my code:
// This #include statement was automatically added by the Particle IDE.
//#include <Adafruit_MAX31865_library.h>
#include “application.h”
#include “Adafruit_MAX31865.h”
// Use software SPI: CS, DI, DO, CLK
// Adafruit_MAX31865 sensor = Adafruit_MAX31865 (A2, A5, A4, A3);
// use hardware SPI, just pass in the CS pin
Adafruit_MAX31865 sensor = Adafruit_MAX31865(A2);
// The value of the Rref resistor. Use 430.0!
#define RREF 430.0
void setup() {
Serial.begin(115200);
Serial.println(“Adafruit MAX31865 PT100 Sensor Test!”);
SPI.begin();
sensor.begin(MAX31865_3WIRE); // currently using 3WIRE RTD
Particle.variable(“temperatura”, String (sensor.temperature(100, RREF)));
}
void loop() {
uint16_t rtd = sensor.readRTD();
Serial.print("RTD value: "); Serial.println(rtd);
float ratio = rtd;
ratio /= 32768;
Serial.print("Ratio = "); Serial.println(ratio,8);
Serial.print("Resistance = "); Serial.println(RREF*ratio,8);
//Serial.print("RREF = "); Serial.println(RREF);
Serial.print("Temperature = ");
Serial.println(sensor.temperature(100, RREF));
Particle.publish(“temperature_published”, String(sensor.temperature(100, RREF)));
// Check and print any faults
uint8_t fault = sensor.readFault();
if (fault) {
Serial.print(“Fault 0x”); Serial.println(fault, HEX);
if (fault & MAX31865_FAULT_HIGHTHRESH) {
Serial.println(“RTD High Threshold”);
}
if (fault & MAX31865_FAULT_LOWTHRESH) {
Serial.println(“RTD Low Threshold”);
}
if (fault & MAX31865_FAULT_REFINLOW) {
Serial.println(“REFIN- > 0.85 x Bias”);
}
if (fault & MAX31865_FAULT_REFINHIGH) {
Serial.println(“REFIN- < 0.85 x Bias - FORCE- open”);
}
if (fault & MAX31865_FAULT_RTDINLOW) {
Serial.println(“RTDIN- < 0.85 x Bias - FORCE- open”);
}
if (fault & MAX31865_FAULT_OVUV) {
Serial.println(“Under/Over voltage”);
}
sensor.clearFault();
}
Serial.println();
delay(5000);
}
And this is my IFTTT recipe