Page 2 of 2
Re: MAX31855 Thermocouple driver
Posted: Tue Sep 17, 2013 3:01 am
by awootton
its the Quick2Wire board that I assembled from a kit - which is why I have been a bit suspicious that I might have a dry solder joint
Re: MAX31855 Thermocouple driver
Posted: Wed Sep 18, 2013 12:42 am
by tuckie
awootton wrote:its the Quick2Wire board that I assembled from a kit - which is why I have been a bit suspicious that I might have a dry solder joint
Sorry, I can't find the board you're refering to, could you include a link?
Re: MAX31855 Thermocouple driver
Posted: Wed Sep 18, 2013 1:14 am
by awootton
Re: MAX31855 Thermocouple driver
Posted: Wed Sep 18, 2013 1:32 am
by tuckie
So... where's the MAX31855?
Re: MAX31855 Thermocouple driver
Posted: Wed Sep 18, 2013 2:17 am
by awootton
I have had it plugged into the SPI0 of the Quick2Wire interface board and also tried the SPI1 port. I'm using the cable as supplied by SK Pang for the project outlined here:
http://www.skpang.co.uk/blog/archives/886
regards, Andrew
Re: MAX31855 Thermocouple driver
Posted: Thu Nov 21, 2013 9:38 pm
by vutwong
Hi all,
I have the same problem as awootton. Always return 0.0.
I have tested all the combinations. Is there anything else I can do to check whether it is a hardware problem or not. I got the breakout board from adafruit. I am using breadboard for connecting raspi to max31855 breakout board. I did a continuity test for each line and everything is connected.
Thank you all for your help.
Re: MAX31855 Thermocouple driver
Posted: Fri Nov 22, 2013 3:22 am
by JCanada
Thanks for the update on this, Tuckie! V2.0 is a great improvement over V1.0.
As for vutwong and awootton, I may have the answer to your problems if you have already tried everything Tuckie has suggested. On the GitHub page in the example, the example pins are as follows:
Code: Select all
cs_pin = 24
clock_pin = 23
data_pin = 22
units = "f"
thermocouple = MAX31855(cs_pin, clock_pin, data_pin, units)
What I didn't realize, is that the designated pins (24, 23, and 22) are NOT the pin number on the PI itself, but rather the GPIO pin number! Here is a picture of what I am referring to:

As you can see, if you followed the diagram how I did, that is placing the wires on pins labeled 24, 23, and 22 in the middle of the picture, you are actually placing the wires on GPIO8, GPIO11, and GPIO25!
Basically, the numbers that you designate for the pins are the GPIO numbers, not the pin numbers! If you follow the example code, you would actually need to connect the wires to pins labeled 18, 16, and 15.
I hope this helps anyone who stumbles across this, as it took me a while to figure out!
Re: MAX31855 Thermocouple driver
Posted: Fri Nov 22, 2013 4:11 am
by tuckie
JCanada wrote:What I didn't realize, is that the designated pins (24, 23, and 22) are NOT the pin number on the PI itself, but rather the GPIO pin number!
So sorry for the confusion on this! I'll update the readme to clarify things.
Re: MAX31855 Thermocouple driver
Posted: Fri Nov 22, 2013 4:19 am
by vutwong
Hi,
Thanks JCanada and tuckie.. I think that is my problem. Will go back and update later. Thanks so much
Re: MAX31855 Thermocouple driver
Posted: Fri Nov 22, 2013 4:24 am
by tuckie
Readme has been updated! You can actually use either pin assignment, if GPIO.BOARD is your thing
For example:
Code: Select all
from max31855 import MAX31855, MAX31855Error
cs_pin = 24
clock_pin = 23
data_pin = 22
units = "f"
board = GPIO.BOARD
thermocouple = MAX31855(cs_pin, clock_pin, data_pin, units, board)
print(thermocouple.get())
thermocouple.cleanup()
Re: MAX31855 Thermocouple driver
Posted: Fri Nov 22, 2013 8:17 am
by vutwong
Re: MAX31855 Thermocouple driver
Posted: Sun Mar 02, 2014 4:39 am
by pinkstond
Thanks for the info and the python! I have two Max31855 breakouts from adafruit and have one at a time working successfully. I'm kind of limited on gpios and was curious if you HAD to have ALL new pins for a 2nd MAX31855? I was hoping to get away with sharing pins with the 1st one, but so far my trials are not working out like that.
Would appreciate any info on this!
Thanks!
Re: MAX31855 Thermocouple driver
Posted: Sun Mar 02, 2014 4:53 am
by tuckie
Every pin can be shared except the cs_pin. Take a look at the multi-chip example in the main file:
https://github.com/Tuckie/max31855/blob ... 55.py#L146
Re: MAX31855 Thermocouple driver
Posted: Sun Mar 02, 2014 5:03 am
by pinkstond
Sweet. I changed the CS_pins in the main file and the first time I ran it, it appeared that I got a correct first reading. Then I continued to get zeros every line after that. Also rerunning it I would continue to get zeros.
Also now when I run the single max31855 file I get zeros now.
EDIT:
Now I'm getting this:
Code: Select all
tc: 68.45 and rj: 71.2625
tc: Error: No Connection and rj: 72.8375
Re: MAX31855 Thermocouple driver
Posted: Fri Mar 07, 2014 9:12 pm
by pinkstond
Got the no connection thing under wraps.
When I had everything on a breadboard I finally got all working nice and smooth. Once I soldered everything up I and run the scripts I get a few readings from each TC and then I randomly get these two errors thrown in that kill the scripts:
Code: Select all
Thermocouple short to ground
Thermocouple short to VCC
I've checked and rechecks all the connections and the solder job and it all looks good. Did a continuity test on everything and still everything checks out. Maybe interference? Any way to fix/prevent this?
Re: MAX31855 Thermocouple driver
Posted: Sat Mar 08, 2014 5:09 am
by tuckie
IIRC, I also noticed similar behavior when I had issues with my CS line connections -- it would happen when one chip talked over another, so to speak. I tested the script for days without error in its current form. You could always try a MS pause between reads to see if that helps.
An alternative would be to wrap the .get() statement in a try / except block and ignore the read if it errors (like the multi-chip example, but without setting running = False). It would still be a good idea to track exceptions, maybe have an error accumulator for every bad read that gets cleared on every good read. if you get more than 10 in a row (or however many), throw a real error.
Hope that helps!
Re: MAX31855 Thermocouple driver
Posted: Thu Aug 14, 2014 1:38 pm
by bradyw
Does this work with all MAX31855's? For example, could it work with a type K and type T?
Re: MAX31855 Thermocouple driver
Posted: Tue Sep 22, 2015 6:37 pm
by MikesPi
I came across this some hours back and thought it was heaven sent! (except.......!)
I had been struggling with using code in the Adafruit library and whilst I have got my MAX31855 functioning and displaying temperature with their sample program it was far from ideal because it is Python2 based and everything I have is Python3. Finding this driver looks brilliant and I have tried to set up and run the sample program here on my Pi2. I am having problems though with the step "sudo modprobe spi_bcm2708" which returns " ERROR: could not insert 'spi_bcm2708': No such device".
I have seen entries on the forum regarding recent changes introduced with the Pi2 involving the different handling of spi, I2c etc which I assume do apply in this instance. So I have done "sudo apt-get update" "sudo apt-get upgrade" and have added dtparam=spi=on to the config.txt as seems recommended but all to no avail, I am still getting this error message.
Any suggestions or pointers? Many thanks.
Re: MAX31855 Thermocouple driver
Posted: Sun Sep 27, 2015 11:42 pm
by tuckie
MikesPi wrote:I came across this some hours back and thought it was heaven sent! (except.......!)
I had been struggling with using code in the Adafruit library and whilst I have got my MAX31855 functioning and displaying temperature with their sample program it was far from ideal because it is Python2 based and everything I have is Python3. Finding this driver looks brilliant and I have tried to set up and run the sample program here on my Pi2. I am having problems though with the step "sudo modprobe spi_bcm2708" which returns " ERROR: could not insert 'spi_bcm2708': No such device".
I have seen entries on the forum regarding recent changes introduced with the Pi2 involving the different handling of spi, I2c etc which I assume do apply in this instance. So I have done "sudo apt-get update" "sudo apt-get upgrade" and have added dtparam=spi=on to the config.txt as seems recommended but all to no avail, I am still getting this error message.
Any suggestions or pointers? Many thanks.
Thankfully, with v2.0, I've gone away from any hardware SPI. Everything is done with software bit-banging with the GPIO library. (no 'sudo modprobe spi_bcm2708' needed) If you can get an LED blinking with the GPIO library you should be able to get this working as well.