Hans on IoT

ThingSpeak, MATLAB, and the Internet of Things

Building a Dynamic and Self-organizing Network of Devices

Posted by Hans Scharler,

Anders Sollander, a principal technical consultant at MathWorks, and his team put together a project to determine what demo was the most popular at one of our demo showcases. Anders made an assumption that if your demo was popular, you would have a lot of visitors. If you have a lot of visitors, your demo would be the loudest.

Anders was determined to measure sound from over 20 demo stations at the same time and figure out who the the winner is. This turns out to be a complicated challenge and he used our tools such as MATLAB, Simulink, and ThingSpeak, to produce some interesting results. Here’s what the raw data looks like from just five sound sensor nodes at the demo stations.

The sensor nodes uses the Arduino Nano devices because they’re small, low-cost, and Simulink has an Arduino support package. Arduino Nano’s both low cost and energy efficient which is great, but it doesn’t have Wi-Fi. They connect the sensor nodes to an Internet-connected Raspberry Pi using an RF mesh network with the nRF24l01+ radio. The RF24 solution is both very cheap and energy efficient, which is valuable if you’re running them with battery power. Simulink Coder has a Raspberry Pi Support Package which simplified the workflow.

When you follow the tutorial, you are going to learn many things and experience their analytic workflow as they decide how to develop an algorithm to normalize sound levels, determine which data to send to ThingSpeak, and build visualizations to see the results of the project.

Anders also shared a library on File Exchange that allows users to communicate with RF24 chips on Raspberry Pi and Arduino boards. The library relies on the RF24Mesh library, and has S-functions that interact with the classes there. The File Exchange submission includes an example for the Arduino to read sensor data from a temperature sensor and sends it to the gateway Raspberry Pi and then sends the data to ThingSpeak. In order to download the File Exchange, you need to sign in with your MathWorks account. This would be the same account that you use on ThingSpeak.com.

Visit ThingSpeak Tutorials, to see the complete tutorial for Building a Dynamic and Self-organizing Network of Devices.

Add A Comment

What is 1 + 8?

Preview: hide