Heat Sink & Temperature Rise Calculator

body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
padding: 20px;
}
.calculator-box {
background-color: #fff;
border-radius: 10px;
padding: 20px;
max-width: 600px;
margin: auto;
box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
}
h2 {
text-align: center;
margin-bottom: 20px;
}
table {
width: 100%;
border-collapse: collapse;
}
td {
padding: 8px;
vertical-align: middle;
}
input {
width: 100%;
padding: 5px;
box-sizing: border-box;
}
button {
background-color: #28a745;
color: white;
padding: 10px;
width: 100%;
border: none;
border-radius: 5px;
margin-top: 15px;
font-size: 16px;
cursor: pointer;
}
button:hover {
background-color: #218838;
}
.output {
font-weight: bold;
color: #333;
}

Heat Sink & Temperature Rise Calculator

Power Dissipation (W)
Ambient Temperature (°C)
Junction Temperature (°C)
Thermal Resistance Junction to Case (°C/W)
Thermal Resistance Case to Heatsink (°C/W)
Thermal Resistance Heatsink to Ambient (°C/W)
Thermal Resistance Junction to Ambient (°C/W)

Results

Case Temperature (°C)
Heatsink Temperature (°C)
Junction Temperature (°C)

function calculate() {
let P = parseFloat(document.getElementById(“power”).value);
let Ta = parseFloat(document.getElementById(“ta”).value);
let Tj = parseFloat(document.getElementById(“tj”).value);
let Rjc = parseFloat(document.getElementById(“rjc”).value);
let Rch = parseFloat(document.getElementById(“rch”).value);
let Rha = parseFloat(document.getElementById(“rha”).value);
let Rja = parseFloat(document.getElementById(“rja”).value);

// Auto-fill Rja if not given
if (isNaN(Rja) && !isNaN(Rjc) && !isNaN(Rch) && !isNaN(Rha)) {
Rja = Rjc + Rch + Rha;
document.getElementById(“rja”).value = Rja.toFixed(2);
}

// Calculate missing value if exactly one is empty
let emptyFields = [];
if (isNaN(P)) emptyFields.push(“P”);
if (isNaN(Ta)) emptyFields.push(“Ta”);
if (isNaN(Tj)) emptyFields.push(“Tj”);
if (isNaN(Rjc)) emptyFields.push(“Rjc”);
if (isNaN(Rch)) emptyFields.push(“Rch”);
if (isNaN(Rha)) emptyFields.push(“Rha”);
if (isNaN(Rja)) emptyFields.push(“Rja”);

if (emptyFields.length === 1) {
let missing = emptyFields[0];
if (missing === “P” && !isNaN(Tj) && !isNaN(Ta) && !isNaN(Rja)) {
P = (Tj – Ta) / Rja;
document.getElementById(“power”).value = P.toFixed(2);
}
if (missing === “Tj” && !isNaN(P) && !isNaN(Ta) && !isNaN(Rja)) {
Tj = Ta + P * Rja;
document.getElementById(“tj”).value = Tj.toFixed(2);
}
if (missing === “Rja” && !isNaN(P) && !isNaN(Ta) && !isNaN(Tj)) {
Rja = (Tj – Ta) / P;
document.getElementById(“rja”).value = Rja.toFixed(2);
}
}

// Calculate intermediate temperatures
if (!isNaN(P) && !isNaN(Ta) && !isNaN(Rjc) && !isNaN(Rch) && !isNaN(Rha)) {
let Tc = Ta + P * (Rha + Rch);
let Th = Ta + P * Rha;
let Tj_calc = Tc + P * Rjc;

document.getElementById(“tc_out”).innerText = Tc.toFixed(2);
document.getElementById(“th_out”).innerText = Th.toFixed(2);
document.getElementById(“tj_out”).innerText = (!isNaN(Tj) ? Tj : Tj_calc).toFixed(2);
}
}

(adsbygoogle = window.adsbygoogle || []).push({});