The pipe clip temperature sensors shown here are robust sens
The pipe clip temperature sensors shown here are robust sensors that can be clipped directly onto copper pipes to measure the temperature of the liquids in the pipes. Each sensor contains a device called a thermistor. Thermistors are semiconductor devices that exhibit a temperature-dependent resistance described by: R = R_0 e beta (1/T - 1/T_0) where R is the resistance (in ohm) at the temperature T (in degree K), and R_0 is the resistance (in ohm) at the temperature T_0 (in degree K). beta is a constant that depends on the material used to make the thermistor. Thermistors are specified by providing values for R_0, T_0, and beta. The thermistors used to make the pipe clip temperature sensors have R_0 = 1075 ohm at T_0 = 85 degree C, and beta = 3969 degree K. (Notice that beta has units of degree K. Recall that the temperature in degree K is obtained by adding 273 to the temperature in degree C.) The liquid temperature, in degree C, is determined from the resistance R, in ohm, using T = beta T_0/T_0 ln (R/R_0) + beta Write a Java program that prompts the user for the thermistor resistance R and prints a message giving the liquid temperature in degree C.
Solution
import java.util.Scanner;
public class Thermistance {
public static void main(String[] args) {
final int B=85;
final int T=3696;
final int R1=1075;
System.out.print(\"T= (BT/(T ln(R/R1) + B)) -273\ \");
System.out.print(\"Please Enter the value for R (Thermal Resitance):\");
Scanner scanner=new Scanner(System.in);
int R=scanner.nextInt();
double firstOne= (B*T)/((T * Math.log(R/R1))+B);
double result=firstOne-273;
System.out.println(\"Liquid Temparature in Celsius: \"+result);
}
}
