Ideal Straight Line Fit for a Temperature Sensor Output

  • Thread starter Fenrir
  • Start date
  • Tags
    Line
In summary: I'm not saying that you should have done that. I think that this is a simple example and your method is fine - except for the incorrect rounding. However, if you are expected to show your working, then you should present it in a neat way that makes sense to the reader.)In summary, we have data for temperature (in ºC) and the corresponding resistance of a temperature sensor. After calculating M and b for the linear regression, we can use the equation Mx + b to estimate the resistance for any given temperature. We also calculated the differences between the actual resistance and the predicted resistance (N) and found that there is some discrepancy, which may be due to measurement error or other factors. It would
  • #1
Fenrir
1
0
Homework Statement
I am doing a distance learning course and need to find the ideal straight line of a sensor output. The sensor is a temperature sensor with an OHM output.
From a temperature range of 0-250 it has an output of 120-364ohm.
0 = 120
50 = 178
00 = 201
150 = 249
200 = 303
250 = 364

I need to generate the ideal straight line equation and values.
Relevant Equations
y = Mx + b (Least squares)
X 0 50 100 150 200 250
Y 120 178 201 249 303 364
XY 0 8900 20100 37350 60600 91000
X^2 0 2500 10000 22500 40000 62500

∑X 750
∑Y 1415
∑XY 217950
∑X^2 137500

M = (6*217950)-(750*1415) / (6*137500) - (750)^2
M = 1643 / 1750
M = 0.9388571429
M = 0.94

b = 1415-0.94*750 / 6 = 118.333333
b = 118.33

Mx + b
0.94*0 + 118.33 = 118.33
0.94*50 +118.33 = 165.33
0.94*100 +118.33 = 212.33
0.94*150 +118.33 = 259.33
0.94*200 +118.33 = 306.33
0.94*250 +118.33 = 353.33

N = Resistance - ISL

120-118.33 = 1.67
178-165.33 = 12.67
201-212.33 = -11.33
249-259.33 = -10.33
303-306.33 = -3.33
364-353.33 = -10.67

Temp 0 50 100 150 200 250
Resistance 120 178 201 249 303 364
ISL 118.33 165.33 212.33 259.33 306.33 353.33
N 1.67 12.67 -11.33 -10.33 -3.33 10.67

I'm looking at my answers and i feel like i have gotten it wrong somewhere, is there a mistake in what i have done?
Rounding only done here to simplify.

Edited to correct ∑X^2
 
Physics news on Phys.org
  • #2
That looks ok. However, I would not have rounded M for the calculation of b.
 
  • Like
Likes Fenrir
  • #3
In addition to what @DrClaude said...

There is online software available, e.g. https://www.socscistatistics.com/tests/regression/default.aspx
You can compare your answer to that of the software.

Some other points:

Fenrir said:
... temperature sensor with an OHM output.
It's better to say that the output is the sensor's resistance. (The 'ohm' (##\Omega##) is the unit of resistance.)

Fenrir said:
From a temperature range of 0-250
Units are needed. For example, the temperature could be in units of ºC (degrees centigrade), ºF (degrees Farhenheit) or K (kelvin). Knowing the correct units is very important.

You may be expected to give M and b with their units.

Fenrir said:
0 = 120
.
250 = 364
It's not a good idea to write things like '0 = 120'. It's wrong. Ideally, use a table with suitable column headings.
 
  • Like
Likes Fenrir, Lnewqban and DrClaude

1. What is an ideal straight line fit for a temperature sensor output?

An ideal straight line fit for a temperature sensor output is a mathematical model that represents the relationship between the temperature readings from the sensor and the corresponding output values. It is a linear function that best fits the data points on a scatter plot, allowing for accurate predictions of the output value based on the temperature reading.

2. How is an ideal straight line fit calculated for a temperature sensor output?

An ideal straight line fit is calculated using a method called linear regression. This involves finding the slope and intercept of the line that minimizes the sum of the squared distances between the data points and the line. This can be done using statistical software or manually using mathematical equations.

3. Why is an ideal straight line fit important for temperature sensor data?

An ideal straight line fit is important because it allows for accurate and precise predictions of the output value based on the temperature reading. It also helps to identify any trends or patterns in the data, which can be useful for making informed decisions or adjustments.

4. What factors can affect the accuracy of an ideal straight line fit for a temperature sensor output?

The accuracy of an ideal straight line fit can be affected by several factors, including the quality and precision of the temperature sensor, the range of temperatures being measured, and the amount and variability of the data points used to calculate the fit. Other external factors such as environmental conditions or interference can also impact the accuracy of the fit.

5. Can an ideal straight line fit be used for any type of temperature sensor?

Yes, an ideal straight line fit can be used for any type of temperature sensor as long as the data follows a linear relationship. However, it is important to note that different sensors may have different levels of accuracy and precision, which can affect the accuracy of the fit. It is always recommended to calibrate the sensor and validate the fit using a known reference before relying on the predictions from the fit.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
4
Views
3K
  • Programming and Computer Science
Replies
14
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • Programming and Computer Science
Replies
9
Views
1K
Back
Top