Is this DS1603LV1.0 sensor bad? Or am I bad?

As I said originally I found sorting the easiest method. I wasn't in C so my code would be useless to you.
But...

Create an array of int 16 chars long (a few more than you plan to sample)

In a for loop
collect 15 samples

Then use a sort routine. Google Arduino sort array and you will find many options.

In another loop add the array numbers array[10] + array[11].....array[14]
then divide by 5 and you have a pretty solid value. This step basically ignores the highest 5 and the lowest 5 samples. Hopefully throwing out the "bad" samples.

1 Like