Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 898 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 898 Bytes

steinhart-hart

steinhart-hart allows easy coefficient and temperature calculations using your ntc thermistor's resistance.

Installation

npm i steinhart-hart

Usage

import SteinhartHart from 'steinhart-hart';

// To start, gather three known operating points for your ntc thermistor- you will most
// likely find these in your thermistor's datasheet
// celsius = -25 (248.15 in Kelvin) ---- resistance = 87041
// celsius = 0 (273.15 in Kelvin) ---- resistance = 27326
// celsius = 25 (298.15 in Kelvin) ---- resistance = 10000
const steinhartHart = new SteinhartHart([87041, 27326, 10000], [248.15, 273.15, 298.15]);

const {a, b, c} = steinhartHart.getCoefficients();

// returns 307.9031K which is 34.7531C if converted to celsius
const temperature = steinhartHart.getKTemperatureAtResistance(7000)

License

MIT