MAX31850 1-wire device

I’m using a MAX31850 to measure temps in an electric kiln. However, Cayenne doesn’t give me a reading on it. If I check it from the terminal I get a good reading and it works with other programs I’ve used. I added it manually and put the serial number in, but that didn’t do any good.The serial number starts with a 3b- if that makes a difference. I know in one of the programs I played with I just needed to include the 3b- in the section of code that defined what numbers to look for. I love the interface and how easy it is to setup different triggers. Hopefully I’ll be able to use this system on this particular project soon.

Drivers have been a hot request item since launch. Unfortunately right now it’s not possible to get data from MAX31850 sensors. I actually have some MAX6675 sensors that I want to use as well. Once they get the custom code widgets released we can write our own python scripts.

The whole family could be supported, just use a different physical layer.

Going to build a WebIOPi driver this weekend for my MAX31855s.

Be careful with the MAX6675s Adam unless your device is kept at ambient temperature as there is no compensation on them. You can however buy the chips and swap out the MAX6675s on your boards as they are pin compatible.

Cheers,

Craig

1 Like

It’s just for a smoker so I’m not super worried about it. As long as it’s close ±10 degrees it’s fine. But for clarification you mean the actual MAX6675 device, right?

Yeah. The physical SOIC pinout for the MAX31855 and MAX6675 are the same. The driver is different to accommodate a slightly different readback.

Moving this to Ideas / Suggestions so I can track the MAX31850 device in road map. Hope you don’t mind.

-B

Found a good pi python driver for the MAX31855 tonight. GitHub - Tuckie/max31855: Raspberry Pi driver for MAX31855 Cold-Junction Compensated Thermocouple-to-Digital Converter

Was looking for something that didn’t include a bunch of libraries, was flexible, and also included the reference junction reading. This one works great!

Should be straightforward now to integrate into a Cayenne driver.

Here’s my test code.

#!/usr/bin/python
from max31855 import MAX31855, MAX31855Error
import RPi.GPIO as GPIO #needed for board definitions

#if referring to GPIO Channel names
#cs_pin = 8
#clock_pin = 11
#data_pin = 9
#units = "c"
#board = GPIO.BCM

#if referring to GPIO header pins
cs_pin = 24
clock_pin = 23
data_pin = 21
units = "c"
board = GPIO.BOARD

thermocouple = MAX31855(cs_pin, clock_pin, data_pin, units, board)

tc = thermocouple.get()
rj = thermocouple.get_rj()

print("tc: {} and rj: {}".format(tc, rj))

thermocouple.cleanup()
1 Like

Looked over that driver, it need to be reworked to directly use SPI interface instead of GPIO.
You can look on MCP23Sxx WebIOPI drivers to see how SPI works, but should be more efficient.

Thx Eriic.

Yeah, for sure. Now will we be able to use more than the two chip selects with the hardware SPI?

Cheers,

Craig

The driver that’s used for the DS18B20 will also work for the MAX31850. Somewhere in the driver it’s going to state what strings to look for to determine the serial number. Just add a new family number of 3b. Here’s one example of what I’m getting at. Both sensors respond to the same commands with the same output.

Hello, have you guys had any luck with this?

You can try with examples from the above post. Once you get the sensor working then sending sensor data to cayenne is easy.

Ok, so I could combine Kreggy’s code with the MQTT code and try to work with that? Tim’s code looks like it must be a driver?

Don’t add cayenne MQTT code now. First try to get reading from the sensor.

Ok, would I need to save that code into a file folder on the Pi and run it with python?

yes. you need to download the library and install it.