Define the interval in which a single measurement must be using statistical analysis I designed a sensor which produces an output voltage which is linear to an input temperature. To test the sensor in production, the sensor is exposed to a known and controlled temperature. Assuming that the input test temperature is perfect, how can I determine the pass/fail range to use in production for all manufactured sensors based on statistical analysis of $N$ sensors?
At the moment, I have randomly measured the output voltage of $N=50$ sensors at a known temperature and calculated the mean and standard deviation based on this sample set. Next, I decided that the pass/fail range should be $\mu \pm 3\sigma$, where $\mu$ is the mean and $\sigma$ is the standard deviation, to account for $99.7\%$ of all cases.
I feel that my method is incorrect because I don't account for the sample size.
Does anyone know if I'm doing this correctly or should I be using a different method?
 A: The method that BruceET suggested seems very promising but the results I get is a little strange.
Here is an example of what I have:

*

*n  =  20

*S  = 0.015983

*/x = 0.5779

*t = 2.093024 (probability = 0.975, degrees of freedom = 20-1)

*calculated interval min value = 0.57042

*calculated interval max value = 0.58538

*interval (0.57042, 0.58538)

This feels strange because most of my raw sample data that produced the S and /x values are outside the calculated interval:

*

*0.586 (out)

*0.595 (out)

*0.585 (in)

*0.558 (out)

*0.583 (in)

*0.569 (out)

*0.564 (out)

*0.572 (in)

*0.592 (out)

*0.559 (out)

*0.562 (out)

*0.547 (out)

*0.560 (out)

*0.594 (out)

*0.588 (out)

*0.599 (out)

*0.575 (in)

*0.587 (out)

*0.605 (out)

*0.578 (in)

I must be doing something wrong or I'm just not understanding something.
A: The range of allowable values for a sensor to 'pass' may be
determined by a number of considerations or constraints that
have nothing to do with your sample.
You can make a 95% confidence interval for the true voltage
during your experiment based on $n = 50$ observations:
$$\bar X \pm t^*S/\sqrt{50},$$
where $\bar X$ is the average (sample mean) of fifty, $S$ is the sample standard deviation, and $t^* \approx 2.0$ cuts probability $0.025 = 2.5\%$ from the upper tail of Student's t distribution with
$n-1=49$ degrees of freedom (a symmetrical distribution). You can get the value of $t^*$ from printed tables of Student t distributions or from software (e.g., R) as shown below.
qt(.975, 49)
[1] 2.009575

In particular, if your sample is as the one below (simulated in R),
then the 95% CI is $(111.7, 112.3).$
set.seed(918)
x = rnorm(50, 112, 1)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
  109.4   111.3   112.0   112.0   112.5   114.7 
[1] 1.110945  # sample SD

t.test(x)$conf.int
[1] 111.6581 112.2896
attr(,"conf.level")
[1] 0.95

However, independently of your experiment, people buying your sensor may want to feel sure that
voltages near 112 measured in the conditions you specify
should be accurate within $\pm 0.1.$
