Giter Site home page Giter Site logo

zanduino / max31855 Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 7.0 753 KB

Read thermocouple temperature using a MAX31855 converter

License: GNU General Public License v3.0

C++ 100.00%
arduino arduino-library max31855 thermocouple temperature-sensor digilent-pmod-tc1 breakout-board thermocouple-temperature spi temperature

max31855's Introduction

License: GPL v3 Build Format Wiki Doxygen arduino-library-badge

MAX31855 library

Arduino library for using the Maxim Integrated MAX31855 cold-junction compensated thermocouple to digital sensor.

Breakout boards

The MAX31855 comes in a small SOIC package, but is also available as a breakout board. The Digilent Pmod TC1 is a 3.3V version, while the Adafruit MAX31855 breakout is 5V compatible.

Temperature sensing

The MAX31855 uses SPI and, when selected, sends a 4 byte buffer which can be decoded to show faults, the ambient die-temperature (cold-junction) and the thermocouple temperature. It does not have any settings or data input, making the library simple. Temperatures are returned in degrees Celsius and the accuracy of the thermocouple temperature reading is ±0.2°C over a range from -200°C to 700°C depending on thermocouple type. The K-Type thermocouple used for developing this library gives a range of -73°C to 482°C. The ambient temperature is affected by die and board temperature and will generally be above actual ambient room temperature.

A detailed library description and further details are available at the GitHub MAX31855 Wiki

Zanshin Logo

max31855's People

Contributors

ademuri avatar per1234 avatar sv-zanshin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

max31855's Issues

device init bug

I tried the demo, and it passes initialization even with no device connected on an arduino mega. It then reports no faults, and reads 0.0C temperatures for ambient and thermocouple.

Add capability for multiple MAX31855

Describe what the feature request is and if it solves an issue or adds functionality
Question asked by @billpurta Currently the library supports only one MAX31855 device although several may be present

Describe the solution you'd like
A such support or describe how it can be done with the current library

Describe alternatives you've considered
N/A

Additional context
N/A

Typo in the demo

Expected Behavior

There is a typo in the demo. SO the compiler crashes

Actual Behavior

see above

Steps to Reproduce the Problem

Copy the demo and run it.

Explain what needs to be done in order to reproduce the problem.
while (!MAX31855.begin(SPI_CHIP_SELECT,SPI_MISO,SPI_SYSTSEM_CLOCK)) // Software SPI for MAX31855
The tyope is in the SPI_SYSTSEM_CLOCK), which shoud be SPI_SYSTEM_CLOCK)

Specifications

  • Library Version:
  • IDE Version:
  • Platform:
  • Subsystem:
  • any other details needed to reproduce the problem

Troubleshooting a cheap breakout board

This code nicely provides a fault code to help with troubleshooting, but the wiki didn't mention my issue: Fault code 7. I now realise this must be fault codes 1, 2 & 4 combined. It might be helpful to present the codes as they are received, 3 separate binary digits presenting different issues.

From the data sheet: Bits D0, D1, and D2 of the output data are normally low.
Bit D2 goes high to indicate a thermocouple short to VCC
Bit D1 goes high to indicate a thermocouple short to GND
Bit D0 goes high to indicate a thermocouple open circuit.

Let's put Fault code 7 aside, it means nothing was correct. What I've discovered is the breakout board I'm using actually has a track between T- and GND, which presents as fault code 2. If I remove the thermocouple I see fault code 3 because faults 1 and 2 are active.

It seems clear the breakout board is garbage and only redeemable by cutting that track if I can get a scalpel into it. However...

The datasheet also suggests T- is tied to ground when measuring the thermocouple, so why is it considered a fault condition? I'm wondering if the board should work if I ignore errors (it doesn't), or if there's an error in the datasheet.

"When executing the temperature conversion of the external thermocouple, the connections to the internal fault-detection circuit are opened (switches S1 and S2 in the Block Diagram) and the switch connecting the coldjunction compensation circuit is opened (switch S5). The internal ground reference connection (switch S3) and the connection to the ADC (switch S4) are closed. This
allows the ADC to process the voltage detected across the T+ and T- terminals."

and later: "The fault-detection circuit tests for shorted connections to VCC or GND on the T+ and T- inputs".

Block diagram

I cut the track and resolved the fault condition, now I just get nonsense data. Internal temp 128 (or -128) and probe -1100 sitting on my desk. Probe goes to -2048 in ice water and +1000 when I warm it again with my hand. It's possible the chip was binned as faulty in the first place. I've got 25 more to test.

WIN_20201129_22_20_30_Pro

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.