coffee roaster temperature data logging

i have been trying to get my arduino to send temperature information to a program called Artisan which plots roasting profiles. i initially set up my arduino to display the roaster temperature on 2 displays using MAX6675 k sensor modules. got that sketch to work, now i want to send the temperature data to Artisan to plot roast profiles. other people have done this, but i cannot replicate their success. Artisan allows you to use many different inputs and devices. for arduino, people either use a TC4 shield(which Artisan has a script for) Modbus, or a python script. one user was able to emulate the TC4 shield, but he used different max temperature modules and i have not been able to modify his sketch to make the MAX6675 chips work.
i was able to get my sketch to load and serial print to the serial monitor, but when i attempt communicate with Artisan i get a Modbus communication error. i made sure my COM and baud rate match everywhere. i do not know much about Modbus communication. i am attaching the TC4 emulator and my attempt at modifying it for the MAX6675 chips as well as the sketch for using the Modbus configuration.

TC4-Emulator.ino (1.93 KB)

TC4-Emulator2.ino (1.84 KB)

sketch_test.ino (2.28 KB)

You have not clearly described your setup or the problem. How are forum members supposed to guess what you mean by the following?

i am attaching the TC4 emulator and my attempt at modifying it for the MAX6675 chips as well as the sketch for using the Modbus configuration.

What modifications, and why?

Post a clear wiring diagram (hand drawn, not Fritzing), and links to the adapters.
Post all the details of the error messages.
Post the code, using code tags.

If in doubt, please read and follow the directions in the "How to use this forum" post.

Justinpogge:
seems like a number of people have been able to get the Arduino to speak to Artisan via ModbusRTU

Using Serial?

i am attaching the MAX6675 thermocouple amplifier board directly to the aduino uno the MAX has 5 pins, gnd, vcc, CLK, CS, and DO.

i have attached the MAX6675 to these pins on the arduino uno:

2 = DO
3 = CS
4 = CLK
5 = vcc
6 = gnd

here is the sketch i am working with. the goal is only to output the K sensor information to the Artisan application via ModbusRTU.

// this example is public domain. enjoy!
// Thermocouple sensor tutorial

#include <max6675.h>
#include <ModbusRtu.h>

// data array for modbus network sharing
uint16_t au16data[16] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1 };

/**

  • Modbus object declaration
  • u8id : node id = 0 for master, = 1..247 for slave
  • u8serno : serial port (use 0 for Serial)
  • u8txenpin : 0 for RS-232 and USB-FTDI
  • or any pin number > 1 for RS-485
    */
    Modbus slave(1,0,0); // this is slave @1 and RS-232 or USB-FTDI

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

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);
int vccPin = 5;
int gndPin = 6;

int led = 9;

void setup() {
slave.begin( 19200);// 19200 baud, 8-bits, none, 1-bit stop
// use Arduino pins
pinMode(vccPin, OUTPUT); digitalWrite(vccPin, HIGH);
pinMode(gndPin, OUTPUT); digitalWrite(gndPin, LOW);
pinMode(led, OUTPUT);
delay(500);

}

void loop() {
// basic readout test, just print the current temp

//Serial.print("C = ");

au16data[2] = (uint16_t) (thermocouple.readCelsius()*100);

slave.poll( au16data, 16 );

for(int i=1; i<=99; i++) {
if(i<=au16data[4])
digitalWrite(led, HIGH);
else
digitalWrite(led, LOW);

delay(5);
}

}

I have compiled but will get an error modbus "does not name a type" on Modbus slave(1,0,0); // this is slave @1 and RS-232 or USB-FTDI