Thermocouple Voltage Conversion
This library converts between voltage and temperature and vice versa for the 8 most common thermocouple types.
View a simple demo of it in action.
; let tempC = Thermocouple;let mVolts = Thermocouple;
millivoltsToTemp
static millivoltsToTemptcType: string, mVolts: number: number
Argument | Type | Description |
---|---|---|
tcType | string | Thermocouple type. Valid types: 'b'|'e'|'j'|'k'|'n'|'r'|'s'|'t' |
mVolts | number | Voltage value in millivolts. Valid range depends on thermocouple type |
returns | number | Temperature in °C. Returns NaN if input is outside thermocouple range |
tempToMillivolts
static tempToMillivoltstcType: string, temp: number: number
Argument | Type | Description |
---|---|---|
tcType | string | Thermocouple type. Valid types: 'b'|'e'|'j'|'k'|'n'|'r'|'s'|'t' |
temp | number | Temperature value in °C. valid range depends on thermocouple type |
returns | number | Voltage in millivolts. Returns NaN if input is outside thermocouple range |
Thermocouple specific classes
In addition, there are thermocouple specific classes which have similar methods plus access to the valid input ranges.
; let typeK = ; let tempC = typeK; // 684.62...let mVolts = typeK; // 40.629... let minV maxV = typeKvoltageRange; // [-6.458, 54.886]let minT maxT = typeKtempRange; // [-270, 1372]let name = typekname // 'k'
To build this library
> npm install && npm run build
To run the tests
> npm install && npm test