Reading Maverick Meat probes


#1

Hello, Is it possible to read Maverick Meat probes with code something like this and upload it to Cayenne and view it on the Cayenne IOS app?

Thanks.

 //************************************************************************
//ARDUINO ET-73 MEAT & PIT PROBE LIBRARY 
//By: Skye Perry
//Version 1.0.2  Last Modified: 2016-03-02
//This Library is licensed under a GPLv3 License
//Tested with Maverick Smoker Probes for the ET73. PN: PR-004(smoker probe) & PR-005(meat probe)
//************************************************************************

#ifndef ET73_h
#define ET73_h
#define LIBRARY_VERSION 1.1.1

#if ARDUINO >= 100
 #include "Arduino.h"
#else
 #include "WProgram.h"
#endif

class ET73 {
    private:
      //Constants for the ET-73 and Wiring Schematic            
      const  long double STEINHART_HART_COEF_A = 2.3067434E-4;
      const  long double STEINHART_HART_COEF_B = 2.3696596E-4;
      const  long double STEINHART_HART_COEF_C = 1.2636414E-7;
      const int RESISTOR_VALUE = 22000;

      //Samples and time Attributes
      int PIN;
      int num_samples;
      int sample_interval;
      int timenow;
      int timelastreading;
      bool serial_debug;

      //Private Methods
      bool shouldWeSample(int, int);
      float getAverageReading();

    public:
      //Constructor      
      ET73(int mypin, int mynumsamples = 10, int mysampleinterval = 10,bool debug = false); //Optional arguments must only be defined in the header or prototype
      
      //Public Methods
      float getTemp_F();
      float getTemp_C();
      float getTemp_K();
      void setNumOfSamples(int);
      void setSampleInterval(int);
};

#endif

#2

Definitely. You can display any data from Arduino to Cayenne :slight_smile:

~B


#3

Ok, what would the code need to look like to add in the wifi and Cayenne connections?


#4

Do you have any code that is currently working to read the device?


#5

Yes, The code in the first post works very well. It reads the probe and sends the reading out the serial monitor on the Arduino.
Thanks.
//************************************************************************
//ARDUINO ET-73 MEAT & PIT PROBE LIBRARY
//By: Skye Perry
//Version 1.0.2 Last Modified: 2016-03-02
//This Library is licensed under a GPLv3 License
//Tested with Maverick Smoker Probes for the ET73. PN: PR-004(smoker probe) & PR-005(meat probe)
//************************************************************************

#ifndef ET73_h
#define ET73_h
#define LIBRARY_VERSION 1.1.1

#if ARDUINO >= 100
#include “Arduino.h”
#else
#include “WProgram.h”
#endif

class ET73 {
private:
//Constants for the ET-73 and Wiring Schematic
const long double STEINHART_HART_COEF_A = 2.3067434E-4;
const long double STEINHART_HART_COEF_B = 2.3696596E-4;
const long double STEINHART_HART_COEF_C = 1.2636414E-7;
const int RESISTOR_VALUE = 22000;

  //Samples and time Attributes
  int PIN;
  int num_samples;
  int sample_interval;
  int timenow;
  int timelastreading;
  bool serial_debug;

  //Private Methods
  bool shouldWeSample(int, int);
  float getAverageReading();

public:
  //Constructor      
  ET73(int mypin, int mynumsamples = 10, int mysampleinterval = 10,bool debug = false); //Optional arguments must only be defined in the header or prototype
  
  //Public Methods
  float getTemp_F();
  float getTemp_C();
  float getTemp_K();
  void setNumOfSamples(int);
  void setSampleInterval(int);

};

#endif


#6

Is there code missing here? I might be reading it improperly but I’m missing where it writes to the serial monitor.

Regardless, ultimately what you’re going to want to do is to replace (or supplement) the statements which print the desired data to the Serial Monitor with virtualWrite() statements that instead push that data to Cayenne. This documentation will walk you through the basics of using virtual pins and combining sketch files.

Have you connected your Arduino to Cayenne yet, even as just a blank device without uploading this probe data? If not I’d step back and focus on that first, using this intro documentation. Then when your device is connected you can move to combining the connectivity sketch with your probe sketch and adding some virtualWrite() statements to populate widgets you can create on your dashboard.

If you need some help with it I’d be happy to assist.


#7

Ok, Sorry I’m thinking this is what the code is,

#include <ET73.h> // First we must include the ET73 Library found here
 
 #define MEAT_PROBE_PIN 2 //Now we define which analog pin we're going to read our probe from
 
 // Now we define an ET73 probe called meatProbe, and pass it the pin as the first argument, the rest of the arguments are optional
 // ET73( int probe pin, int Number of samples (optional, default:10) ,  int sample interval in ms (optional, default:10) , bool debug (optional, default:false) )
 ET73 meatProbe(MEAT_PROBE_PIN);  
 
 
 void setup() {
   Serial.begin(9600); //Start the Serial for testing purposes  
 }
 
 void loop() { 
   //When we call the meat probe getTemp_F method, by default the library takes 24 readings at a 10ms interval 
   float myTemp = meatProbe.getTemp_F();   
 
   //Print out our results to the serial monitor
   Serial.print("Temp: ");
   Serial.print(myTemp);
   Serial.print(" F\n");   
 
   //If we want to change the number of samples we're taking for each time we call the getTemp_*(),
   //we can change it by calling the setNumOfSamples() method
   meatProbe.setNumOfSamples(20); //Here we've set the probe to take the average of 20 samples each reading
 
   //If we want to change the interval between each sample reading when we call getTemp_*(),
   //we can change it by calling the setSampleInterval() method
   meatProbe.setSampleInterval(200); //Here we've set it to take a sample every 200 ms
 
   //Now when we call out getTemp_*() method we're going to take the average of 20 samples at a 200ms interval
   myTemp = meatProbe.getTemp_F();  
   
   //Print out our results to the serial monitor and notice how it slows down.
   Serial.print("Temp: ");
   Serial.print(myTemp);
   Serial.print(" F\n");  
   
 }

Thanks.


#8

Yep, there we go. That looks better. I think the other one you posted was the library. I’ll take a better look at it and post some suggestions later.


#9

Ok, Great. I know Ive asked this before. Is there away to make the Raspberry Pi use the MAX31855 Breakout and a driver like this I found tonight https://github.com/Tuckie/max31855 to read and send temperature info to Cayenne for monitoring on the mobile IOS app etc with possible alerts? I think this would be very useful for people with home brewing, smoking meats, grills, oven monitoring anything that the DS18B20 can’t handle. The Pi would be a less costly device than the Arduino Yun Etc. Just a thought Thanks.


#10

To address this last question, if you have the Pi/Breakout functioning outside the context of Cayenne (printing the temperature issue to your Pi command line) then you can connect your Pi to Cayenne as a MQTT/“Bring Your Own Thing” device and use that to send/receive data to your dashboard and take advantage of Cayenne features like alerts/scheduling.

Where I’d start is to connect your Pi using the Cayenne MQTT Python library using one of the example sketches there. In the example sketches, you can see that we have some fake data being generated and published to Cayenne to show you what the process looks like, in statements like this:

client.celsiusWrite(1, i)
client.luxWrite(2, i*10)
client.hectoPascalWrite(3, i+800)

You can then replace those fake data statements with the ones that are printing data to your command line, modified to publish to Cayenne. You might need do to a little manipulation on the output data in python in order to get it in a format that Cayenne can accept – I can certainly help with that if you show me some examples of what you’re getting on the command line.


#11

I think this should work, let me know! You’ll have to set up a virtual pin on V1 on your dashboard and replace the token with your token.

#include <ET73.h> // First we must include the ET73 Library found here
#define MEAT_PROBE_PIN 2 //Now we define which analog pin we're going to read our probe from
#include <CayenneEthernet.h>
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space
#define VIRTUAL_PIN V1

// Now we define an ET73 probe called meatProbe, and pass it the pin as the first argument, the rest of the arguments are optional
// ET73( int probe pin, int Number of samples (optional, default:10) ,  int sample interval in ms (optional, default:10) , bool debug (optional, default:false) )
ET73 meatProbe(MEAT_PROBE_PIN);  

char token[] = "yourtoken";

void setup() {
  Serial.begin(9600); //Start the Serial for testing purposes  
  Cayenne.begin(token);
}

void loop() { 
  Cayenne.run();
}

CAYENNE_OUT(VIRTUAL_PIN){
  //When we call the meat probe getTemp_F method, by default the library takes 24 readings at a 10ms interval 
  float myTemp = meatProbe.getTemp_F();   
  
  //Print out our results to the serial monitor
  Serial.print("Temp: ");
  Serial.print(myTemp);
  Serial.print(" F\n");   
  
  Cayenne.fahrenheitWrite(VIRTUAL_PIN, myTemp);
}

#12

All I can say is WOW! Thanks a lot this is awesome. I had an unused Arduino Ethernet 2 Shield laying around so I just had to change the library. I have not tested at high temps but its right on with the room temp sensor I have. Next step maybe WiFi but it seems Arduino’s wireless options are dwindling down. Any suggestions or do any of the WiFi shields from other companies work with Cayenne?

adam Leader
October 13 |

I think this should work, let me know! You’ll have to set up a virtual pin on your dashboard and replace the token with your token
#include <ET73.h> // First we must include the ET73 Library found here
#define MEAT_PROBE_PIN 2 //Now we define which analog pin we’re going to read our probe from
#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
#include <CayenneEthernet.h>

// Now we define an ET73 probe called meatProbe, and pass it the pin as the first argument, the rest of the arguments are optional
// ET73( int probe pin, int Number of samples (optional, default:10) , int sample interval in ms (optional, default:10) , bool debug (optional, default:false) )
ET73 meatProbe(MEAT_PROBE_PIN);

char token[] = “yourtoken”;

void setup() {
Serial.begin(9600); //Start the Serial for testing purposes
Cayenne.begin(token);
}

void loop() {
Cayenne.run();
}

CAYENNE_OUT(VIRTUAL_PIN){
//When we call the meat probe getTemp_F method, by default the library takes 24 readings at a 10ms interval
float myTemp = meatProbe.getTemp_F();

//Print out our results to the serial monitor
Serial.print(“Temp: “);
Serial.print(myTemp);
Serial.print(” F\n”);

Cayenne.fahrenheitWrite(VIRTUAL_PIN, myTemp);
}
Visit Topic or reply to this email to respond.

In Reply To

adbrig4
October 12 |

Ok, Great. I know Ive asked this before. Is there away to make the Raspberry Pi use the MAX31855 Breakout and a driver like this I found tonight https://github.com/Tuckie/max31855 to read and send temperature info to Cayenne for monitoring on the mobile IOS app etc with possible alerts? I think this…
Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.


#13

According to the add device process you can use an official Arduino WiFi shield https://store.arduino.cc/usa/arduino-wifi-shield or https://store.arduino.cc/usa/arduino-wifi-101-shield although they appear to be retired now. I don’t own either and have never used them to connect so I can’t comment on it. You can also use an ESP8266 following these instructions but it’s not officially supported.


#14

Bumping this old thread to share that we’ve just provided support in our MQTT Arduino library for using ESP8266 as a shield :slight_smile: We’ve done basic testing and works well. Give it a try for your project and let us know how it works out for you !

Here is the updated library on our github:

and the code can be found here: