Concrete Maturity Calculation Help | MATLAB IoT Analytics | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.

Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Concrete Maturity Calculation Help
No permission to create posts
August 2, 2020
12:16 pm
New Member
Forum Posts: 1
Member Since:
August 2, 2020
sp_UserOfflineSmall Offline

I am a Civil Engineer and has very limited knowledge about IOT.
I have set up a DS18B20 temperature sensor sending data to Thingspeak via a ESP8266 MCU.

The sensor is placed inside a concrete cube, measuring its setting temperature.

The measured temperature, lets call it Ta is to be used in the following equation.

M(t) = ∑ (Ta-Td) ∆t

Where M(t) – Maturity at age t (°C-Hrs)
Ta - Average Temperature in ° C
Td - Datum Temperature in ° C and is set to 0
∆t - Time Interval

As you can see Ta is the only measured data along with time interval between 2 readings (set to 30 minutes). I wish to create a MATLAB analysis wherein the measured temperature from the first channel is used to calculate M(t).
But I dont know how to code the above formula as it requires to add the calculated M(t) once every 30 minutes and tell the updated value.

I would greatly appreciate your help.

August 19, 2020
11:50 am

Forum Posts: 885
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

Set up the following MATLAB analysis

%read temp values from channel
myTimeTable = thingSpeakRead(channelID, 'ReadKey', ''READAPIKEY", 'outputFormat','Timetable', 'numMinutes',1000);

%I presume your average means average temperature over the local time segment, so just the temperature value written.
% If we need to average over several values, that can be done as well.
timeDurations = diff(myTimeTable.Timestamps)
sumElements = timeDurations * myTimeTable.TEMPERATUREFIELDNAME; %replace TEMPERATUREFIELDNAME with your temp field
total = sum(sumElements);

Total will then be in units of scaled durations - i.e. hours and minutes times temperature. There are MATLAB functions to convert it to seconds or whatever units you like.

Then set up a timecontrol to call this code at whatever interval you like.

then you can even add a ThingSpeakWrite at the end to write the output to another channel each time the calculation runs.

FYI MATLAB answers is the preferred location for ThingSpeak support.

September 4, 2020
9:14 am
New Member
Forum Posts: 1
Member Since:
September 4, 2020
sp_UserOfflineSmall Offline

Hello. Your advice helped me .thanks

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

bogart, estebanmateo93, mikewrite, onlinebusiness, winzy99, Zark_zeugan

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457