Skip to content

Maxim MAX31856 Thermocouple to Digital Converter Arduino Library

License

Notifications You must be signed in to change notification settings

PlayingWithFusion/PWFusion_MAX31856

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Playing With Fusion MAX31856 Arduino Library

SEN-30005-K ISO SEN-30006-J ISO SEN-30007-T ISO SEN-30008-ST ISO SEN-30012-K ISO

Arduino library designed to interface Arduino-compatible hardware with the Maximum MAX31856 Thermocouple to digital converter IC over SPI, used for digitizing thermocouple measurements. Examples provided to interface with SEN-30005, SEN-30006, SEN-30007 and SEN-30008

Library Documentation

Brief documentation for this library. Make sure to see "examples" folder for ready-to-upload programs.

Configuration

Configuration of a thermocouple requires the Thermocouple Type, Filter Frequency, Average Mode, and Measure Mode.

A basic configuration for a k-type thermocouple may look like this:

MAX31856 tcConverter;

void setup(){
  tcConverter.config(TYPE_K, CUTOFF_60HZ, AVG_SEL_1SAMP, CONV_AUTO);
}

/* ... */

The above code configures a K-type thermocouple with a selected notch filter frequency of 60hz, no averaging accross samples, and auto conversion.

Notch Frequency

You can configure the notch frequency with the MAX31856::config function. The notch frequency is designed to tell the MAX31856 what frequency of noise the internal filter should cut out. For instance, in the U.S., our power is 120V 60hz AC. The noise from these power lines can, in some cases, interfere with long thermocouple wires, so we select 60hz for the filter frequency. Those that have 50hz power, should select 50hz.

Averaging

The MAX31856 allows a user to configure averaging to be done on the IC itself accross multiple measurements. This increases accuracy, but makes measuring each conversion take longer. For the quickest sampling rate, keep this at AVG_SEL_1SAMP.

Conversion Mode

The MAX31856 can perform measurements over and over again, without input from the microcontroller, or, can be configured to only measure when the MCU requests it. For basic use, auto conversion mode is fine (CONV_AUTO).

Sampling

When in automatic conversion mode, simply call the MAX31856::sample() function to update the library's internal data with the MAX31856's data.

tcConverter.sample();

When in single-shot mode, the user must explicitly start the conversion, and then read it later, after it's had time to complete the conversion. For the time it takes for single-shot to perform conversions, see the MAX31856 datasheet.

tcConverter.startOneShotMeasurement();   // Start measurement
delay(180);                              // waiting for new measurement (143ms for 60Hz, 169ms for 50Hz)
tcConverter.sample();                    // Get latest measurement from MAX31856 channels

Compatible Playing With Fusion Products:

Note: all thermocouple interface types are available for each board variant

Questions? Feel free to contact us!

About

Maxim MAX31856 Thermocouple to Digital Converter Arduino Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages