## Reading the continuously changing temperature

24 posts / 0 new
Author
Message

I already display the temperature with Arduino Uno

Temperature has a fluctuation

1.  I need to display this minimum and maximum level of this period

2.  I need to display minimum fluctuation period of time (steady state period)

## Attachment(s):

This topic has a solution.
Last Edited: Fri. Jun 24, 2022 - 11:24 PM

Glamo wrote:

Unclear. We all witness daily period (the most famous one), so this period of yours: what it is for, please.

Do you have any reference to clarify terms, please.

Do you have any hard limits for what determines "Your Steady State" ? For example: (ΔT < 1°C) for minimum of 1min.

You should think clearly about this because otherwise you may get false results generated by small amounts of noise.

of this period

What are you talking about?  The temp you show is not periodic (does not repeat)

Are you not paying attention to what you write?

You need to start over with your explanations and why you need this.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

avrcandies wrote:

Are you not paying attention to what you write?...

Why so rude?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

N.Winterbottom wrote:

Do you have any hard limits for what determines "Your Steady State" ? For example: (ΔT < 1°C) for minimum of 1min.

You should think clearly about this because otherwise you may get false results generated by small amounts of noise.

Thank you very much.

I have no hard limits. I need to find it.

All this started by you specifying the limit for what you consider "steady". Only you can do that based on your knowledge of how the temperature fluctuates. Maybe we're talking about a furnace that varies 20C to 1500C and it can jump 17C in one 5 second period? In that case +/- 1 may not be appropriate and, equally, 5 seconds between readings may not be appropriate.

So you "specify" , then you "design", maybe running the same kind of "thought experiment" as I just did and when you finally have a clear view and plan for what needs to be achieved and how you'll do it you can start writing program code.

Brian Fairchild wrote:

avrcandies wrote:

Are you not paying attention to what you write?...

Why so rude?

Thank you

Brian Fairchild wrote:

avrcandies wrote:

Why so rude?

+1

We've been here before.

The simple rule is that we are only here to help, so only post something if it actually helps the OP towards their goal.

We were all beginners once and we all had to learn.

of this period

What are you talking about?  The temp you show is not periodic (does not repeat)

This response makes complete sense since the signal is not periodic, so what are you talking about asking about the min and max of the period?

This response makes complete sense since the graph does not appear to be steady state, so what are you talking about?

It appears OP needs to start over with some more sensible or detailed explanations that actually match what he is showing

There was nothing rude asking him how he inferred these things from the graph.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Jun 26, 2022 - 03:23 PM

clawson wrote:
stable

Thank you very much Clawson.

First off all English is not my native language.

I'm sorry for using "steady state" term.

I may say "lowest fluctiation" .

Temperature maximum level is 500°C.

Fluctiation may vary 5°C to 50°C. I need to find time duration for minimum fluctuation. Also need to find the minimum and maximum temperature at that time period.

Fluctiation may vary 5°C to 50°C. I need to find time duration for minimum fluctuation. Also need to find the minimum and maximum temperature at that time period.

Well, what you are now talking about already makes much more sense, however it is a tricky problem, since a min fluctuation must be evaluated over a non-stop rolling set of data.  You need to record the  maximum min and the minimum max and each of their times in a continual sense.  Time to dwell a bit to think of clever ways.

Also, why do you need this--a rather odd thing to look for?

display the temperature with Arduino Uno

Ok, fine, but then your graph mentions at the end of time...what are you talking about since there is no ending (or do the temperature readings stop)?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Fri. Jun 24, 2022 - 08:09 PM

If those fluctuations in your graph are really 5°C to 50°C then perhaps you are sub-sampling the temperature. Look - every single data point is a point-of-infection.

dT

Ie.   --  Changes sign at every data point.

dt

Can you post a small table of actual readings worthy of analysis ?

inflection... btw. temperature is not a monotone function, thus: more fun.

Note also that

You need to record the A) maximum min and the B) minimum max and each of their times in a continual sense.

You also need some type of state machine or state progression logic, since these items (A & B) need to be seen "together" in one cycle & not separated into different parts of the wave.

you could prob have some logic to find the max or min (whichever is encountered first)  using a "typical" implementation followed by finding the opposite half

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

avrcandies wrote:

Fluctiation may vary 5°C to 50°C. I need to find time duration for minimum fluctuation. Also need to find the minimum and maximum temperature at that time period.

Well, what you are now talking about already makes much more sense, however it is a tricky problem, since a min fluctuation must be evaluated over a non-stop rolling set of data.  You need to record the  maximum min and the minimum max and each of their times in a continual sense.  Time to dwell a bit to think of clever ways.

Also, why do you need this--a rather odd thing to look for?

display the temperature with Arduino Uno

Ok, fine, but then your graph mentions at the end of time...what are you talking about since there is no ending (or do the temperature readings stop)?

Thank you Avrcandies,

"At the end of time= 10 second

This reply has been marked as the solution.

So start at the beginning:

• Find the first min or max peak (which can be tricky, but you will choose some common method)   ,also record the time (datapoint)
• Find the next corresponding opposite (max or min), also record the time (datapoint)
• Now take the absolute (positive) difference between these two points height, this is the delta.
• If delta is larger than the current champion pair, delta, ignore these points.
• If smaller, then put these points (and times) in the champion storage.
• Continue on with the previous steps, until looked at all data
• Crown the champion pair.  The time period is the difference in their time values

You can also do this with nonstop streaming data, though it is somewhat more challenging to keep track of everything.  Part of the trouble is you might still consider the champion from one hour ago  to be the current champion, when you really desire to forget about him and find a more recent one.

You might think that you could just look at the time & if the current champ is more than 10 seconds old, clear him out.  However, that is not quite right since the newer champ might have occurred 7 seconds ago and you overlooked him (he wasn't winning) since you are only now clearing out the old winner and the 7 sec winner has already gone home.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

avrcandies wrote:

So start at the beginning:

• Find the first min or max peak (which can be tricky, but you will choose some common method)   ,also record the time (datapoint)
• Find the next corresponding opposite (max or min), also record the time (datapoint)
• Now take the absolute (positive) difference between these two points height, this is the delta.
• If delta is larger than the current champion pair, delta, ignore these points.
• If smaller, then put these points (and times) in the champion storage.
• Continue on with the previous steps, until looked at all data
• Crown the champion pair.  The time period is the difference in their time values

You can also do this with nonstop streaming data, though it is somewhat more challenging to keep track of everything.  Part of the trouble is you might still consider the champion from one hour ago  to be the current champion, when you really desire to forget about him and find a more recent one.

You might think that you could just look at the time & if the current champ is more than 10 seconds old, clear him out.  However, that is not quite right since the newer champ might have occurred 7 seconds ago and you overlooked him (he wasn't winning) since you are only now clearing out the old winner and the 7 sec winner has already gone home.

Thanks again Avrcandies ,it is 01a.m.I will write tomorrow

If you have streaming, nonstop data, you can form a 10  second in-out buffer (always contains the last 10 sec of data), then rerun the entire method over and over, each second (or whenever you get a new sample). That is sort of brute force, since you are redoing a lot of the same work (finding peaks) in an overlapping sense.  With more complicated arrangement, it could prob be done with less waste.

BEWARE: this suggestion and the earlier one may be fooled by chopping off old and incoming data.  You must never treat the oldest or newest data point as a peak (min or max) it must be preceded or followed by a data point the is not at the peak...for example, say the data just barely started to rise from 1 then got cut off at 3 by the ending.  It may look like a small delta of 2, but in fact was actually still rising up to 8, but got cut off. So it may not be proper to say it was the smallest change, it just never had time to finish changing.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Beware, all that should be in a stationary state, otherwise you may have monotone situations as in my pictures.

Good luck, and good logic!

Edit: For lowest fluctuation of yours, choose time period in seconds, and in one period do average.

Calculate Delta T = abs (Tpeak - Taverage) ), the period with the smallest Delta T is a winner.

Last Edited: Sat. Jun 25, 2022 - 07:21 AM

N.Winterbottom wrote:
Can you post a small table of actual readings worthy of analysis ?

1. Do generate some repeatable test data and run your trial algorithm on that instead of live data. You'll detect and fix bugs; far, far, quicker that way.
2. Write the algorithm on the PC instead of AVR. Again; you'll detect and fix bugs; far, far, quicker that way.

avrcandies wrote:

If you have streaming, nonstop data, you can form a 10  second in-out buffer (always contains the last 10 sec of data), then rerun the entire method over and over, each second (or whenever you get a new sample). That is sort of brute force, since you are redoing a lot of the same work (finding peaks) in an overlapping sense.  With more complicated arrangement, it could prob be done with less waste.

BEWARE: this suggestion and the earlier one may be fooled by chopping off old and incoming data.  You must never treat the oldest or newest data point as a peak (min or max) it must be preceded or followed by a data point the is not at the peak...for example, say the data just barely started to rise from 1 then got cut off at 3 by the ending.  It may look like a small delta of 2, but in fact was actually still rising up to 8, but got cut off. So it may not be proper to say it was the smallest change, it just never had time to finish changing.

Thank you again Avrcandies,

You say "With more complicated arrangement, it could prob be done with less waste." Please explain, do you have any I idea about complicated arrangement.

And you say "BEWARE..." I think this may key point also. Mentioned data must be settle down to "our" reasonable level within 5 seconds approx. if not, say, within 10sec, means operation is faulty.

I understand "grohote's" "Delta T", I have the same. Maybe I'm a little hasty, but I would appreciate it if you help with the code

I am late to the party... is this a furnace controller which switches power to the heater at optimum timing to reduce temperature variations?

Ross McKenzie, Melbourne Australia