awootton
Posts: 5
Joined: Mon Sep 16, 2013 11:32 pm

Re: MAX31855 Thermocouple driver

Tue Sep 17, 2013 3:01 am

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

tuckie
Posts: 12
Joined: Mon Sep 03, 2012 1:50 am

Re: MAX31855 Thermocouple driver

Wed Sep 18, 2013 12:42 am

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?

awootton
Posts: 5
Joined: Mon Sep 16, 2013 11:32 pm

Re: MAX31855 Thermocouple driver

Wed Sep 18, 2013 1:14 am

I got it from here:-
http://www.skpang.co.uk/catalog/quick2w ... -1170.html

and the company website:-
http://quick2wire.com/products/quick2wi ... board-kit/

thanks for your input, Andrew

tuckie
Posts: 12
Joined: Mon Sep 03, 2012 1:50 am

Re: MAX31855 Thermocouple driver

Wed Sep 18, 2013 1:32 am

awootton wrote:I got it from here:-
http://www.skpang.co.uk/catalog/quick2w ... -1170.html

and the company website:-
http://quick2wire.com/products/quick2wi ... board-kit/

thanks for your input, Andrew
So... where's the MAX31855?

awootton
Posts: 5
Joined: Mon Sep 16, 2013 11:32 pm

Re: MAX31855 Thermocouple driver

Wed Sep 18, 2013 2:17 am

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

vutwong
Posts: 3
Joined: Thu Nov 21, 2013 9:30 pm

Re: MAX31855 Thermocouple driver

Thu Nov 21, 2013 9:38 pm

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.

JCanada
Posts: 3
Joined: Tue Jul 16, 2013 11:46 pm

Re: MAX31855 Thermocouple driver

Fri Nov 22, 2013 3:22 am

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:

Image
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!

tuckie
Posts: 12
Joined: Mon Sep 03, 2012 1:50 am

Re: MAX31855 Thermocouple driver

Fri Nov 22, 2013 4:11 am

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.

vutwong
Posts: 3
Joined: Thu Nov 21, 2013 9:30 pm

Re: MAX31855 Thermocouple driver

Fri Nov 22, 2013 4:19 am

Hi,

Thanks JCanada and tuckie.. I think that is my problem. Will go back and update later. Thanks so much

tuckie
Posts: 12
Joined: Mon Sep 03, 2012 1:50 am

Re: MAX31855 Thermocouple driver

Fri Nov 22, 2013 4:24 am

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()

vutwong
Posts: 3
Joined: Thu Nov 21, 2013 9:30 pm

Re: MAX31855 Thermocouple driver

Fri Nov 22, 2013 8:17 am

All working now.. Thank you again. :D :D :D :D :D

pinkstond
Posts: 13
Joined: Mon Sep 17, 2012 9:59 pm

Re: MAX31855 Thermocouple driver

Sun Mar 02, 2014 4:39 am

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!

tuckie
Posts: 12
Joined: Mon Sep 03, 2012 1:50 am

Re: MAX31855 Thermocouple driver

Sun Mar 02, 2014 4:53 am

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

pinkstond
Posts: 13
Joined: Mon Sep 17, 2012 9:59 pm

Re: MAX31855 Thermocouple driver

Sun Mar 02, 2014 5:03 am

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

pinkstond
Posts: 13
Joined: Mon Sep 17, 2012 9:59 pm

Re: MAX31855 Thermocouple driver

Fri Mar 07, 2014 9:12 pm

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?

tuckie
Posts: 12
Joined: Mon Sep 03, 2012 1:50 am

Re: MAX31855 Thermocouple driver

Sat Mar 08, 2014 5:09 am

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!

bradyw
Posts: 8
Joined: Wed Jul 16, 2014 8:34 pm
Location: Minneapolis

Re: MAX31855 Thermocouple driver

Thu Aug 14, 2014 1:38 pm

Does this work with all MAX31855's? For example, could it work with a type K and type T?

MikesPi
Posts: 23
Joined: Tue Sep 01, 2015 8:33 pm

Re: MAX31855 Thermocouple driver

Tue Sep 22, 2015 6:37 pm

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.

tuckie
Posts: 12
Joined: Mon Sep 03, 2012 1:50 am

Re: MAX31855 Thermocouple driver

Sun Sep 27, 2015 11:42 pm

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.

Return to “Interfacing (DSI, CSI, I2C, etc.)”