Return to IoT Kits

9. MATLAB Scripts

The ThingSpeak Internet of Things platform provides free access to the powerful MATLAB programming environment. MATLAB scripts let you visualize, analyze, and manipulate data from your ThingSpeak channel.

Some scripts used on my ThingSpeak channel are listed below. You can add these visualizations to your ThingSpeak channel by entering your channel ID and API Read Key into the script.

This link provides instructions for using MATLAB with ThingSpeak:

Follow this link to see live data from the IoT Kits D1M-WX1 Weather Station in Centreville, Virginia, USA.

Permanent link to this article: https://w4krl.com/iot-kits/matlab-scripts/

Current Weather – Imperial Units

This MATLAB visualization shows current values from your weather station in conventional US units. The values are taken from your ThingSpeak channel at the time your webpage is opened. You must manually update the chart by refreshing your browser. % Displays Current Imperial Values in a Text Box % Formatted for IoT Kits Weather Stations …

Current Weather and Zambretti Forecast

This MATLAB visualization shows current values from your weather station in metric and conventional US units. The barometric pressure and trend are used to make a Zambretti weather prediction good for about 12-hours. The values are taken from your ThingSpeak channel at the time your webpage is opened. You must manually update the chart by …

Temperature and Dewpoint

This MATLAB visualization calculates the dewpoint from temperature and humidity. The formula is given at https://en.wikipedia.org/wiki/Dew_point. The values are taken from your ThingSpeak channel at the time your webpage is opened. You must manually update the chart by refreshing your browser. % Read Humidity and Temperature from a ThingSpeak channel to calculate dew point. % …

Light Intensity and Cell Voltage

This MATLAB visualization overlays light intensity on cell voltage. The values are taken from your ThingSpeak channel at the time your webpage is opened. You must manually update the chart by refreshing your browser. % Light and Vcell 286120 % Plot of light intensity and cell voltage overlayed on separate axes % Axes are NOT …

Barometric Trend

This MATLAB visualization displays the latest three hours of barometric pressure and determines the trend based on the pressure difference over the three hours. The values are taken from your ThingSpeak channel at the time your webpage is opened. You must manually update the chart by refreshing your browser. % Displays 3 hours of barometric …

Signal Strength Histogram

This MATLAB visualization displays the incidence of WiFi signal strength received by your weather station over the most recent 24 hours. % Signal Strength Histogram % (C) 2020, Karl Berger % 5 July 2018 %%% ENTER YOUR CHANNEL ID readChannelID = 286120; % Signal Strength Field ID signalStrengthFld = 7; %%% ENTER YOUR READ API …

Time Awake Histogram

This MATLAB visualization displays the D1 Mini time awake for each reporting cycle over the most recent 24 hours. It calculates the total awake time and the average awake time per cycle. % Microporocessor time awake histogram % (C) 2020 Karl Berger % IoT Kits %%% ENTER YOUR CHANNEL ID chID = 286120; %%% ENTER …