-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use AD8494 Thermocouple Amplifier for temperature
We are no longer using a Type K thermocouple.
- Loading branch information
1 parent
fd851c6
commit fa26359
Showing
6 changed files
with
36 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Handles converting millivolt readings into degrees Celcius for an Analog Devices | ||
# AD8494 Thermocouple Amplifier | ||
""" | ||
The equation governing this is specified as: | ||
V_OUT = (T_MJ * 5 mV/°C) + V_REF | ||
where | ||
- T_MJ is the thermocouple measurement junction temperature. | ||
- V_OUT is the measured output voltage | ||
- V_REF is the reference voltage, which has been configured to 0 on the hardware. | ||
Substituting V_REF=0 and rearranging this equation gives: | ||
T_MJ = V_OUT / 5 mV | ||
i.e. every 5 mV gives 1 degree celcius increase | ||
""" | ||
|
||
|
||
def volts_to_celcius(volts: str) -> float: | ||
# Convert to millivolts | ||
mv = float(volts) * 1000 | ||
temp = mv / 5.0 | ||
# Check the result is at least vaguely sensible | ||
assert -10.0 <= temp <= 60.0 | ||
return temp |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters