MAX31865
Node.js module for the MAX31865 thermocouple amplifier using spi-device.
Install
$ npm install --save max31865
Usage
const MAX31865 = ;const sensor = 0 0; // For /dev/spidev0.0 { await sensor; const tempC = await sensor;}; ;
See examples/index.js
for a full usage example.
API
Options
You can configure the used sensor using the following options for the constructor. This example shows the default values.
const sensor = 0 // bus - first digit in /dev/spidev0.0 0 // device - second digit in /dev/spidev0.0 rtdNominal: 100 // nominal resistance of sensor refResistor: 430 // reference resistance on board wires: 2 // wires used for sensor (2, 3 or 4) ;
Methods
init()
Has to be called once before all other methods. It initilizes the library and sensor for futher usage.
Returns a promise.
Usage example:
sensor ;
getTemperature()
Reads the resistance of the sensor and returns the temperature in degree celsius.
Returns a promise resolving with the temperature value.
Usage example:
sensor ;
getResistance()
Read the resistance value from the RTD in Ω.
Returns a promise resolving with the resistance value.
Usage example:
sensor ;
getFaults()
Read out the integrated fault detection.
Returns a promise resolving with an object of faults and if they have been detected.
Usage example:
sensor ;
readRtd()
Reads the raw ADC convertered value from the RTD sensor.
Returns a promise resolving with the raw RTD value.
Usage example:
sensor ;