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.
ThingSpeak has APIs for collecting data produced by sensors and APIs for reading that data from applications. Think of an IoT project as two parts. One part of the project is where you need to program a thing to send data. And, the second part is where you want to see that data. ThingSpeak sits in the middle and makes it handy to do both, as Marcelo Rovai points out. Once you have a system like Marcelo’s set up, you can take advantage of integrated online MATLAB Analytics.
Marcelo has put together a great tutorial that uses ThingSpeak in the middle to collect data from sensors and then display the sensor readings on a custom Android app running on a mobile phone. He uses the MIT App Inventor to create a custom Android app to see the sensor data and status of the system. This project uses easily accessible hardware to build a proof-of-concept IoT system to monitor air temperature, humidity, soil temperature, soil humidity, and luminosity. Other people could modify this project with different sensors or actuators and build something for their own purposes or build a prototype for your next meeting at work.
Check out the full project tutorial on Arduino Project Hub and Instructables. Marcelo provides all of the parts, code, and instructions to make your own prototype IoT system monitored and controlled by a mobile app.
The ThingSpeak IoT service now supports MQTT subscriptions to receive instant updates when a ThingSpeak channel gets updated. MQTT is a powerful standard for IoT systems. ThingSpeak enables clients to update and receive updates from channel feeds via the ThingSpeak MQTT broker. MQTT is a publish/subscribe communication protocol that uses TCP/IP sockets or WebSockets. MQTT over WebSockets can be secured with SSL. A client device connects to the MQTT broker and can publish to a channel or subscribe to updates from that channel.
MQTT in MATLAB
We also published a new File Exchange submission that allows you to publish and subscribe using MQTT within MATLAB. Download and install MQTT in MATLAB to be able to connect to ThingSpeak’s MQTT server or connect to other standard MQTT brokers such as AWS IoT. Using this Add-On in MATLAB allows you to define custom functions to evaluate on receiving messages streaming over subscribed topics.
ThingSpeak MQTT Examples
- MQTT Basics – Learn about the publish/subscribe architecture for connecting bandwidth and power-constrained devices over wireless networks.
- Choose Between REST API and MQTT API – Learn when to use REST and MQTT to update a channel.
- Publish to a Channel Using Desktop MQTT Client – Publish to a channel using desktop MQTT client such as MQTT.fx.
- Publish to a Channel Using Arduino Client – Publish data to a ThingSpeak channel using an Arduino® device.
- Publish Using Particle Photon Client – Publish data to a ThingSpeak channel using a Particle Photon device.
- Publish Using WebSockets in Python on a Raspberry Pi – Publish data using WebSockets to a ThingSpeak channel.
- Subscribe to Channel Updates Using Desktop MQTT Client – Subscribe to channel updates from a ThingSpeak channel using desktop MQTT.
- Subscribe to Channel Updates Using Particle Photon Client – Subscribe to a ThingSpeak channel using a Particle Photon device.
View our ThingSpeak MQTT documentation to learn more about MQTT support on ThingSpeak, and find examples for Arduino, Particle, and Raspberry Pi.
Naman Chauhan from SRM University created a proof-of-concept project that measures your resting heart rate and sends the data for analysis via a $5 Wi-Fi device. The project is fully documented with the source code on either Hackaday or Hackster.
Naman uses an Arduino for processing the heartbeat data and turns the data into heartbeats per minute. Then, periodically, the device sends the data to ThingSpeak for data storage and data analysis using MATLAB. The heart rate monitor is connected to the internet using DFROBOT’s ESP8266 Wi-Fi Bee. The Wi-Fi Bee turns serial data-to-Wi-Fi.
This heart rate monitor sensor is a pulse sensor which is developed based on PPG techniques. This is a simple and low-cost optical technique that can be used to detect blood volume changing in the microvascular bed of tissues. It is relatively easy to detect the pulsatile component of the cardiac cycle according to this theory.
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.
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.
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.
- Developing an IoT Analytics System with MATLAB, Machine Learning, and ThingSpeak – MathWorks Technical Article by Robert Mawrey
- Measure and Analyze Tide Levels with ThingSpeak and MATLAB – Hackster tutorial
- TideAlerts.com – Robert’s website dedicated to the exploration of tides