Tutorial Worksheet

https://goo.gl/XAFkJi

Tutorial Worksheet

https://goo.gl/XAFkJi

Tutorial Worksheet

https://goo.gl/XAFkJi

MathWorks Products

ThingSpeak

The open IoT Platform with MATLAB® Analytics

 

  • Any device can send data (REST)
  • ThingSpeak Communication Library                
  • Simulink Blocks
     
  • Live Visualizations as data comes in
  • Base MATLAB is built in – no license required
  • MATLAB code scheduled to run regularly
  • Visualizations generated on demand
     
  • Store derived data
  • Send Commands to devices
  • Tweet and make other REST calls              

Analyze

Collect

Act

1000s of Users Worldwide

Tutorial Worksheet

https://goo.gl/XAFkJi

Explore Live Data

  1. Live environmental data from the room
    https://thingspeak.com/channels/132207

  2. Gallery of live weather analysis
    https://thingspeak.com/channels/52682

  3. Live agricultural analysis data
    https://thingspeak.com/channels/30040

  4. Custom Live Data Dashboard
    http://community.thingspeak.com/demo

Tutorial Worksheet

https://goo.gl/XAFkJi

Tutorial Worksheet

https://goo.gl/XAFkJi

Tutorial Worksheet

https://goo.gl/XAFkJi

Analyze Traffic Data

Set up your ThingSpeak account

  1. Go to https://thingspeak.com/

  2. On the upper left, click "Sign Up"

  3. Pick a userID, enter your email, and set a password

Tutorial Worksheet

https://goo.gl/XAFkJi

Analyze Traffic Data

Summarize one day of data from the car counter

  1. At top bar, choose "Apps" and then "MATLAB® Visualizations"
  2. Click "New", choose "Custom (no starter Code)", and click "Create"
  3. In the "Name" field, enter a name such as "My Car Counter Analysis"
  4. In the "MATLAB Code" section, enter the code below:

    % Get the latest readings from the car counter
    disp('Latest readings from the car counter')
    thingSpeakRead(38629)
  5. Scroll down and Click the "Save and Run" button.  You'll see the latest readings from the car counter

Tutorial Worksheet

https://goo.gl/XAFkJi

Analyze Traffic Data

Summarize one day of data the car counter

  1. Erase your old code and enter the following:
    % Get data from the last 24 hours
    rte9Data = thingSpeakRead(38629,'NumDays',1,'OutputFormat','table');
    % Calculate the median number of east bound cars in the past day
    disp('Median number of east bound cars in the past day') median(rte9Data.NumberOfEastboundCars)
  2. Scroll down and Click the "Save and Run" button.  You'll see the median number of cars that went eastbound in the past day

Tutorial Worksheet

https://goo.gl/XAFkJi

Analyze Traffic Data

Plot hourly rates over the course of a day

  1. Erase your old code and enter the following:
    % Get data from the last 24 hours
    rte9Data = thingSpeakRead(38629,'NumDays',1,'OutputFormat','table');
    % Group the data by hour of day, and sum readings within each hour
    ​hourOfDay = floor(hours(timeofday(rte9Data.Timestamps)));
    [G, hourOfDay] = findgroups(hourOfDay);
    eastBound = splitapply(@sum, rte9Data.NumberOfEastboundCars, G);
    % Plot the east bound volume by hour
    plot(hourOfDay, eastBound)
    % Feel free to customize the title
    title('East bound hourly traffic volume')
  2. Scroll down and Click the "Save and Run" button.  You'll see the median number of cars that went eastbound in the past day

Tutorial Worksheet

https://goo.gl/XAFkJi

Now What?

Tutorial Worksheet

https://goo.gl/XAFkJi

Prototyping IoT Analytics: Hands on with ThingSpeak™ and MATLAB®

By Rob Purser

Prototyping IoT Analytics: Hands on with ThingSpeak™ and MATLAB®

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.

  • 1,056