data analytics – Internet of Things https://blogs.mathworks.com/iot Hans Scharler is an Internet of Things pioneer. He writes about IoT and ThingSpeak IoT platform features. Tue, 31 Mar 2026 22:00:12 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 Top ThingSpeak IoT Questions from Google https://blogs.mathworks.com/iot/2021/05/07/top-thingspeak-iot-questions-from-google/?s_tid=feedtopost https://blogs.mathworks.com/iot/2021/05/07/top-thingspeak-iot-questions-from-google/#comments Fri, 07 May 2021 16:36:37 +0000 https://blogs.mathworks.com/iot/?p=2806

We were searching around for ThingSpeak IoT resources and noticed that Google was sharing the top questions related to ThingSpeak. Christopher Stapels and I thought that it would be fun to answer... read more >>

]]>
We were searching around for ThingSpeak IoT resources and noticed that Google was sharing the top questions related to ThingSpeak. Christopher Stapels and I thought that it would be fun to answer them and share them as a blog post. So, here we are.

How do you use ThingSpeak?

Some people use ThingSpeak for monitoring machine processes. This allows them to share the data with potential customers and ensure the process is within control. There are over a million ThingSpeak channels representing a vast assortment of projects.  Some projects measure the temperature and humidity in one room, some projects include a global network of air quality monitors. You can send data to ThingSpeak from your devices, create instant visualization of live data, and send alerts.

What type of data is accepted by ThingSpeak?

ThingSpeak accepts strings, integers, decimal degrees, and any encoded data. ThingSpeak stores data as strings of up to 255 characters per field. ThingSpeak organizes data by channels, where a channel represents data from a given device or process. Each channel contains eight data fields, three fields for location: latitude, longitude, and elevation, and one extra field for a status report.  If you write a number into a field (integer or float), ThingSpeak will display the numbers in field charts on your channel view.

Is ThingSpeak free?

Yes, for non-commercial use. ThingSpeak has different license types for different intended uses. The free license has some restrictions. Purchasing a paid license allows a faster update rate and the creation of additional channels.  For more info, see How to Buy and the ThingSpeak FAQ.

How do you collect data from ThingSpeak?

Once your data is stored in ThingSpeak, you can retrieve your data from ThingSpeak from MATLAB, a REST API, or MQTT API.

Many devices can take advantage of the ThingSpeak library for Arduino and Particle devices. You can use the address bar in your web browser to test updating a channel via the REST API.

Use this format to update your field.

https://api.thingspeak.com/update?api_key=<YOUR_API KEY>&field1=<YOUR_VALUE>

If you have any questions for Christopher, myself, or the rest of the community, ask them at the ThingSpeak Community site.

]]>
https://blogs.mathworks.com/iot/2021/05/07/top-thingspeak-iot-questions-from-google/feed/ 5
Explore ThingSpeak IoT Data Using a MATLAB App https://blogs.mathworks.com/iot/2020/09/21/explore-thingspeak-iot-data-using-a-matlab-app/?s_tid=feedtopost https://blogs.mathworks.com/iot/2020/09/21/explore-thingspeak-iot-data-using-a-matlab-app/#respond Mon, 21 Sep 2020 16:19:30 +0000 https://blogs.mathworks.com/iot/?p=2737

ThingSpeak users frequently ask how to build customized views for their ThingSpeak data. The channel view provides automatically generated field plots that are customizable with the ThingSpeak Charts... read more >>

]]>
ThingSpeak users frequently ask how to build customized views for their ThingSpeak data. The channel view provides automatically generated field plots that are customizable with the ThingSpeak Charts API or a MATLAB visualization. You might want to run prepackaged analysis repeatedly or based on a variable you can set. You might want to view data from multiple channels, or view channels depending on a condition. For example, you could show the channels for all devices that have a measurement higher than a given threshold.

Christopher Stapels, the ThingSpeak Product Manager, built an IoT data explorer app for MATLAB. The app is available for download on File Exchange or GitHub to help you explore your ThingSpeak data.

The ThingSpeak and MATLAB integration makes MATLAB the best environment for building a tool to analyze your ThingSpeak data. The IoT Data Explorer App is straightforward to use, to answer some questions about your data, and to customize for your own purposes. Chrisopher also created a video to help you get started with the IoT Data Explorer App for MATLAB.

If you have some ideas for improvements to the app, leave your comments here. We are already thinking of new features such as using the user API key to prepopulate the channel ID boxes automatically.

Download the IoT Data Explorer App for MATLAB from File Exchange or GitHub.

]]>
https://blogs.mathworks.com/iot/2020/09/21/explore-thingspeak-iot-data-using-a-matlab-app/feed/ 0
Collect and Visualize Agricultural Data using The Things Network and ThingSpeak https://blogs.mathworks.com/iot/2019/10/17/collect-and-visualize-agricultural-data/?s_tid=feedtopost https://blogs.mathworks.com/iot/2019/10/17/collect-and-visualize-agricultural-data/#comments Thu, 17 Oct 2019 19:19:13 +0000 https://blogs.mathworks.com/iot/?p=2670

Long-range wireless communication technology enables the transfer of sensor data over a long distance while using low-power radios for connectivity. This technology can be leveraged to connect... read more >>

]]>
Long-range wireless communication technology enables the transfer of sensor data over a long distance while using low-power radios for connectivity. This technology can be leveraged to connect sensors covering a large geographic area and give you insights into what is happening. With agricultural applications it is important to measure the soil moisture and efficiently irrigate. A big challenge for agricultural applications is robust connectivity in remote locations. By using a combination of The Things Network and ThingSpeak insightful applications can be built. The Things Network is a protocol and infrastructure that provides a link to cloud applications using LoRaWAN® technology. If you are already a The Things Network user, check out the documentation about the ThingSpeak integration at The Things Network. ThingSpeak is an IoT analytics platform service that allows you to aggregate, visualize, and analyze live data streams in the cloud using MATLAB®. You can send data to ThingSpeak from devices via The Things Network, create instant visualization of live data, and send alerts.

The ThingSpeak team has created a new example that shows you how to leverage The Things Network and build an agricultural data application using ThingSpeak. The sensors send data to The Things Network, which is then forwarded to ThingSpeak for collection, analysis, and visualization. Here’s what the project view on ThingSpeak looks like.

To build a soil moisture sensor device for The Things Network, you need use an Adafruit Feather M0 RFM95 LoRa Radio (900MHz), an Adafruit Ultimate GPS FeatherWing, a SparkFun Soil Moisture Sensor, and a DHT22 temperature and humidity sensor. Once you have the device put together and programmed, you can use this device to measure soil moisture, temperature, humidity, and its location.

Check out the full Collect Agricultural Data over The Things Network example at the MathWorks Documentation site.

]]>
https://blogs.mathworks.com/iot/2019/10/17/collect-and-visualize-agricultural-data/feed/ 2
Analyze and Visualize Air Quality Data with MATLAB https://blogs.mathworks.com/iot/2019/07/16/analyze-and-visualize-air-quality-data-with-matlab/?s_tid=feedtopost https://blogs.mathworks.com/iot/2019/07/16/analyze-and-visualize-air-quality-data-with-matlab/#comments Tue, 16 Jul 2019 20:08:36 +0000 https://blogs.mathworks.com/iot/?p=2638

Have you ever wondered if the air around you is healthy? It is possible to understand air quality by using MATLAB to analyze air quality data collected by an air quality sensor on  ThingSpeak. What... read more >>

]]>
Have you ever wondered if the air around you is healthy? It is possible to understand air quality by using MATLAB to analyze air quality data collected by an air quality sensor on  ThingSpeak.

What is “healthy” air quality?

Good or moderate air quality is when the Air Quality Index (AQI) is 100 or less. AQI is a relative measurement of five common air pollutants: ground-level ozone, particle pollution, carbon monoxide, sulfur dioxide, and nitrogen dioxide. A high AQI indicates a higher level of pollution and is considered unhealthy over 100.

Air Quality Sensors

We have installed a PurpleAir sensor at the MathWorks Apple Hill campus in Natick, MA. PurpleAir sensors use laser particle counters that provide an accurate and low-cost way to measure smoke, dust, and other particulate in the air. The data from our air quality sensor is available on a public ThingSpeak channel.

PurpleAir produces an interactive map using the air quality data from their sensors deployed around the world. Among other applications, the data is used by researchers to understand the effects of forest fires on air quality.

Air Quality Analysis using MATLAB

On File Exchange, we have posted our MATLAB functions used to analyze the air quality data collected by ThingSpeak. The MATLAB code helps preprocess the sensor data, provides functions to classify the data, and provides functions for visualizing the processed air quality data. The MATLAB visualizations are added to a ThingSpeak channel dashboard so you can see the current air quality near you. The MATLAB analysis code calculates the AQI using the definitions from the United States Environmental Protection Agency (EPA).

You can build a data analysis dashboard on ThingSpeak using publicly available data and MATLAB. This project it makes it easy to explore IoT data analysis using MATLAB to preprocess and visualize data without having IoT hardware.

Download the code from File Exchange and follow along with our video tutorial.

]]>
https://blogs.mathworks.com/iot/2019/07/16/analyze-and-visualize-air-quality-data-with-matlab/feed/ 11
Deep Learning and IoT at University of Louisiana at Lafayette Science Day https://blogs.mathworks.com/iot/2018/12/07/deep-learning-and-iot-at-university-of-louisiana-at-lafayette-science-day/?s_tid=feedtopost https://blogs.mathworks.com/iot/2018/12/07/deep-learning-and-iot-at-university-of-louisiana-at-lafayette-science-day/#comments Fri, 07 Dec 2018 16:10:53 +0000 https://blogs.mathworks.com/iot/?p=2552

This is a guest post by Diamond Blackwell, ACM-W President at the University of Louisiana at Lafayette. On Friday, October 26, 2018, the University of Louisiana at Lafayette opened its doors to over... read more >>

]]>
This is a guest post by Diamond Blackwell, ACM-W President at the University of Louisiana at Lafayette.

On Friday, October 26, 2018, the University of Louisiana at Lafayette opened its doors to over 900 students participating in Science Day. This is a campus-wide event where high school students throughout Louisiana come to visit university’s various science departments. Our department, the College of Computing and Informatics, put on four demos for students to partake in.

The Association of Computing Machinery – Women (ACM-W) club, an organization dedicated to increasing the number of women in tech, decided we should do something different than the previous year for our demo. Our organization’s advisor, Dr. Sonya Hsu, gave us the idea to try a Deep Learning and IoT, Internet of Things demo presented at Grace Hopper Celebration of Women in Computing this past September by the team from MathWorks. With the help from the MathWorks GHC team and colleagues, we were able to put on this spectacular demo at the Science Day at the University of Louisiana. You can read about the GHC 18 Deep Learning and IoT workshop here on this blog.

We gathered all of the required tips from Anoush Najarian of MathWorks, configured all of our laptops, and put together an informal and interactive presentation. And we had our students very entertained! They really enjoyed taking photos of the fruit (and sometimes themselves) in order to see how and which objects were classified. Students kept taking photos until their fruit was correctly labeled, seeing how holding the object in a certain position or light would affect the MATLAB program’s answer.

We did notice that with smaller groups, it was easier to help everyone and keep control of the room. This made the demonstrations and feedback sessions a lot more educational: in larger groups, most people could not get most of their questions answered in the allotted time. But, the interactive segment of the demo did make up for it.

Meanwhile, the MathWorks team in Boston could keep up with what we’re doing by looking at the data collected on ThingSpeak and analyzing it with MATLAB – that’s IoT in action!

This was an amazing outreach opportunity for our organization that could not have been executed without the help of the MathWorks team! The positive feedback and help really made this an enjoyable experience for my team, and we hope to partner with MathWorks in the future.

You too are welcome to use our GHC 18 Deep Learning and IoT workshop materials, and share your thoughts in the comments! Check out the work of awesome women in engineering and science we have been highlighting with the #shelovesmatlab hashtag!

]]>
https://blogs.mathworks.com/iot/2018/12/07/deep-learning-and-iot-at-university-of-louisiana-at-lafayette-science-day/feed/ 2
Deep Learning and IoT Workshop at GHC 18, Grace Hopper Celebration of Women in Computing https://blogs.mathworks.com/iot/2018/11/15/deep-learning-and-iot-workshop-at-ghc/?s_tid=feedtopost https://blogs.mathworks.com/iot/2018/11/15/deep-learning-and-iot-workshop-at-ghc/#comments Thu, 15 Nov 2018 21:04:31 +0000 https://blogs.mathworks.com/iot/?p=2522

Dear friends, we: Louvere Walker-Hannon, an application engineer who assists customers doing deep learning and data analytics, Shruti Karulkar, a quality engineering lead for test and measurement,... read more >>

]]>
Dear friends, we: Louvere Walker-Hannon, an application engineer who assists customers doing deep learning and data analytics, Shruti Karulkar, a quality engineering lead for test and measurement, and Anoush Najarian, a performance engineer, put together this blog post on behalf of the MathWorks GHC team.

Our team had an awesome time at GHC 18, Grace Hopper Celebration of Women in Computing. Going to the conference helped our team members get to know each other, and brought out superpowers we didn’t know existed!

This is our first year as a sponsor of the conference.Grace Hopper Celebration is the world’s largest gathering of women technologists. Besides recruiting and attending key technology talks, our team delivered a hands-on MATLAB workshop on Deep Learning and IoT.

The workshop

We were thrilled to have a hands-on workshop proposal accepted at GHC, an honor and a responsibility. It turned out that we were going to be running two large sessions, full in preregistration.

We asked everyone to bring a laptop with a webcam, or share. Participants used their browser to run deep learning code in MATLAB Online, a cool framework built on top of cloud instances, and aggregated inference data to ThingSpeak, an open IoT (Internet of Things) platform, and analyzed that data.

Fruit caper

Everyone captured images of real-world objects using webcams and used a Deep Learning network to classify them. To make things more fun, we used fruit for inference: Granny Smith apples, oranges, lemons and bananas. Our team went on a “fruitcase” expedition: we visited a local grocery store with a suitcase, bought a bunch of fruit for the workshop, and at the end of the day, gave it away to the many amazing GHC workers.

Exercises

Our workshop had three exercises, and two take-home problems.

In our first exercise, we used a webcam to capture an image, and passed it along to the AlexNet Deep Learning network for inference, generating a classification label and a confidence score.

% This is code for Exercise 1 as part of the Hands on with Deep Learning
% and IoT workshop presented at the Grace Hopper Celebration 2018-09-27
%% Connecting to the camera
camera = webcam(1); % Connect to the camera
%% Loading the neural net named: Alexnet
nnet = alexnet; % Load the neural net
%% Capturing and classifying image data
picture = snapshot(camera); % Take a picture
picture = imresize(picture, [227, 227]); % Resize the picture
[label, scores] = classify(nnet, picture); % Classify the picture and 
% obtain confidence score
[sorted_scores, ~]=sort(scores, 'descend'); % Sorting scores in 
% descending order
image(picture); % Show the picture
title(['Alexnet classification: ', char(label), ' score:', ...
    num2str(sorted_scores(1))]); % Show the label
clear camera
drawnow;

In our second exercise, we repeat what we did in Exercise 1, and post inference data to an IoT channel. Note that we use the same channel to aggregate everyone’s data.

% This is code for Exercise 2 as part of the Hands on with Deep Learning
% and IoT workshop presented at the Grace Hopper Celebration 2018-09-27
%% Connecting to the camera
camera = webcam(1); % Connect to the camera
%% Loading the neural net named: Alexnet
nnet = alexnet; % Load the neural net
%% Capturing and classifying image data
picture = snapshot(camera); % Take a picture
picture = imresize(picture, [227, 227]); % Resize the picture
[label, scores] = classify(nnet, picture); % Classify the picture and
% obtain confidence score
[sorted_scores, ~]=sort(scores, 'descend'); % Sorting scores in
% descending order
image(picture); % Show the picture
title(['Alexnet classification: ', char(label), ' score:', ...
    num2str(sorted_scores(1))]); % Show the label
clear camera
drawnow;
%% Aggregating label data to open IoT platform
try
    thingSpeakWrite(123456789, string(label), 'WriteKey', 'XXXYYYZZZ')
catch
    pause(randi(5))
end

In our third exercise, we grabbed the aggregated inference data from the IoT channel and visualized it. It was fun and a bit surprising to see what everyone’s objects ended up getting classified as.

% This is code for Exercise 3 as part of the Hands on with Deep Learning
% and IoT workshop presented at the Grace Hopper Celebration 2018-09-27
%% Reading aggregated label data for the last 2 hours from ThingSpeak
readChannelID = 570969;
LabelFieldID = 1;
readAPIKey = '';
dataForLastHours = thingSpeakRead(readChannelID, ...
    'Fields', LabelFieldID, 'NumMinutes', 5, ...
    'ReadKey', readAPIKey, 'OutputFormat', 'table');
%% Visualizing data using a histogram
if (not(isempty(dataForLastHours)))
    labelsForLastHours = categorical(dataForLastHours.Label);
    numbins = min(numel(unique(labelsForLastHours)), 20);
    histogram(labelsForLastHours, 'DisplayOrder', 'descend', ...
        'NumDisplayBins', numbins);
    xlabel('Objects Detected');
    ylabel('Number of times detected');
    title('Histogram: Objects Detected by Deep Learning Network');
    set(gca, 'FontSize', 10)
end
drawnow

When our participants ran this code, we saw a histogram aggregating everyone’s inference data, with all the objects detected during the workshop. This is the power of IoT! Check out the data from all our workshop sessions aggregated together on the ThingSpeak channel.

As take-home exercises, we challenged participants to use GoogLeNet instead of AlexNet, and to create their own IoT channel and use it to post and analyze data.

Feedback

It’s an honor to have a speaking proposal accepted at GHC, and delivering large hands-on sessions is a big responsibility.

We loved hearing from our participants on social media:

We heard from professors and AI and Deep Learning enthusiasts who are interested in using our materials on campuses and at maker events: below are the first two, and a few others are in the works! If you’d like to give our Deep Learning and IoT demo a shot, let us know in the comments.

Hope Rubin of our GHC team led STEM Ambassadors who brought this Deep Learning and IoT demo to the Boston Mini-Maker Faire.

Under the leadership of brave Professor Sonya Hsu and her ACM-W partners, a team ran the workshop during the Science Day at the University of Louisiana at Lafayette. Look for posts on these events on this blog!

Thank you

We couldn’t have done this without our team members’ extensive experience with teaching and tech, the awesome guidance by our senior leaders, and the help from hundreds of MathWorkers and Boston SWE friends.

Boston SWE, Society of Women Engineers, one of the oldest and largest sections in the country, has been our rock! We ran our workshop to a SWE event at MathWorks the week before GHC, getting our code and materials in front of many inquisitive, engaged participants who gave us their time, their words of encouragement, and who asked us tough questions!

Next steps

You too are welcome to use our GHC 18 Deep Learning and IoT workshop materials!

Want to learn more? Take the free Deep Learning Onramp! Learn about and build IoT projects.

Visit our GHC page to meet our team and learn about working at MathWorks. Take a look at the photos our team took, or was given by session chairs, and our Twitter Moment. While you’re at it, check out the work of awesome women we have been highlighting with #shelovesmatlab hashtag! Share your thoughts in the comments.

]]>
https://blogs.mathworks.com/iot/2018/11/15/deep-learning-and-iot-workshop-at-ghc/feed/ 1
Libelium Now Supports ThingSpeak with MATLAB enabled IoT Analytics https://blogs.mathworks.com/iot/2018/10/05/libelium-now-supports-thingspeak-with-matlab-enabled-iot-analytics/?s_tid=feedtopost https://blogs.mathworks.com/iot/2018/10/05/libelium-now-supports-thingspeak-with-matlab-enabled-iot-analytics/#respond Fri, 05 Oct 2018 18:07:34 +0000 https://blogs.mathworks.com/iot/?p=2489

Libelium makes the Meshlium IoT Gateway that supports commercial IoT systems and sensor applications such as waste management, forest fire detection, potable water monitoring, supply chain... read more >>

]]>
Libelium makes the Meshlium IoT Gateway that supports commercial IoT systems and sensor applications such as waste management, forest fire detection, potable water monitoring, supply chain control, and fleet tracking. Libelium now supports ThingSpeak, so that you can take IoT applications to the next level by using ThingSpeak’s integrated MATLAB enabled IoT analytics and visualizations.

ThingSpeak is a MATLAB enabled IoT analytics platform from MathWorks, the leading developer of technical computing software for engineers and scientists. With ThingSpeak, users can view instant visualizations of live data from any Internet-connected web browser and schedule MATLAB code to run live analyses and visualizations as new data arrives. To accelerate the development of IoT analytics, MATLAB offers a full set of statistics and machine learning functionality, plus advanced methods such as nonlinear optimization, system identification, and thousands of prebuilt algorithms for signal and image processing.

Libelium sensors are used in a variety of vertical IoT applications like air quality monitoring and smart agriculture that are also common applications for users of the ThingSpeak platform. “The new integration between the Meshlium IoT Gateway and ThingSpeak will allow our customers with mutual interests to quickly analyze their data in the cloud with MATLAB,” said Eric Wetjen, Senior Product Marketing Manager for ThingSpeak.

The ThingSpeak integration allows you to easily connect your Libelium devices to the ThingSpeak IoT analytics platform by using the ThingSpeak cloud connector, which is built into the Libelium Meshlium IoT gateway. The ThingSpeak cloud connector inside of the Meshlium Manager System creates the ThingSpeak channels needed for your devices and synchronizes the data automatically without writing any custom code.

Check out the MathWorks Hardware Catalog for more information about the Libelium support for ThingSpeak and MATLAB.

]]>
https://blogs.mathworks.com/iot/2018/10/05/libelium-now-supports-thingspeak-with-matlab-enabled-iot-analytics/feed/ 0
Create and Train a Feedforward Neural Network https://blogs.mathworks.com/iot/2018/07/31/create-and-train-a-feedforward-neural-network/?s_tid=feedtopost https://blogs.mathworks.com/iot/2018/07/31/create-and-train-a-feedforward-neural-network/#respond Tue, 31 Jul 2018 15:04:53 +0000 https://blogs.mathworks.com/iot/?p=2465

We have published an example in the ThingSpeak documentation that shows you how to train a feedforward neural network to predict temperature. The feedforward neural network is one of the... read more >>

]]>
We have published an example in the ThingSpeak documentation that shows you how to train a feedforward neural network to predict temperature. The feedforward neural network is one of the simplest types of artificial networks but has broad applications in IoT. Feedforward networks consist of a series of layers. The first layer has a connection from the network input. Each other layer has a connection from the previous layer. The final layer produces the network’s output. In our IoT application, the output will be the predicted temperature.

IoT Application

We are collecting data in a ThingSpeak channel and will use the integrated MATLAB analytics. To predict the temperature, this example makes use of the Neural Network Toolbox in MATLAB along with the data collected in a ThingSpeak channel. We will be using data collected by a weather station located at MathWorks offices in Natick, Massachusetts.

The process for creating, training, and using a feedforward network to predict the temperature is as follows:

  1. Gather data from the weather station
  2. Create a two-layer feedforward network
  3. Train the feedforward network
  4. Use the trained model to predict data

Read Data from the Weather Station ThingSpeak Channel

ThingSpeak channel 12397 contains data from the MathWorks weather station, located in Natick, Massachusetts. The data is collected once every minute. Fields 2, 3, 4, and 6 contain wind speed (mph), relative humidity, temperature (F), and atmospheric pressure (hg) data respectively. To read the data from the weather station within MATLAB, use the thingSpeakRead function.

data = thingSpeakRead(12397,'Fields',[2 3 4 6],'DateRange',[datetime('Jul 30, 2018'),datetime('Jul 31, 2018')],...
    'outputFormat','table');

Create Two-Layer Feedforward Network

Use the feedforwardnet function to create a two-layer feedforward network. The network has one hidden layer with 10 neurons and an output layer.

net = feedforwardnet(10);

Train the Feedforward Network

Use the train function to train the feed-forward network.

[net,tr] = train(net,inputs,targets);

Use the Trained Model to Predict Data

After the network is trained and validated, you can use the network object to calculate the network response to any input.

output = net(inputs(:,5))
output =

   74.9756

This example can be adapted to other IoT applications. Check out the ThingSpeak documentation for the code and explanation.

]]>
https://blogs.mathworks.com/iot/2018/07/31/create-and-train-a-feedforward-neural-network/feed/ 0
ThingSpeak Now Supports the Predictive Maintenance Toolbox for MATLAB https://blogs.mathworks.com/iot/2018/05/02/thingspeak-now-supports-the-predictive-maintenance-toolbox-for-matlab/?s_tid=feedtopost https://blogs.mathworks.com/iot/2018/05/02/thingspeak-now-supports-the-predictive-maintenance-toolbox-for-matlab/#comments Wed, 02 May 2018 21:51:02 +0000 https://blogs.mathworks.com/iot/?p=2404

The ThingSpeak team has integrated the Predictive Maintenance Toolbox for MATLAB into the IoT Analytics features of ThingSpeak. The Predictive Maintenance Toolbox provides tools for labeling data,... read more >>

]]>
The ThingSpeak team has integrated the Predictive Maintenance Toolbox for MATLAB into the IoT Analytics features of ThingSpeak. The Predictive Maintenance Toolbox provides tools for labeling data, designing condition indicators, and estimating the remaining useful life (RUL) of a machine. You can analyze and label machine data imported from local files, cloud storage, and distributed file systems. You can also label simulated failure data generated from Simulink models.

Here is a quick list of features of the Predictive Maintenance Toolbox for MATLAB:

  • Survival, similarity, and time-series models for remaining useful life (RUL) estimation
  • Time, frequency, and time-frequency domain feature extraction methods for designing condition indicators
  • Organizing sensor data imported from local files, Amazon S3™, Windows Azure® Blob Storage, and Hadoop®Distributed File System
  • Organizing simulated machine data from Simulink® models
  • Examples of developing predictive maintenance algorithms for motors, gearboxes, batteries, and other machines

The Predictive Maintenance Toolbox is available on ThingSpeak to users that have a license to the toolbox. Just sign into ThingSpeak using your MathWorks Account and you will have access to the features of the Predictive Maintenance Toolbox with the MATLAB Analytics app. If you have any questions about the Predictive Maintenance Toolbox, contact Aditya Baru at MathWorks.

]]>
https://blogs.mathworks.com/iot/2018/05/02/thingspeak-now-supports-the-predictive-maintenance-toolbox-for-matlab/feed/ 1
Discussions About How to Use MATLAB and Arduino on the MATLAB Maker Community https://blogs.mathworks.com/iot/2018/03/30/discussions-about-how-to-use-matlab-and-arduino-on-the-matlab-maker-community/?s_tid=feedtopost https://blogs.mathworks.com/iot/2018/03/30/discussions-about-how-to-use-matlab-and-arduino-on-the-matlab-maker-community/#comments Fri, 30 Mar 2018 15:53:13 +0000 https://blogs.mathworks.com/iot/?p=2352

As most of you know I love building IoT projects. Most of these maker projects use an Arduino, Particle, or Raspberry Pi, like my IR color-changing robot that connects to ThingSpeak and the... read more >>

]]>
As most of you know I love building IoT projects. Most of these maker projects use an Arduino, Particle, or Raspberry Pi, like my IR color-changing robot that connects to ThingSpeak and the CheerLights project.

I recently became the moderator of the MATLAB Maker Community that is hosted on MATLAB Central. There are many times where MATLAB and Simulink can help build a hardware-based project or be used to create the code running on a device. I also use MATLAB for analytics. Here are the most popular colors on CheerLights in the last 30 days.

The goal of the MATLAB Maker Community is to connect makers and builders together. I learn by working with others and sharing my work. If you are interested in maker project, I suggest following the Maker Community and jumping in on conversations or starting new discussions. I find this helpful if I am exploring a new idea or looking for feedback.

Right now, there is a discussion thread about how to use MATLAB to interface and interact with an Arduino. Makers can use MATLAB to control an Arduino by first installing the MATLAB® Support Package for Arduino®. Once you have the support package, you can use MATLAB to control the Arduino with familiar MATLAB commands.

% create an Arduino object
a = arduino('com3', 'uno');
% turn on an LED connected to Pin D11
writeDigitalPin(a, 'D11', 1);
% turn off an LED connected to Pin D11
writeDigitalPin(a, 'D11', 0);

Share your ideas on how to use the MATLAB connection to Arduino on the MATLAB Maker Community.

]]>
https://blogs.mathworks.com/iot/2018/03/30/discussions-about-how-to-use-matlab-and-arduino-on-the-matlab-maker-community/feed/ 1
Learn How to Build a Condition Monitoring IoT System https://blogs.mathworks.com/iot/2018/02/22/learn-how-to-build-a-condition-monitoring-iot-system/?s_tid=feedtopost https://blogs.mathworks.com/iot/2018/02/22/learn-how-to-build-a-condition-monitoring-iot-system/#comments Thu, 22 Feb 2018 16:00:49 +0000 https://blogs.mathworks.com/iot/?p=2298

Douglas Mawrey created a Smart Humidity Sensor using ThingSpeak to collect data, MATLAB to analyze the data, and IFTTT to send push notifications for certain conditions. This project uses the outdoor... read more >>

]]>
Douglas Mawrey created a Smart Humidity Sensor using ThingSpeak to collect data, MATLAB to analyze the data, and IFTTT to send push notifications for certain conditions. This project uses the outdoor temperature to determine the ideal indoor humidity and inform you about the room’s comfort. The data and condition results are displayed on Douglas’ public ThingSpeak channel 418058. This project is a good starting point to see the power of the MATLAB integration on ThingSpeak and how to perform real-time condition monitoring.

Setting up the Sensor

This project uses the ESP-based NodeMCU as an IoT gateway to forward sensor data to ThingSpeak. The NodeMCU is essentially a microcontroller and a Wi-Fi device that costs less than $10 US. The humidity sensor that is used in this project is the DHT11. This a very common sensor used to monitor temperature and humidity. The sensor either comes in a 4 pin or 3 pin package. The NodeMCU is programmed with the Arduino IDE using the code in Douglas’ tutorial or GitHub.

Using ThingSpeak Metadata

Douglas uses the metadata setting within a ThingSpeak channel to store condition ranges. This allows you to adjust settings in your online analytics code without redeploying new code. Each ThingSpeak channel has a metadata setting. You can store arbitrary text data that can be used in your MATLAB Analysis code. To load your channel’s metadata into MATLAB, use the webread function and add metadata=true to the ThingSpeak API Read Data request.

indoorChannelData = webread(strcat('https://api.thingspeak.com/channels/', ...
                                    num2str(indoorChannelID), ...
                                    '/feeds.json?metadata=true&api_key=', ...
                                    indoorChannelReadKey));

Using MATLAB for Condition Monitoring

Douglas uses MATLAB on ThingSpeak to determine the proper condition. This is a common requirement in complex IoT systems. This example could be a good starting point for building a condition monitoring system for industrial maintenance applications. You use MATLAB to determine the target humidity using a polynomial fit over the lookup data.

lookupFit = polyfit(humidityLookup(:, 1), humidityLookup(:, 2), length(humidityLookup) - 1);
optimalHumidity = polyval(lookupFit, curTempOut);

humidityDiff = curHumidity - optimalHumidity;

Using IFTTT for Alerts

Often you want to get notifications when a certain condition is met. Douglas shows you how to use IFTTT to send push notification directly to your phone. In this project, MATLAB is determining the condition and then interfaces with the IFTTT API to send the push notification. To send push notifications via IFTTT, use the webwrite function in MATLAB.

webwrite(strcat('https://maker.ifttt.com/trigger/', makerEvent, ...
                '/with/key/', makerKey), ...
                'value1', stateMsg, ...
                'value2', char(timeSinceChange, 'hh:mm'));

All of the MATLAB code can be deployed on ThingSpeak and scheduled to be executed periodically without having this on your desktop computer. The complete Smart Humidity Sensor project tutorial is available on Hackster.io. Feel free to discuss on the MATLAB Maker Community.

]]>
https://blogs.mathworks.com/iot/2018/02/22/learn-how-to-build-a-condition-monitoring-iot-system/feed/ 1
What is a Bomb Cyclone? Use ThingSpeak and MATLAB to Figure it Out. https://blogs.mathworks.com/iot/2018/01/04/what-is-a-bomb-cyclone/?s_tid=feedtopost https://blogs.mathworks.com/iot/2018/01/04/what-is-a-bomb-cyclone/#respond Thu, 04 Jan 2018 22:32:58 +0000 https://blogs.mathworks.com/iot/?p=2236

Social media is blowing up the term bomb cyclone. The term is everywhere from Twitter to 24/7 news coverage of the storm hitting the East Coast of the United States. The technical term for a bomb... read more >>

]]>
Social media is blowing up the term bomb cyclone. The term is everywhere from Twitter to 24/7 news coverage of the storm hitting the East Coast of the United States. The technical term for a bomb cyclone is bombogenesis which is the combination of “bomb” and “cyclogenesis.” Or, you could call it an explosive cyclogenesis to grab views to your blog.

A storm undergoes bombogenesis when its central low pressure drops at least 24 millibars in 24 hours, according to the National Oceanic and Atmospheric Administration (NOAA).

At the MathWorks headquarters in Natick, MA we have a weather station sending data to ThingSpeak for the past several years. Here’s what the weather station looks like on a better day.

Not many interesting events emerge from the data, but with something called a bomb cyclone, Rob Purser decided to take a closer look using MATLAB. Our weather station on ThingSpeak channel 12397 collects temperature, humidity, and pressure data. By taking a look at this MATLAB plot of the pressure analyzed over 24 hours, you will see the pressure drops at least 24 millibars in 24 hours and in fact over 40 millibars. This storm definitely fits its name of explosive cyclogenesis.

Have a look at the raw data from ThingSpeak and see if you can determine the bomb cyclone event. In MATLAB, use thingSpeakRead via the ThingSpeak Support Toolbox. We documented the process of analyzing the weather station data using MATLAB on Hackster.io. Just follow the steps using MATLAB or MATLAB Online, to discover some interesting results.

Stay warm.

]]>
https://blogs.mathworks.com/iot/2018/01/04/what-is-a-bomb-cyclone/feed/ 0
Don’t Get Stuck in the Mud, Understand Tide Levels with MATLAB https://blogs.mathworks.com/iot/2017/09/14/dont-get-stuck-in-the-mud-understand-tide-levels-with-matlab/?s_tid=feedtopost https://blogs.mathworks.com/iot/2017/09/14/dont-get-stuck-in-the-mud-understand-tide-levels-with-matlab/#respond Thu, 14 Sep 2017 14:25:28 +0000 https://blogs.mathworks.com/iot/?p=2189

Tides go up and down. But, the question is when and how will the tide levels change in the future. If you are planning a boating trip or trying to understand how the wind affects tide levels during... read more >>

]]>
Tides go up and down. But, the question is when and how will the tide levels change in the future. If you are planning a boating trip or trying to understand how the wind affects tide levels during storms, you want to predict the tide levels using data that you have collected locally. In a tutorial published on Hackster.io, you will be able to learn how to use ThingSpeak to collect sensor data that represents the tide height at a given time, use MATLAB to preprocess the data, use MATLAB to predict future tide levels, and use ThingSpeak to send alerts. Here’s what the system looks like installed at a dock in Cape Cod.

The tide height is calculated using an ultrasonic level sensor. This measurement is taken periodically and then sent to ThingSpeak, an IoT analytics cloud platform by MathWorks, using a cellular modem. The system can easily be adapted to collect data about any environmental system such as greenhouses or oyster farms.

Once you have the data in a ThingSpeak channel, you use MATLAB to preprocess and clean up the data. The raw data some times has extraneous values caused by environmental factors such as lighting, cabling, and electrical interference. Sometimes, you have missing data caused by connectivity issues. It is important to clean up the data before you use the data in your analysis.

To predict future tide levels and send alerts when the tide is rising or falling, we use the MATLAB Analysis app on ThingSpeak. With MATLAB, we can use historical data to make a prediction about the future tide levels. This predicted tide level can be used to help schedule a boating trip or plan for a water surge after a storm.

 

Tide Alerts

Remembering to check the tide level when fishing or lazing on the beach is not particularly convenient. A much more useful approach is to have the system send a message when the time has come to pack up and start heading back to the dock. The timing of the alert depends on how much water depth is needed by a particular boat. Larger boats need higher water levels in order to move without getting stuck in the mud. One way to send alerts is to use ThingSpeak and MATLAB to detect changes in tidal height and send alerts.

Conclusion

Developing a tide monitoring system provided accurate tide level measurement and tide level prediction, with the added ability to send alerts. Robert has been able to avoid being stuck in the bay by providing enough time to get back to his dock using this system. This project also serves as a useful approach to solving many data-driven puzzles by having a reliable way to collect, analyze, and act on data. Using MATLAB, the accuracy of the tide levels improved by understanding the proper tide levels at a specific location and when the tide levels will change. If you used the general tide forecast, you would have to account for several inches of tide height difference.

Resources

]]>
https://blogs.mathworks.com/iot/2017/09/14/dont-get-stuck-in-the-mud-understand-tide-levels-with-matlab/feed/ 0
Learn about IoT and Digital Twins https://blogs.mathworks.com/iot/2017/08/07/learn-about-iot-and-digital-twins/?s_tid=feedtopost https://blogs.mathworks.com/iot/2017/08/07/learn-about-iot-and-digital-twins/#respond Mon, 07 Aug 2017 19:32:40 +0000 https://blogs.mathworks.com/iot/?p=2177

An emerging topic with IoT is Digital Twin (DT). The digital twin is a federation of data and models that can be analyzed or put into a simulation to create useful information about the past,... read more >>

]]>
An emerging topic with IoT is Digital Twin (DT).

The digital twin is a federation of data and models that can be analyzed or put into a simulation to create useful information about the past, present, or future of the DT’s physical twin.

Bruce Sinclair of the Iot-Inc. Business Show podcast invite Jim Tung, a MathWorks fellow, to discuss models, simulation, and digital twins. Jim shares information about a few MathWorks customer use cases and our products used for modeling, simulation, and IoT.

Bruce and Jim talk about many interesting and key topics for IoT system development, including:

  • The difference between data-driven models and functional models
  • Using raw data to calibrate, update and validate functional models
  • System level modeling
  • The importance model hierarchy to discover insights
  • A smart grid digital twin example
  • The role of deep learning in digital twin modeling
  • The actionable steps of how to create your digital twin

To listen to the  Iot-Inc. Business Show podcast, either subscribe on iTunes or play the episode on Iot-Inc.

Additional Resources

]]>
https://blogs.mathworks.com/iot/2017/08/07/learn-about-iot-and-digital-twins/feed/ 0
Send Bulk Sensor Data to ThingSpeak for Analysis https://blogs.mathworks.com/iot/2017/07/20/send-bulk-sensor-data-to-thingspeak-for-analysis/?s_tid=feedtopost https://blogs.mathworks.com/iot/2017/07/20/send-bulk-sensor-data-to-thingspeak-for-analysis/#comments Thu, 20 Jul 2017 15:00:17 +0000 https://blogs.mathworks.com/iot/?p=2167

Many IoT projects collect data from a sensor and send the data to ThingSpeak at the same time over and over. To continuously collect and send data to the cloud requires the device to be powered and... read more >>

]]>
Many IoT projects collect data from a sensor and send the data to ThingSpeak at the same time over and over. To continuously collect and send data to the cloud requires the device to be powered and connected all of the time. A battery-powered IoT device like a Particle Photon or Onion Omega2 would run out of power quickly. There are many IoT applications where you want your IoT device to collect the data offline over a long period of time, then send the data all at once to ThingSpeak for analysis.

The ThingSpeak team at MathWorks is excited to announce Bulk-Update! This new ThingSpeak feature is targeted at IoT devices trying to optimize battery use by allowing the device to update a lot of data at once. To help you get started with bulk-update, we have written examples for Arduino, ESP8266, Particle Photon, and the Raspberry Pi 3.

Once your data is on ThingSpeak, it is easy to analyze using the MATLAB Analysis and Visualization apps within ThingSpeak, MATLAB Online, or Desktop MATLAB. To read data from ThingSpeak into MATLAB, use the ThingSpeak Support Toolbox and the thingSpeakRead command. We have released documentation and examples to help you get started with bulk-update on ThingSpeak.

Resources for Bulk-Update

]]>
https://blogs.mathworks.com/iot/2017/07/20/send-bulk-sensor-data-to-thingspeak-for-analysis/feed/ 5
The Data Science Behind BBQ https://blogs.mathworks.com/iot/2017/05/29/the-data-science-behind-bbq/?s_tid=feedtopost https://blogs.mathworks.com/iot/2017/05/29/the-data-science-behind-bbq/#comments Mon, 29 May 2017 16:15:55 +0000 https://blogs.mathworks.com/iot/?p=2139

Smoking ribs or a pork shoulder requires lots of patience and practice. When everything works, you get to enjoy an amazing dinner. When things go wrong, you end up with dry, overcooked meat that only... read more >>

]]>
Smoking ribs or a pork shoulder requires lots of patience and practice. When everything works, you get to enjoy an amazing dinner. When things go wrong, you end up with dry, overcooked meat that only your dog may enjoy. Here’s what great BBQ looks like from @AndreasHarsch.

My process of smoking meat, cheese, or even ice cream is to monitor only the meat temperature and the internal temperature of the smoker. When I finish a cook, I go back and try to learn from the data. I do not attempt to control the smoker using the Internet of Things, I use IoT to collect the data with ThingSpeak, analyze the data with MATLAB, and apply the insights to the next cook. The best advice that I have been given is to not change too many variables. Stick with simple rubs, the same charcoal, the same wood, the same cuts of meat, etc. Only change one variable for one cook. It takes years of trial and error before you get great at BBQ.

With the help of ThingSpeak and MATLAB, I can help you understand one of the more frustrating parts of smoking meats… the stall! The stall is a period of time where what you are cooking does not seem to be increasing in internal temperature. I used to panic during the stall and mess with the temperature by adding more charcoal or turning the vents. Overtime, I realized this is normal. No reason to panic.

Cooking is taking something cold and getting its internal temperature up to a safe level. Everything that you cook has a different target internal temperature, but generally the sweet spot is 190-205F. Smoking is about low and slow cooking. This means that you are trying to raise that internal temperature slowly with a low temperature. I use a cook temperature of 230-250F. This means that smoking takes a lot of time to properly cook. In some cases, this is two hours per pound. Things don’t change much minute to minute in a BBQ pit, so you can collect data every few minutes and still have an accurate picture of what’s happening.

Collecting Data

First, I set up a ThingSpeak channel to store my temperature data. One field is for the smoker’s temperature and field two is for the internal temperature of what I am cooking. To get the data, you have many options. I did a quick search around the internet and discovered hundreds of Arduino and ThingSpeak projects to get data from a smoker. In general you need two temperature probes that can take the heat of the smoker, connectors, an Arduino with Wi-Fi like the MKR1000.

Analyzing the Temperature Data

The first step is to read in the temperature data using MATLAB that was collected by ThingSpeak. Data on ThingSpeak is stored in a channel and identified by a channelID. If you have a private channel, you will need to supply a Read API Key to get access to the data.

smokerTT = thingSpeakRead(279400,'ReadKey','9AYZQDT1XFDM98FW','OutputFormat','timetable','NumPoints',115);

Sometimes the data from your temperature probe is noisey. This means the value that the temperature probe reports is sometimes higher or lower than the actual temperature. If you take a few samples and take a median, you get a consistent result. In MATLAB, I use smoothdata to take a moving median of my time-series sensor data.

smoothSmoker = smoothdata(smokerTT);

After I clean up the data, I want to visualize it and to see what happened. This is a good time to learn how long things actually take, so on your next cook you budget the right amount of time and don’t rush any phases.

plot(smoothSmoker.Timestamps, smoothSmoker.Variables);

I can use this data to determine how long the total cook will last and even set alerts using ThingSpeak. I tend to watch the smoker and tend the fire.

Results

After a lot of research, I discovered what the stall is doing and why it is important to keep your patience and push forward. This is starting to sound like a metaphor for life. According to Prof. Greg Blonder, “The stall is evaporative cooling”. Prof. Greg is a physicist, entrepreneur, former Chief Technical Advisor at AT&T’s legendary Bell Labs, and regularly contributes to AmazingRibs.com. He likes to bust myths about barbequing and help us understand the thermodynamics of cooking. You are heating the meat slowly, but the moisuture in the meat is evapotaring at the same rate. This effect causes a stall in the temperature rise. The temperature of the meat will go up when the moisture is depleted. The stall is important to the cooking process and leads to something called the bark. This is an outer layer of the meat that is slightly thicker and less tender than the rest of the meat, but traps in lots of flavor and adds to its complexity. So, don’t rush during the stall. Keep the smoker temperature constant – avoid the temptation to turn the heat up to get through faster. And in the end, enjoy some well made BBQ with friends and family over the summer weekends and holidays.

]]>
https://blogs.mathworks.com/iot/2017/05/29/the-data-science-behind-bbq/feed/ 4
IoT Day is the Day to Learn About Our New MATLAB Analytics Features https://blogs.mathworks.com/iot/2017/04/08/iot-day-is-the-day-to-learn-about-our-new-matlab-analytics-features/?s_tid=feedtopost https://blogs.mathworks.com/iot/2017/04/08/iot-day-is-the-day-to-learn-about-our-new-matlab-analytics-features/#respond Sun, 09 Apr 2017 02:30:59 +0000 https://blogs.mathworks.com/iot/?p=2048 IoT Data heatmap

April 9th is IoT Day! We are celebrating by announcing new IoT Analytic features. All ThingSpeak users now have access to the new features of MATLAB R2017a. In ThingSpeak you can analyze and... read more >>

]]>
April 9th is IoT Day! We are celebrating by announcing new IoT Analytic features. All ThingSpeak users now have access to the new features of MATLAB R2017a. In ThingSpeak you can analyze and visualize your data using the power of MATLAB. With the latest updates you can visualize your IoT data as a heatmap and analyze large sets of time-stamped data using a tall timetable.

In the latest update, we have added many new analytics features perfect for IoT data:

  • isoutlier / filloutliers: To find outliers in your data, use the isoutlier function. To replace outliers with alternative values, use the filloutliers function.
  • smoothdata: Smoothing noisy data is now possible with the smoothdata function. For example, smoothdata(A,’movmedian’) smooths data with a moving-window median.
  • fillmissing: Filling missing data using a moving mean or moving median option is now available with the fillmissing function.

Smooth Weather Data

At our headquarters in Natick, MA, we have a weather station sending data to ThingSpeak channel 12397. We use ThingSpeak to collect raw temperature, humidity, wind, and rain data. We use MATLAB to analyze and visualize the data so we can use it for forecasting plant harvesting and building weather models. Learn how to build your own weather station at Hackster.io and learn how to analyze the weather data using MATLAB with the source code on File Exchange.

Often you want to process the raw data by removing outliers and smoothing the data. This helps if you are building a predictive model and to better visualize the data. The common IoT analytics workflow is to read in raw data, synchronize the data in time, detect and remove outlier values, smooth the data, and visualize the data. This example works on ThingSpeak, MATLAB Online, and desktop MATLAB.

Read historic weather data

[weather,channelInfo] = thingSpeakRead(12397,...
'DateRange',[datetime('Feb 04, 2016'),datetime('Feb 10, 2016')],...
'outputFormat','table');

Convert to timetable

weather = table2timetable(weather);

Smooth the data

First, resample the timetable using the retime function so the times and data are uniformly spaced on the minute.

wdata = retime(weather(:,{'Humidity','TemperatureF'}),'minutely','linear');

Smooth the data using a moving median and compare this to the original data. There are a number of moving statistics functions for vectors and matrices like movmean, movmedian, etc and also the smoothdata function which also works on timetables and uses the RowTimes as the sample points. Moving median is the default and other options are available.

smdata = smoothdata(wdata);

Visualize the original and smoothed temperature data on a plot

figure
plot(wdata.Timestamps,wdata.TemperatureF,...
smdata.Timestamps,smdata.TemperatureF,'m--')
legend('Raw Data','Smooth Data')
ylabel('Temperature (\circF)')
title('Temperature Over Time')

Smooth Weather Data

Have a happy IoT Day and we hope that you understand your IoT data a littler more by using MATLAB Analytics on ThingSpeak. I would like to thank Heather Gorr for helping me put together the example MATLAB code. Cheers!

]]>
https://blogs.mathworks.com/iot/2017/04/08/iot-day-is-the-day-to-learn-about-our-new-matlab-analytics-features/feed/ 0
Cadmus Collects and Analyzes IoT Data Using MATLAB and ThingSpeak https://blogs.mathworks.com/iot/2017/02/22/cadmus-analyzes-iot-data-with-matlab/?s_tid=feedtopost https://blogs.mathworks.com/iot/2017/02/22/cadmus-analyzes-iot-data-with-matlab/#respond Wed, 22 Feb 2017 19:58:01 +0000 https://blogs.mathworks.com/iot/?p=2028

The Internet of Things (IoT) enables power producers, public utilities, and other companies in the energy sector to collect energy power consumption data from hundreds of factories and thousands of... read more >>

]]>
The Internet of Things (IoT) enables power producers, public utilities, and other companies in the energy sector to collect energy power consumption data from hundreds of factories and thousands of homes in near real time. This wealth of information has opened opportunities to evaluate energy efficiency initiatives, predict power demand, and perform energy audits.

Consulting firm Cadmus provides full-spectrum energy-efficiency support services to energy utilities throughout North America. These services include studies of energy use that require extensive data collection and analysis.

To make the most of the opportunities presented by the IoT, Cadmus engineers used MATLAB® and the ThingSpeak™ IoT platform to develop a workflow for collecting, storing, analyzing, visualizing, and interpreting data from sensors in homes and businesses distributed across wide geographic areas.

“In just a few months, we implemented a new service that measures and analyzes temperature and humidity changes in dozens—and soon hundreds—of homes,” says Dave Korn, vice president of engineering at Cadmus. “Without MATLAB and ThingSpeak, we would still just be talking about it. Instead, we’re already pitching this service to utilities. That is a huge competitive advantage for our company.”

Solution

Cadmus used MATLAB and ThingSpeak to develop and deploy two systems of cloud-connected sensors for the near-real-time measurement and analysis of energy data, while establishing a workflow for rapidly implementing similar systems.

The first system, designed for an energy efficiency study of residential homes, used custom sensors to send temperature, relative humidity, and device battery voltage measurements to ThingSpeak every five minutes. The second, designed to monitor loads of HVAC systems and large appliances, used off-the-shelf home automation hardware to send power usage data, captured at residential circuit breakers and individual outlets, every minute.

Using the ThingSpeak web application, the engineers created new channels to collect data from the sensors and to quickly verify that each new sensor added to the system was reliably sending data.

Working in MATLAB, the team analyzed the collected data, using standard statistical techniques to identify outliers and calculate means and standard deviations. For example, they calculated and plotted power load profiles by the hour and correlated the load data with weather data from an outside source.

They created a variety of data visualizations, including interactive maps, which they shared with clients and prospects.

Cadmus engineers are currently using MATLAB and Statistics and Machine Learning Toolbox™ to develop predictive algorithms based on machine learning and advanced classification and regression techniques. These algorithms are designed to predict and model load based on weather conditions and sensor data collected via ThingSpeak.

Results

  • Market opportunity seized. “In our industry, many utilities are looking to design better energy efficiency programs and to lower the costs of those programs,” says Korn. “MATLAB and ThingSpeak enabled us to develop solutions rapidly, which meant we could capitalize on these demands this fall. Without MATLAB and ThingSpeak we would have had to wait until spring and miss numerous opportunities in the market.”
  • Development effort cut by two-thirds. “With MATLAB and ThingSpeak, our team of five engineers was collecting and analyzing data in a matter of months. We could not have met our deadlines without them,” says James Kennedy, energy analyst at Cadmus. “With other tools we would probably have needed 15 engineers to complete the work in the same time amount of time—if we could have done it at all.”
  • Sensor networks quickly deployed. “On our first project with ThingSpeak, it took just over three months to implement a network that we quickly scaled from 50 operational sensors to 500,” says Kennedy. “In a very short period we had another complete network set up and collecting data, and that one was deployed at an even faster rate than the first.”
]]>
https://blogs.mathworks.com/iot/2017/02/22/cadmus-analyzes-iot-data-with-matlab/feed/ 0
MATLAB Toolboxes are Now Available on ThingSpeak for IoT Analytics https://blogs.mathworks.com/iot/2016/11/05/matlab-toolboxes-on-thingspeak/?s_tid=feedtopost https://blogs.mathworks.com/iot/2016/11/05/matlab-toolboxes-on-thingspeak/#comments Sat, 05 Nov 2016 15:35:21 +0000 https://blogs.mathworks.com/iot/?p=1943

ThingSpeak offers an easy way to collect data from things, analyze and visualize the data with MATLAB, and act on your data. With MATLAB from MathWorks, you have access to powerful data processing... read more >>

]]>
ThingSpeak offers an easy way to collect data from things, analyze and visualize the data with MATLAB, and act on your data. With MATLAB from MathWorks, you have access to powerful data processing and analysis functions for IoT data. To extend the functionality, we offer toolboxes such as the Statistics and Machine Learning Toolbox™ and Signal Processing Toolbox™. These toolboxes need a license from MathWorks. If you have access to these toolboxes linked to a MathWorks Account, you have access to many of the toolboxes on ThingSpeak. All you have to do is to log in to ThingSpeak using your MathWorks Account credentials. With very little code, it is possible to forecast tidal depths using tide data collected by a ThingSpeak channel and the System Identification Toolbox.

Tide forecasting using MATLAB and ThingSpeak

When you are logged into ThingSpeak using your MathWorks Account, you can use functions from the following toolboxes if you are licensed to use them:

We have created many examples showing you how to use MATLAB Toolboxes using ThingSpeak channel data. We have an example using the Signal Processing Toolbox to Visualize and Remove Outliers in Your Data which a common task when you are working with IoT data from sensors. If you want to forecast environmental data by using a feedforward neural network, we have an example using the Neural Network Toolbox operating on weather station data collected by ThingSpeak. In all of our examples, you are able to use the code right on ThingSpeak and allow it to run on a schedule using TimeControl or be triggered to run using React. Many of your licensed toolboxes are now available with your MathWorks Account on ThingSpeak.

]]>
https://blogs.mathworks.com/iot/2016/11/05/matlab-toolboxes-on-thingspeak/feed/ 5
Introducing MATLAB Central… https://blogs.mathworks.com/iot/2016/08/25/introducing-matlab-central/?s_tid=feedtopost https://blogs.mathworks.com/iot/2016/08/25/introducing-matlab-central/#respond Thu, 25 Aug 2016 21:51:22 +0000 https://blogs.mathworks.com/iot/?p=1911

We launched MATLAB Analysis and Visualizations on ThingSpeak last year and have noticed a sharp increase in IoT analytics being used in your projects. We are seeing everything from analyzing... read more >>

]]>
We launched MATLAB Analysis and Visualizations on ThingSpeak last year and have noticed a sharp increase in IoT analytics being used in your projects. We are seeing everything from analyzing squirrel behaviour to analyzing traffic patterns. As we are all learning how to use MATLAB in our IoT projects, we need to take notice of MATLAB Central.

MATLAB Central - ThingSpeak Community

MATLAB Central is “a place where you can get answers.” We have over 100,000 community members and MathWorks employees all sharing projects and files, experience, and answering questions. And, ThingSpeak is showing up on MATLAB Answers and File Exchange. This is great news for the ThingSpeak Community. If you already have a MathWorks user account and use it on ThingSpeak, you already have access to MATLAB Central. All you have to do is sign in. If you are new to MathWorks, you can sign up for a free user account to gain access to MATLAB Central and other features of ThingSpeak.

Check out Ned Gulley’s post, “Going Way Back with MATLAB Central” to learn about how the MATLAB community has formed over the years.

Cheers to MATLAB Central hitting the 15th year mark! We are happy to be a part of the story.

]]>
https://blogs.mathworks.com/iot/2016/08/25/introducing-matlab-central/feed/ 0
Analyzing Squirrel Behaviour and Weather Forecasting with MATLAB and ThingSpeak https://blogs.mathworks.com/iot/2016/07/25/analyzing-squirrel-behaviour-and-weather-forecasting/?s_tid=feedtopost https://blogs.mathworks.com/iot/2016/07/25/analyzing-squirrel-behaviour-and-weather-forecasting/#respond Mon, 25 Jul 2016 14:23:54 +0000 https://blogs.mathworks.com/iot/?p=1861

Lord Kelvin said, “If you can not measure it, you can not improve it.” In Carsten’s project, he built a squirrel feeder complete with sensors and a camera. The “Squirrel... read more >>

]]>
Lord Kelvin said, “If you can not measure it, you can not improve it.” In Carsten’s project, he built a squirrel feeder complete with sensors and a camera. The “Squirrel Cafe” allows squirrels to lift a cover and take a peanut. When that happens, data gets collected and the feeder tweets its data summary with a photo. Carsten is learning a lot about the behaviours of the squirrels and is also trying to forecast the coming winter based on how many nuts are being taken. Behind-the-scenes, he is using Raspberry Pi, ThingSpeak, and MATLAB.

Squirrel Monitoring

The Squirrel Cafe is connected to the ThingSpeak IoT Analytics platform using the Raspberry Pi. The Raspberry Pi collects data from a tilt sensor, temperature sensor, and a camera to determine how many nuts the squirrels are taking. Whenever the lid opens, the current temperature gets measured by the DS18B20 sensor and sent to ThingSpeak for storage and analysis using MATLAB.

Squirrel Cafe System

Carsten is also testing a theory. He noticed through observation that there might be a correlation between the number of nuts that get taken from the feeder and how long the coming winter season will be. This winter forecast and “nuts per minute” calculations are being performed by ThingSpeak’s MATLAB Analysis app. We are excited to see what the results prove in the next few years.

For full project details and source code, visit Carsten’s website for this project at www.TheSquirrelCafe.com.

 

]]>
https://blogs.mathworks.com/iot/2016/07/25/analyzing-squirrel-behaviour-and-weather-forecasting/feed/ 0
Prototyping IoT Analytics with MATLAB and ThingSpeak https://blogs.mathworks.com/iot/2016/07/09/prototyping-iot-analytics-with-matlab-and-thingspeak/?s_tid=feedtopost https://blogs.mathworks.com/iot/2016/07/09/prototyping-iot-analytics-with-matlab-and-thingspeak/#respond Sat, 09 Jul 2016 18:54:41 +0000 https://blogs.mathworks.com/iot/?p=1853

Rob Purser, our Senior Development Manager for IoT, will be holding a hands-on workshop at this year’s IoT Evolution in Las Vegas. Rob will teach the attendees how to prototype IoT analytics... read more >>

]]>
Rob Purser, our Senior Development Manager for IoT, will be holding a hands-on workshop at this year’s IoT Evolution in Las Vegas. Rob will teach the attendees how to prototype IoT analytics using MATLAB and the IoT platform, ThingSpeak.

IoT Evolution - Internet of Things Conference

The Internet of Things typically involves a discussion of smart devices and the cloud, with much less attention paid to the data collection, pre-processing of acquired data, and development of real-time analytics algorithms. A successful data analytics strategy involves embedded sensor analytics, historical data analysis, and online analytics. In this hands-on session, each participant will work with devices and try out the various types of analytics in action.

IoT Evolution West 2016

Caesars Palace, Las Vegas
900 Convention Center Blvd
New Orleans, LA

IOTD-02: Prototyping IoT Analytics: Hands on with ThingSpeak and MATLAB
Tuesday, July 12, 2016 at 2PM
Forum 15

]]>
https://blogs.mathworks.com/iot/2016/07/09/prototyping-iot-analytics-with-matlab-and-thingspeak/feed/ 0
Weather Station with Particle, SparkFun, ThingSpeak, and MATLAB https://blogs.mathworks.com/iot/2016/06/06/weather-station-data-analysis/?s_tid=feedtopost https://blogs.mathworks.com/iot/2016/06/06/weather-station-data-analysis/#respond Mon, 06 Jun 2016 14:46:25 +0000 https://blogs.mathworks.com/iot/?p=1837

[Haodong Liang] has released a weather station project with full MATLAB data analysis, device source code, and procedures on Hackster.io. He used the Particle Electron to connect the SparkFun weather... read more >>

]]>
[Haodong Liang] has released a weather station project with full MATLAB data analysis, device source code, and procedures on Hackster.io. He used the Particle Electron to connect the SparkFun weather station to ThingSpeak anywhere covered by a 2G/3G cellular data network. The project demonstrates how to build your own and start exploring data collected by ThingSpeak with MATLAB.

MathWorks Weather Station

The project also shows you how to use MATLAB to get very detailed visualizations and data analysis of the data collected by the weather station. Some of the examples include histograms of temperature, humidity, and pressure, curve fitting, daily comparisons, and 3D plots of temperature.

MATLAB weather station temperature plot

Visit Hackster.io for the complete tutorial to build your own weather station, connect it to the internet with the Particle Photon, collect your data with ThingSpeak, and do data analysis with MATLAB.

[via Hackster.io]

]]>
https://blogs.mathworks.com/iot/2016/06/06/weather-station-data-analysis/feed/ 0
Explore your IoT data with ThingSpeak and MATLAB https://blogs.mathworks.com/iot/2016/03/25/explore-your-iot-data-with-thingspeak-and-matlab/?s_tid=feedtopost https://blogs.mathworks.com/iot/2016/03/25/explore-your-iot-data-with-thingspeak-and-matlab/#respond Fri, 25 Mar 2016 19:09:34 +0000 https://blogs.mathworks.com/iot/?p=1749

Loren Shure, a blogger at MATLAB Central, has written a new blog post about Eric Wetjen’s Counting Cars and Analyzing Traffic project. Eric uses a Raspberry Pi and webcam to capture traffic... read more >>

]]>
Loren Shure, a blogger at MATLAB Central, has written a new blog post about Eric Wetjen’s Counting Cars and Analyzing Traffic project. Eric uses a Raspberry Pi and webcam to capture traffic data outside of the MathWorks headquarters in Natick, MA. All of the traffic data is stored on a public ThingSpeak channel, so you will be able to use it to learn data analysis with the built-in MATLAB Analysis and Visualizations apps in ThingSpeak.

MATLAB car counting display

Loren explores the data using MATLAB Analysis and MATLAB Visualizations app built into ThingSpeak.

Offline Analysis: Analyzing Data stored on ThingSpeak

If you have desktop MATLAB, you can gain even more insights into our traffic data or any of your ThingSpeak Channels. You need to first import the data from ThingSpeak into desktop MATLAB. To simplify the retrieval of the data from ThingSpeak, we use the functions from the ThingSpeak Support Toolbox, available on MATLAB Central File Exchange.

readChannelID = 38629;
readAPIKey = '8NPXB8G515OAD94Q';

%% Read Data %%
[data, time] = thingSpeakRead(readChannelID,'DateRange',[datetime('Mar 13, 2016'),datetime('Mar 14, 2016')],'ReadKey', readAPIKey);

[via Loren on the Art of MATLAB]

]]>
https://blogs.mathworks.com/iot/2016/03/25/explore-your-iot-data-with-thingspeak-and-matlab/feed/ 0
Updates to the MATLAB Analysis App with Lots of Example Code https://blogs.mathworks.com/iot/2015/09/09/updates-to-the-matlab-analysis-app-with-lots-of-example-code/?s_tid=feedtopost https://blogs.mathworks.com/iot/2015/09/09/updates-to-the-matlab-analysis-app-with-lots-of-example-code/#comments Wed, 09 Sep 2015 21:54:53 +0000 https://blogs.mathworks.com/iot/?p=1497 When using the MATLAB Analysis app on ThingSpeak, the MATLAB function to represent date and time (datetime) allows you to represent points in time. You can also use datetime(‘now’), ... read more >>

]]>
When using the MATLAB Analysis app on ThingSpeak, the MATLAB function to represent date and time (datetime) allows you to represent points in time. You can also use datetime(‘now’)datetime(‘today’), datetime(‘yesterday’), or datetime(‘tomorrow’) to create scalar datetimes at or around the current moment. Check out our documentation for more information about the datetime function.

On ThingSpeak, so far, the datetime function returned time set to UTC time zone by default. Starting at 10 am (EDT) on September 10th 2015, the datetime function will return date and time set to your account time zone (at https://thingspeak.com/account). This will allow you to read data from your channel with timestamps zoned to your local time zone instead of UTC.

For example, my account time zone is set to Eastern Time (US & Canada), and when I ran the following MATLAB code at 12:23 pm, I received:

dt = datetime('now')
dt =
     10-Sep-2015 12:23:35

Prior to this change, I would have received:

dt =
     10-Sep-2015 16:23:35

As you can see, the timestamp is 4 hours ahead of my time zone, which was due to MATLAB returning time in UTC.

This change makes it easier for you to perform time related activities in your time zone. Note that this new feature is available for both thingSpeakRead and thingSpeakWrite functions as well. As an example, consider the following request to read data from the MathWorks Weather Channel:

MATLAB Code:

[data, timestamp] = thingSpeakRead(12397);
display(timestamp.TimeZone, 'TimeZone');

Output:

data =
     225.0000    3.8000   43.9000   95.8000
     0   29.9800    4.3000    0.0300
timestamp =
     10-Sep-2015 16:13:54
TimeZone =
     America/New_York

With this enhancement, you would no longer have to explicitly specify the time zone of your dates and time to read and write data in your time zone.

Here are a few other examples:

  1. Read data corresponding to one entire day in your timezone:
startDateTime = datetime('September 10, 2015 00:00:00')
endDateTime = datetime('September 10, 2015 23:59:59')
readChannelID = 12397;
[data, timeStamps] = thingSpeakRead(readChannelID, 'DateRange', [startDateTime, endDateTime])
  1. Read data between certain hours of a day (between 7 am and 9 pm):
startDateTime = datetime('September 10, 2015 07:00:00')
endDateTime = datetime('September 10, 2015 21:00:00')
readChannelID = 12397;
[data, timeStamps] = thingSpeakRead(readChannelID, 'DateRange', [startDateTime, endDateTime])
  1. Generate a MATLAB plot in your local time zone:
[data, timeStamps] = thingSpeakRead(12397, 'Fields', 3, 'NumPoints', 10);
plot(timeStamps, data)

Note that, if at present, you are explicitly setting the time zone to your local time zone, you might see unexpected behavior in your code. Here are a few examples, based on support requests we have received:

  1. If you are using datetime function in your code similar to the example below:
% Set the time now to variable dt
dt = datetime('now')
% Assign time zone to UTC since the dt is unzoned by default
dt.TimeZone = 'UTC';
% Convert the timestamp to ‘America/New_York’
dt.TimeZone = 'America/New_York'

To fix this, remove the “TimeZone” assignments since time is now returned in your time zone by default, and use the code below:

% Set the time now to variable dt
dt = datetime('now')
  1. If you are setting the time zone of data returned by thingSpeakRead to your zone:
% Read data from a channel
[data, timeStamps] = thingSpeakRead(12397);
% Set the timezone to match your zone
timeStamps.TimeZone = 'America/New_York';

To fix this, remove the line with the “TimeZone” assignment, and use the code below:

% Read data from a channel
[data, timeStamps] = thingSpeakRead(12397);

For more information about the datetime function refer to the MATLAB documentation. If you need support, use the MATLAB section of the ThingSpeak Forum.

]]>
https://blogs.mathworks.com/iot/2015/09/09/updates-to-the-matlab-analysis-app-with-lots-of-example-code/feed/ 3
You’ve Collected Lots of IoT Data, Now We Can Help You Figure Out What It Means! https://blogs.mathworks.com/iot/2015/08/20/you-have-collected-lots-of-iot-data/?s_tid=feedtopost https://blogs.mathworks.com/iot/2015/08/20/you-have-collected-lots-of-iot-data/#comments Thu, 20 Aug 2015 19:27:30 +0000 https://blogs.mathworks.com/iot/?p=1475

For the last several years, I have been collecting data with ThingSpeak from devices all around my house. I have been tracking temperature, humidity, light levels, outside weather data, my deep... read more >>

]]>
For the last several years, I have been collecting data with ThingSpeak from devices all around my house. I have been tracking temperature, humidity, light levels, outside weather data, my deep freezer’s temperature, the state of My Toaster, and air quality metrics. I just recently started to think about what all of this data really means to me and if it’s good data to begin with. Wouldn’t it be great if I could explore my data in ThingSpeak?  Well, I am happy to say that with the latest upgrade to ThingSpeak, you can do just that.

We have been working with the MATLAB team at MathWorks to provide two new ThingSpeak Apps: MATLAB Analysis and MATLAB Visualizations. With these new built-in Apps, the ThingSpeak web service can automatically run MATLAB code. That makes it easier to gain insight into your data.

ThingSpeak MATLAB Apps

With the MATLAB Analysis app, I am now able to turn my home’s temperature and humidity data into dew point. Dew point is important to find out if the environment is comfortable independent of just knowing the temperature alone. If the dew point is too high or too low, your guests may notice their glasses sweating or that they are uncomfortable.

I am also able to clean up my sensor data and filter out bad data and write it back to a new ThingSpeak channel. From time to time, I see one of my sensors report a really high value, and I’d like to have a way to fix it.

We have provided many MATLAB code examples to get started quickly.

Some of our analysis examples include:

  • Calculate Average Humidity
  • Calculate Dew point
  • Convert Celsius to Fahrenheit
  • Eliminate data outliers
  • Convert Fahrenheit to Celsius
  • Calculate hourly max temperature
  • Replace missing values in data

With MATLAB Visualizations, we made it way easier to chart data from multiple data fields. By selecting the “Wind Velocity” example MATLAB Visualization, I can see a plot of the wind velocity data collected by my weather station.

MATLAB Plot Output on ThingSpeak

Other visualization examples include:

  • View temperature variation over the last 24 hours using a histogram
  • Plot wind velocity over the last hour using a compass plot
  • Understand relative temperature variation
  • Plot data from multiple fields
  • View temperature and pressure levels
  • Visualize relationship between temperature and humidity

Are you looking for an easy way to connect your Arduino or Raspberry Pi devices to ThingSpeak? We have also been working with the MATLAB team at MathWorks on some Hardware Support Packages to help with that. I’ll talk about that in a future blog!

This is really big news for the ThingSpeak Community. I am really excited to see what you do with these new apps. I will share projects on the blog as they come in. Let’s find out together what all of this data means. Get started at ThingSpeak.com!

 

]]>
https://blogs.mathworks.com/iot/2015/08/20/you-have-collected-lots-of-iot-data/feed/ 2