Cloud-based People Counter Using MATLAB and ThingSpeak

Over the weekend, I noticed a tweet about a people counter using MATLAB and ThingSpeak being demonstrated at Big Data Spain. They were able to detect over 1,500 visitors at their demo station.

People Counter using MATLAB and ThingSpeak

The project uses MATLAB to create a cloud-based people counter by detecting faces with the Computer Vision System Toolbox™. The raw people count is then sent to the ThingSpeak IoT platform for data collection in the cloud and further data analysis.

Check out File Exchange to learn how to build your own people counter using MATLAB and ThingSpeak.

MATLAB Toolboxes are Now Available on ThingSpeak for IoT Analytics

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.

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.

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

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

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 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 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.


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!

Uber Ride Analysis with ThingSpeak and MATLAB

Have you ever wondered how long it will take to get an Uber at your location? This project uses ThingSpeak to log the ETA for an Uber service based on your latitude and longitude. We will use ThingSpeak’s MATLAB Analysis and TimeControl apps to track Uber’s ETA over time.

Uber Ride Estimate

The Uber API allows you to pass a latitude and longitude to determine the estimated time of arrival for an Uber car. The API also allows you to schedule a car. I have made a button that requests an Uber car and also schedules an Uber at the right time.

MATLAB Analysis Code

% Read the ThingHTTP for 'Uber Ride Estimate'
data = webread('')

% Convert the response to a number
eta = str2num(data);

% Write the data to the 'Uber Ride Estimate Data' ThingSpeak Channel

Each time the MATLAB Analysis code is executed, it will write the estimated time of arrival (ETA) for Uber to your ThingSpeak channel. To track the ETA over time, schedule the MATLAB code with TimeControl. I am running the code every 5 minutes to get an idea of when the peak times are for Uber to pick me up at my office in Natick, MA. Check out the ThingSpeak channel number 840700 to see the estimated times.


Step-by-step project details are available at

Send Messages From Devices to Slack Using ThingSpeak [tutorial]

Slack is a team collaboration tool to make your work life simpler. It is an extremely popular way to receive messages from team members all in one place and integrate with external web services. One possible integration is with ThingSpeak. ThingSpeak is an open data platform for the Internet of Things. Devices all around the world are using ThingSpeak to collect data from sensors and send data to apps and other devices. In the not too distant future, things will be a part of your team. Relevant equipment statues, sensor readings, and updates will inform decisions and will be shared among team members and other Slack services.

Arduino Slack ThingSpeak

By following our tutorial, you will be able to use ThingSpeak to send messages to your team’s Slack channel. This will also allow devices like an Arduino to use Slack since ThingSpeak will take care of authentication and HTTPS.

Arduino WiFi 101 ThingSpeak Data Uploader Tutorial

Arduino has published a tutorial for their WiFi 101 Shield that sends data to ThingSpeak. The Arduino WiFi Shield 101 is a powerful Internet of Things shield with crypto-authentication that connects your Arduino or Genuino board to the internet using WiFi.

Arduino WiFi 101 ThingSpeak

You only need a few things to build a light and temperature sensor that writes data to ThingSpeak:

  • Arduino Zero or Uno Board
  • Arduino Wifi Sheild 101
  • Photocell
  • Temperature Sensor (This example uses a TMP36)
  • 10K Ohm Resistor


Once you have the circuit built, you create a ThingSpeak channel, connect the Arduino WiFi 1010 to your Wi-Fi network, and install the source code from the tutorial on the Arduino.

Data is now being sent to your ThingSpeak Channel. Go to your channel to see two charts of the light and temperature data. To take the project a step further, go to ThingSpeak Apps and use MATLAB to analyze and visualize and trigger actions from the data.