Small contribution: MAX31855X Thermocouple sensor.

147 views
Skip to first unread message

Marc St-Cyr

unread,
Apr 24, 2014, 8:48:18 PM4/24/14
to web...@googlegroups.com
Hi guys, thanks again (especially Eric) for the excellent work in bringing this library into being.
I just finished and tested my driver for the MAX31855 SPI chips. I tested with K type thermocouple and everything is good.
I used the MAX31855 from Adafruit Industries.

I think I implemented per your standards.
I have not incorporated into the library yet, but that should be pretty straightforward.

Enjoy.
Marc

Hmmm, for some reason I can't upload the file.
Any ideas ?
Tried firefox and chrome on Ubuntu, tried adding .txt to the end.

Message has been deleted

Andreas Riegg

unread,
Apr 25, 2014, 10:34:58 AM4/25/14
to web...@googlegroups.com
Hi,

thanks for your effort. I can't test your driver functional as I don't have the chip, but you have to add the "Temperature" abstraction class to your device, otherwise the device will miss the Temperature-ralated REST mappings and will also not show up correct in the device monitor.

So change

class MAX31855X(SPI): ....

to

class MAX31855X(SPI, Temperature):

and check if you can see your device as Temperature sensor in the device monitor.

Yor may also update the Copyright statement to year 2014 only and add your name and website to be complete ...

Andreas

Marc St-Cyr

unread,
Apr 26, 2014, 3:39:18 PM4/26/14
to web...@googlegroups.com

Thanks for pointing me in the right direction Andreas, I had tested stand alone only.
I made the modifications you suggested and incorporated into the framework. Quite easy actually. Nice architecture guys.

Attached are the latest files.
Anybody wanting to use them immediately here's how you do it:
copy max31855X.py and __init__.py into the WebIOPi-0-7.0/python/webiopi/devices/sensor (where you unpacked the initial installation)
re-run the setup.py script.

Cheers,
Marc.

Grrrr. Still can't upload on Ubuntu. What's up with that ?

Marc St-Cyr

unread,
Apr 26, 2014, 3:55:25 PM4/26/14
to web...@googlegroups.com
I don't know why, but this time I can upload from my virtual XP machine but not Ubuntu again.
:(

Files attached.
Marc.


__init__.py
max31855X.py

Yenoromp

unread,
Apr 13, 2015, 1:59:08 AM4/13/15
to web...@googlegroups.com
Hi

Do you have any more detail on how to use this.

Im wanting to use it as a BBQ temperature monitor.

Paul

Yenoromp

unread,
Apr 13, 2015, 2:05:28 AM4/13/15
to web...@googlegroups.com
Hi

Also how do I physically connect it up and where is the config stored for the pins used ?

Paul

PS:Please excuse my stupid questions as Im  a noob


On Sunday, April 27, 2014 at 5:55:25 AM UTC+10, Marc St-Cyr wrote:

Marc St-Cyr

unread,
Apr 13, 2015, 9:59:04 AM4/13/15
to web...@googlegroups.com
Hi Paul, here is an Adafruit tutorial on how to connect and use the device.

You can use this program to test without having to install the device in WebIOPi.

Cheers,
Marc.


--
You received this message because you are subscribed to a topic in the Google Groups "WebIOPi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/webiopi/4XPDsirLipk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webiopi+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Max31855-Test.py

Yenoromp

unread,
Apr 13, 2015, 7:55:24 PM4/13/15
to web...@googlegroups.com
Thanks Marc for the reply.

I tested this last night but seem to have hit a few snags.
I could not find out how to set which pins Im using in the Max31855-Test.py.

I also tried some files from below., I like it becuase the setup for the pins is inside the python script.

# Multi-chip example
    import time
    cs_pins = [4, 17, 18, 24]
    clock_pin = 23
    data_pin = 22
    units = "f"

But it keeps reporting 32 "something" (I think degrees) , even if I warm the probe with a heat gun 


My main goal is to get this device to show up in WEBIOPI so that I can track BBQ temperatures :-)
My next step will be working out how to display the data and record it.
So I have a lot to learn , but Im hoping once I get the device recognized and working, modifying an existing project will be easy.
Lots of Beer Brewing ones , Heating and Cooling ones 

I will go through the tutorial tonight again , but if I follow it completely it seems to want to install an old version of Python.

But I will give it another go  tonight and see what happens after my leanings of last night.

Thanks for the reply , it must be a bit painfull with some of the stupid questions from us noobs.

Paul

Marc St-Cyr

unread,
Apr 13, 2015, 8:21:15 PM4/13/15
to web...@googlegroups.com
Hi Paul, did you buy a max31855 board somewhere or did you build a circuit yourself ?
Following the adafruit tutorial should work perfectly. I use the hardware SPI as described in the tutorial.
You should not have to download a different version of Python.

Once you get it working you can do something like this ->> SmokerPi

Yenoromp

unread,
Apr 14, 2015, 4:38:52 AM4/14/15
to web...@googlegroups.com
Hi

Yep I bought the Adafruit one.



I will give it a go later again but kept getting 32degrees, maybe just was trying to do too much.

I currently have a Tappecue , but want to make the equivalent on my PI.
http://www.tappecue.com/

As well as a bbq temperature controller , simple temp sensor (EBAY) and fan I , have an auto manual one at the moment :-)
http://www.ebay.com.au/itm/231389473464?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

Thanks again

Paul

Yenoromp

unread,
Apr 16, 2015, 12:18:21 AM4/16/15
to web...@googlegroups.com
Hi

I seem to have this working now.

I followed the instructions on ADAFRUIT and its all working.

The issues was that I was using the GPIO pin numbers and not the GPIO# :-(

Ive tested hardware SPI and Software SPI.

I used your script and it all works ok , it also shows up on the WEBIOPI devices page.

Am I able to connect more of these modules together on the hardware SPI , (I see I can have multiple on the software SPI) ?

This weekend I need to read up on how to log the info , graph it and kick off actions based on certain values.

Thanks for your help getting this going.

Paul

PS: Ive just ordered 2 more Max31855's today

Marc St-Cyr

unread,
Apr 16, 2015, 3:27:53 AM4/16/15
to web...@googlegroups.com
Excellent!
Yes you can have multiple devices on the SPI bus, but they each require a separate slave select pin.
Pin numbers, ah yes. I got caught with that more than once also.

Good luck with your project.
Reply all
Reply to author
Forward
0 new messages