Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Max31856 reading 0.0
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Max31856 reading 0.0

by alforddm on Tue Aug 04, 2020 6:52 pm

I had a working kiln controller project project but was using depreciated libraries. I ran some updates thinking I had a good backup only to discover I hadn't moved it over to my usb drive before I wiped the harddrive.

I installed the new repos and my max31856 was reading 0.0. Thinking that maybe it had gone out on me, I bought a new max31856, still getting 0.0. Started fresh with raspberry os lite and only installed the dependencies needed. Still get 0.0 for the test code.

Code: Select all | TOGGLE FULL SIZE
    import board
    import busio
    import digitalio
    import adafruit_max31856
     
    # create a spi object
    spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
     
    # allocate a CS pin and set the direction
    cs = digitalio.DigitalInOut(board.D5)
    cs.direction = digitalio.Direction.OUTPUT
     
    # create a thermocouple object with the above
    thermocouple = adafruit_max31856.MAX31856(spi, cs)
     
    # print the temperature!
    print(thermocouple.temperature)


I run it with python3 test.py No errors just reads 0.0.


I realize my thermocouple wires were cross in this photo. I fixed them and tried again still nothing.
Attachments
IMG_20200804_172259.resized.jpg
IMG_20200804_172259.resized.jpg (1001.58 KiB) Viewed 37 times
IMG_20200804_172256.resized.jpg
IMG_20200804_172256.resized.jpg (879.48 KiB) Viewed 37 times

alforddm
 
Posts: 18
Joined: Sat Oct 19, 2019 6:17 pm

Re: Max31856 reading 0.0

by alforddm on Wed Aug 05, 2020 4:59 pm

Things I've tried. Oh yeah this is a raspberry pi 4 1G.


1) When I originally started all this everything was hard wired but the test code and new libraries didn't work. I had cs hard wired to ce0 instead of d5 so I moved that one wire (still hard soldered) and still no workie. Thinking I had somehow blown my max31856 by trying with things still wired to ce0 I ordered a new one.

2) I de-soldered the original max31856 and tried it with the breadboard with in the original system but with the new libraries (d5 instead of ce0)

3) Tried the new max38156 with the breadboard, original system and new libraries

4) Tried starting over with raspberry os lite and only the needed libraries and the test code

5) Had hubby look at my soldering. He said I used to much solder but that all the connections looked ok otherwise. He was trained to NASA specs so he should know.

6) tried a different breadboard

7) Ohm checked my thermocouple wires to make sure they weren't broken or shorted to each other

8) tried a different thermocouple

9) made sure my spi and i2c interfaces were on (3 times)

I'm stumped. Anyway this could be the raspberry pi GPIO interface? Any other ideas? The raspberry pi itself boots and runs fine although I do everything thing through ssh and haven't tried hooking up a monitor.

alforddm
 
Posts: 18
Joined: Sat Oct 19, 2019 6:17 pm

Re: Max31856 reading 0.0

by mikeysklar on Wed Aug 05, 2020 5:38 pm

At the moment I see your GPIO5 is still in GPIO6 is that intentional that you have left it there?

Has the code you have been using been updated since re-install to reflect that? In the example you show D5 is still be referenced instead of D6.

Your example code is different than out current recommended example. I would suggest installing our github library and using the max31855_simpletest.py

https://github.com/adafruit/Adafruit_Ci ... n_MAX31855

https://github.com/adafruit/Adafruit_Ci ... pletest.py

mikeysklar
 
Posts: 1743
Joined: Mon Aug 01, 2016 8:10 pm

Re: Max31856 reading 0.0

by alforddm on Wed Aug 05, 2020 5:50 pm

This is the pinout diagram I have been using. It shows GPIO6 as D5. Is that not correct?

I'm using the max31856 not the 31855

I'm using this library
https://github.com/adafruit/Adafruit_Ci ... n_MAX31856

The test code is copied directly from the examples in the library. Looks the same as the website except comments and a different cs pin.

https://learn.adafruit.com/adafruit-max ... cuitpython

Image

alforddm
 
Posts: 18
Joined: Sat Oct 19, 2019 6:17 pm

Re: Max31856 reading 0.0

by mikeysklar on Thu Aug 06, 2020 10:59 am

Thank you for noticing that I mixed up the 31856 with the 31855. Please switch your breadboard wiring to GPIO5 and the code to use board.D5. Our defaults.

mikeysklar
 
Posts: 1743
Joined: Mon Aug 01, 2016 8:10 pm

Re: Max31856 reading 0.0

by alforddm on Thu Aug 06, 2020 12:33 pm

*Groan* That was it. I was using the wrong pin out because that diagram had GPIO06 marked as D5.

So for circuit python the "D" pins are the same as the GPIO pin numbers? Is there an official adafruit pinout that has those marked? I wasn't sure they were the same and then of course that Diagram had me all wrong. I should have just counted pins.

Thanks so much for your help. There's a good chance that my original max31856 is still good. I guess it never hurts to have a backup.

alforddm
 
Posts: 18
Joined: Sat Oct 19, 2019 6:17 pm

Re: Max31856 reading 0.0

by mikeysklar on Thu Aug 06, 2020 1:40 pm

The GPIO pins are the same as the D# pins. No need for complicated charts.

mikeysklar
 
Posts: 1743
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.