TUSCAn
TemperatUre Sensor CAlculator
Makes available functions for:
- ITS-90 compatible temperature sensors (Standard Platinum Resistance Thermometers), allowing:
- Retrieval of reference resistance ratio WR from t90R reference temperature
- Retrieval of reference temperature t90R from WR reference resistance ratio
- Given sensor coefficient's: sub-range, Rtpw, a, b, c, d, W660, c1, c2, c3, c4, c5
- Retrieval of t90 temperature from sensor's resistance res
- Retrieval of res resistance from sensor's t90 temperature.
- IEC 60751 compatible temperature sensors (Platinum Resistance Thermometers), allowing:
- Retrieval of reference resistance resR from t90R reference temperature
- Retrieval of reference temperature t90R from resR reference resistance
- Given sensor coefficient's: R0, A, B, C
- Retrieval of sensor's resistance res from t90 temperature
- Retrieval of temperature t90 from sensor's resistance res
- IEC 60584 compatible temperature sensors (Thermocouples), allowing, for a given type:
- Retrieval of reference voltage emfR from t90R reference temperature
- Retrieval of reference temperature t90R from reference voltage emfR
- Given sensor coefficient's: a, b, c, d
- Retrieval of sensor's voltage emf from t90 temperature
- Retrieval of temperature t90 from sensor's voltage emf
Installation
Add this line to your application's Gemfile:
gem 'tuscan'
And then execute:
$ bundle
Or install it yourself as:
$ gem install tuscan
Usage examples
ITS-90
# Reference functions (ºC vs Ohm/Ohm)
Tuscan.wr(:its90, 23.456)
Tuscan.t90r(:its90, 1.15)
# Corrected for specific sensor (ºC vs Ohm)
Tuscan.t90(:its90, 25.319871, rtpw: 25.319871, subrange: 7, a: -1.2134e-04, b: -9.9190e-06)
Tuscan.res(:its90, 0.01, rtpw: 25.319871, subrange: 7, a: -1.2134e-04, b: -9.9190e-06)
IEC 60751
# Reference functions (ºC vs Ohm)
Tuscan.t90r(:iec60751, 110)
Tuscan.resr(:iec60751, 10)
# Corrected for specific sensor
Tuscan.t90(:iec60751, 110, r0: 99.876, a:3.9083e-03, b:-5.7750e-07, c:-4.1830e-12)
Tuscan.res(:iec60751, 10, r0: 99.876, a:3.9083e-03, b:-5.7750e-07, c:-4.1830e-12)
IEC 60584
# Reference functions (ºC vs mV)
Tuscan.t90r(:iec60584, 1.234, type: :k)
Tuscan.emfr(:iec60584, 10.123, type: :k)
# Corrected for specific sensor
Tuscan.t90(:iec60584, 3.6105, type: :k, a: 0, b: -1.39363e-05, c: 3.75578e-08, d: -2.17624e-11)
Tuscan.emf(:iec60584, 419.527, type: :k, a: 0, b: -1.39363e-05, c: 3.75578e-08, d: -2.17624e-11)
Notes
-
t90
aliased tot
,temperature
-
res
aliased tor
,resistance
-
emf
aliased tov
,voltage
Contributing
- Fork it ( https://github.com/[my-github-username]/tuscan/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request