Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Everything about electronics
Everything about electronics
Use this calculator to compute the Beta value, temperature, or resistance for an NTC thermistor.
Enter resistance at two known temperatures.
Ω
kΩ
Ω
kΩ
Enter Beta value and any one of resistance or temperature.
Ω
kΩ
Ω
kΩ
// Block 1: Calculate Beta
function calculateBeta() {
const R1 = parseFloat(document.getElementById(“r1”).value) * parseFloat(document.getElementById(“r1_unit”).value);
const R2 = parseFloat(document.getElementById(“r2”).value) * parseFloat(document.getElementById(“r2_unit”).value);
const T1 = parseFloat(document.getElementById(“t1”).value) + 273.15; // Convert to Kelvin
const T2 = parseFloat(document.getElementById(“t2”).value) + 273.15;
if (!R1 || !R2 || !T1 || !T2 || T1 === T2) {
document.getElementById(“beta_result”).innerText = “⚠️ Please enter valid inputs.”;
return;
}
const beta = (Math.log(R1 / R2)) / ((1 / T1) – (1 / T2));
document.getElementById(“beta_result”).innerText = `✅ Beta = ${beta.toFixed(2)} K`;
}
// Block 2: Calculate Resistance or Temperature
function calculateNTC() {
const beta = parseFloat(document.getElementById(“beta”).value);
const R0 = parseFloat(document.getElementById(“r0”).value) * parseFloat(document.getElementById(“r0_unit”).value);
const R = document.getElementById(“r”).value ? parseFloat(document.getElementById(“r”).value) * parseFloat(document.getElementById(“r_unit”).value) : NaN;
const T = document.getElementById(“t”).value ? parseFloat(document.getElementById(“t”).value) + 273.15 : NaN; // Kelvin
let result = “”;
if (!beta || !R0) {
document.getElementById(“ntc_result”).innerText = “⚠️ Please enter Beta and reference resistance.”;
return;
}
if (!isNaN(R) && isNaN(T)) {
// Calculate Temperature
const tempK = 1 / ((1 / (25 + 273.15)) + (1 / beta) * Math.log(R / R0));
const tempC = tempK – 273.15;
result = `Temperature = ${tempC.toFixed(2)} °C`;
} else if (!isNaN(T) && isNaN(R)) {
// Calculate Resistance
const resistance = R0 * Math.exp(beta * ((1 / T) – (1 / (25 + 273.15))));
result = `Resistance = ${resistance.toFixed(2)} Ω`;
} else {
result = “⚠️ Please fill only one of Resistance or Temperature.”;
}
document.getElementById(“ntc_result”).innerText = `✅ ${result}`;
}
(adsbygoogle = window.adsbygoogle || []).push({});