25
Sep 16

Use MATLAB ‘timetable’ to Merge ThingSpeak Data Channels

We released a new version of MATLAB® and it’s available now for every ThingSpeak user. MATLAB R2016b includes many new features that make it easy to work with time-stamped tabular data, manipulate, compare, and store text data efficiently, and find, fill, and remove missing data.

With multiple sensors around my house or office, I want to be able to send data to multiple ThingSpeak channels. But, when I want to perform data analysis, I have a hard time working with data from multiple channels. The channels do not have the same time stamps and are out-of-sync with each other.

With R2016b of MATLAB, I am able to use the new timetable data container. Once the data is a stored as a timetable, I can perform powerful operations such as retime, synchronize, and rmmissing.

In this example, I have two sensors outside of my office here in Natick, MA. One sensor is a temperature sensor that is sending data to ThingSpeak channel 163540. My other sensor is writing humidity data to channel 163545. Both channels are public. My goal is to plot temperature versus humidity over one time series. To accomplish this, I will use timetable and synchronize inside of a new MATLAB Visualization on ThingSpeak.

% Read from the temperature channel
temperatureTT = thingSpeakRead(163540,'Fields',1,'NumPoints',100,'outputFormat','timetable');

% Read from the humidity channel
humidityTT = thingSpeakRead(163545,'Fields',1,'NumPoints',100,'outputFormat','timetable');

% Synchronize two timestables and fill in missing data using linear interpolation
TT = synchronize(temperatureTT,humidityTT,'union','linear')

% Plot Temperature and Humidity over time
plotyy(TT.Timestamps,TT.Temperature,...
       TT.Timestamps,TT.Humidity);
        
title('Temperature and Humidity Synchronized From Two Channels')
xlabel('Temperature and Humidity in Natick, MA')
legend('Temperature','Humidity')

The first part of the script reads in ThingSpeak data from two different channels and stores the data in two timetables. Once the data is stored in a timetable, I am able to take advantage of synchronize. With synchronize, I can combine both timetables with one time series and fill in missing data using linear interpolation. This results in a plot that shows my data over time without any missing data. To create the plot, I signed into ThingSpeak, selected Apps, and created a new MATLAB Visualization with my MATLAB code.

All ThingSpeak users are able to try this example or explore the other new MATLAB features directly on ThingSpeak. I will leave my temperature (163540) and humidity (163545) channels public, so you can try out timetable example without having to connect devices to ThingSpeak.



09
Sep 16

Forgetting Something on Your To Do List? Use MATLAB to Analyze Your Tasks.

Allie Fauer, a designer from New York, has released another awesome Instructable tutorial on how to build a “To Do List Reminder Light”. This project is very creative and easy to build on your own. Allie tracks her tasks on an app called Todoist. With a little help of the MATLAB Analysis app on ThingSpeak, Allie is able to analyze her tasks and alert herself of anything overdue. She gently reminds herself with a glowing “Remembrall” globe.

To Do List Reminder Light

Allie uses the MATLAB Analysis app on ThingSpeak to check her to do list and see if anything is overdue. If a task is overdue, the MATLAB code writes the task overdue into a ThingSpeak channel. The MATLAB code is very straightforward and does a bit of analysis on her task list to see what is overdue. To get the MATLAB Analysis code to keep checking her task last, she schedules the MATLAB code using the TimeControl app on ThingSpeak.

Allie also has other ideas on how to make use of her status light:

  • Alert you when you’ve forgotten to water your plants
  • Tell you when you’re out or range of important objects like your keys or wallet
  • Combine with IFTTT to alert you when you’ve forgotten to respond to emails or phone notifications

To build your own Remembrall light, follow the step-by-step tutorial on Instructables.



25
Aug 16

Introducing MATLAB Central…

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.



15
Aug 16

The Top IoT Countries (According to ThingSpeak Stats)

2016 has been a huge year for IoT and the growth of ThingSpeak. We are looking at where our users and visitors are coming from and we are seeing some surprising trends. India alone represents 10% of ThingSpeak traffic and usage. The countries of Europe make up over 35% of ThingSpeak. Poland is also a strong IoT country. We have noticed many public weather stations and radiation detectors popping up all around the country. Poland by itself represents 3% of our traffic and usage. The last surprise is Australia dropping out of the Top 10.

Top IoT Countries 2016

The Top 10 Internet of Things Countries*

  1. United States
  2. India
  3. Germany
  4. United Kingdom
  5. Italy
  6. Brazil
  7. France
  8. Poland
  9. Canada
  10. Spain

*According to ThingSpeak Usage Stats



25
Jul 16

Analyzing Squirrel Behaviour and Weather Forecasting with MATLAB and ThingSpeak

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.

 



09
Jul 16

Prototyping IoT Analytics with MATLAB and ThingSpeak

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



24
Jun 16

What Do Students Need to Learn to Be Successful in IoT?

I will be joining a panel at the ASEE’s 123rd Annual Conference in New Orleans. The goal of our panel is to discuss what students need to learn to be successful in IoT. Our session is Tuesday, June 28th, 2016 at 1:15pm in Room 261 at the New Orleans Convention Center.

ASEE IoT Conference 2016

The IoT panel at ASEE will be moderated by Dr. Gerald W. Recktenwald and features Dr. Jacob Segil from the University of Colorado, Boulder, Dr. Duncan James Bremner P.E. from the University of Glasgow, and Hans Scharler from MathWorks.

American Society for Engineering Education Conference

New Orleans Convention Center
900 Convention Center Blvd
New Orleans, LA

T426·IoT: What Do Students Need to Learn to Be Successful in this Field?
Tuesday,  June 28, 2016 1:15 PM to 2:45 PM

 



06
Jun 16

Weather Station with Particle, SparkFun, ThingSpeak, and MATLAB

[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]



27
May 16

IoT Quick Start With the Arduino MKR1000 and ThingSpeak

If you are looking to start with the Internet of Things, then try out the Arduino MKR1000 and connect it to the ThingSpeak IoT Platform. We have put together a complete tutorial that uses the MKR1000 to collect data about your Wi-Fi signal and send it to ThingSpeak for storage, analysis, and visualization.

Arduino MKR1000

The Arduino MKR1000 is a great starting point when learning about the “things” in IoT. The MKR1000 has a microcontroller, Wi-Fi module, encryption module, and a battery-charging circuit. It’s easy to get started and once you get it connected to ThingSpeak, you have a lot of “cloud power”. ThingSpeak has a suite of apps to allow the Arduino to post messages to Twitter, do data analysis, show charts and visualizations, and be controlled by schedules and external events. With these building blocks you can prototype any IoT system.

ThingSpeak Channel Data

Once you have your data on ThingSpeak, you can analyze and visualize the data with built-in MATLAB apps.

[via ThingSpeak Tutorials]



21
Apr 16

ThingView – Mobile App to See ThingSpeak Charts on Android Devices

Cinetica has released to Google Play, a new app to see ThingSpeak charts on Android smartphones and tablets. The app is called ThingView and has already reached 5,000 installs on Android devices!

ThingView Android App for ThingSpeak Charts

Even if you do not have devices and sensors sending data to ThingSpeak, you can still use ThingView to see public channels. For example, if you want to see the charts created by sensors in my house, just add Channel ID 9 to ThingView. You see charts of light levels and temperature generated by my house.

Check out ThingView on Google Play!