Had a bit of a search but no result. As I think many would know the output of a 3185 module jumps about a bit, mine will be +- 1 when reading the temperature as an integer. I was wondering if anyone had found a way? I've tried averaging etc with no luck. I have the thermocouple wire shielded and earthed and a cap across the output of the thermocouple.
Have you tried it with luck?
If you want more useful answers, please read the forum guide in the sticky post.
Well "Snarky" I don't need! I think that was a valid question, not needing code or whatever to answer.
Averaging the values does work, as can various other methods.
What you have done, only you know.
If you are serious about wanting help, read the forum guide and follow it.
Take us on the journey you have been on, show us the circuits, the code and the results.
Hi, @dablakus
Welcome to the forum.
This may help;
https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum
Can you please post your code?
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Can you please post a link to specs/data of the 3185 module?
Tom....
![]()
Did you try a first-order low-pass filter?
filteredValue = a*filteredValue + (1 - a)*lastReading;
The constant a should be between 0 and 1, and determines how much smoothing is produced — the closer the value of a is to 1, the more slowly filteredValue will change in response to new measurement values (lastReading).
Thanks, I'll give that a whirl and see how it goes.
Cheers ... Da B
That has fixed the display, thanks for your interest ![]()
@dablakus Glad to hear you got it working. To mark this topic as solved, and to help other forum readers to find the solution, please click the "Solution"
checkbox below the comment that solved your problem.
it may also be helpful if you shared what value of the parameter a worked best for you.
Yes that one, the wires are shielded and grounded, output has decoupling cap etc. Thanks for your interest, it has been solved now.
I have searched about but cannot find the instructions on how to post the code, can you point me that way please?
Besides the given formula one could use a running median.
The advantage of using the runningMedian is that outliers are ignored, where averaging is affected by outliers. Choosing the window size determines how much outliers it can handle.
E.g. If there is a bit error and the temperature (assume 16 bit) suddenly adds or subtracts 512 (only one bit flipped) the average probably jumps up / down and it takes a while to "recover".
Second advantage is that the runningMedian always returns actual measured values, not interpolated ones. For some types of measurements this can be important.
Drawback is that runningMedian takes far more processor cycles so it is relative slow.
Would running median be the same as trimmed mean?
Not familiar with trimmed mean, do you have a link?
found this one
Would running median be the same as trimmed mean ?
So yes, same idea, sort the measurements and exclude outliers,
then take median / average of remaining data
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
