Page 1 of 2

MAX31855 Driver

Posted: Wed Feb 08, 2017 11:19 pm
by deshipu
I made a driver for the MAX31855 thermocouple amplifier. The code is at https://bitbucket.org/thesheep/micropython-max31855

Re: MAX31855 Driver

Posted: Fri Sep 25, 2020 3:14 pm
by Primesty
Hey deshipu the link for the max31855 driver is not working anymore. Does anyone happen to have the raw .py driver file they’d be willing to share with me and/or are aware of another driver that works for the adafruit max31855 thermocouple breakout?

I’d appreciate it!

Re: MAX31855 Driver

Posted: Sun Sep 27, 2020 11:58 am
by mcauser
Deshipu's bitbucket is missing heaps of repositories, now that Atlassian has dropped mercurial support.
https://bitbucket.org/blog/sunsetting-m ... -bitbucket

Hi @deshipu, I cloned heaps of your repos, so if you've lost anything, I may have a copy that I can zip and send back.

Re: MAX31855 Driver

Posted: Sun Sep 27, 2020 2:19 pm
by Primesty
Hi guys,

Thanks for all the input here. I'll def check it out.

I was actually to get it to work without a 'real' driver on my ESP31 (MicroPython v1.13) based on this old adafruit document:

https://cdn-learn.adafruit.com/download ... evices.pdf

Code: Select all


from machine import Pin, SPI
import time

cs = Pin(13, Pin.OUT)

spi = SPI(-1, baudrate=5000000, polarity=0, phase=0, sck=Pin(5), mosi = Pin(10), miso=Pin(4))
# MOSI has to be defined BUT is not needed to read data


def read_temp(cs, spi):
    while True:
        try:
            data = bytearray(4)
            cs.value(0)
            spi.readinto(data)
            cs.value(1)
            print(data)
            temp = data[0] << 8 | data[1]
            if temp & 0x0001:
                return float('NaN')
            temp >>= 2
            if temp & 0x2000:
                temp -= 16384
            print(temp * 0.25)
        except:
            pass
        time.sleep(1)

read_temp(cs, spi)

This works surprisingly well even when I run it in an async application with uasyncio.

Re: MAX31855 Driver

Posted: Mon Sep 28, 2020 7:50 am
by deshipu
By the way, all the deleted Bitbucket repos have been archived by Software Heritage, for example: https://bitbucket-archive.softwareherit ... 31855.html

Re: MAX31855 Driver

Posted: Mon Nov 02, 2020 9:15 am
by Corruptsector
Does anyone have a copy of these files. I got the archive version but its made it a py.l file and it looks like a binary. Sorry if this is a stupid question but does anyone know how to use the archive file at https://bitbucket-archive.softwareherit ... ory.tar.gz

Re: MAX31855 Driver

Posted: Mon Nov 02, 2020 9:28 am
by pythoncoder
I think you've downloaded the wrong file. I can't open this file.

In general under Linux you can just browse to the file with your favourite file manager, double-click on it and it will be opened using archive manager. But it doesn't work for this file which appears empty. I can't answer for Windows or OSX.

Re: MAX31855 Driver

Posted: Mon Nov 02, 2020 9:36 am
by Corruptsector
Thanks for the quick reply. But if i click on the link provided by deshipu and download the repo, thats the file i get. A tar.gz that when i extact has all sorts of off files in it. I think maybe its a Mercurial thing, but not sure how to get the driver out of that file.

Any help appreciated. It looks like all links to this driver are dead.

Re: MAX31855 Driver

Posted: Mon Nov 02, 2020 9:42 am
by pythoncoder
That's a puzzler. I can open other tar.gz files with no problem, but not the one you linked which appears empty.

As for the driver I haven't used it. Hopefully someone who has will chip in.

Re: MAX31855 Driver

Posted: Mon Nov 02, 2020 9:46 am
by Corruptsector
Thanks Peter. there is a .hg folder which might be hidden in linux.

Then under .hg\store\data there is max31855.py.i but no idea what next.