Hans on IoT

ThingSpeak, MATLAB, and the Internet of Things

Staying Connected with CheerLights and ThingSpeak

This time of year is about staying connected, maybe more so this year than with previous years. CheerLights is an IoT project to share some of the connections through synchronized lights. All of the lights connected to the CheerLights feed hosted on ThingSpeak stay in sync. The lights all shine with the same color. Now, the fun part, anyone can change the color using Twitter. Just send a tweet to @CheerLights and mention a color. This will send the color to lights all around the world!

If you are just learning about the Internet of Things, you can use CheerLights as a Hello World project to get started. Once you learn how CheerLights works, you can learn how to build on top of it and create new connected projects.

CheerLights are back at MathWorks. While everyone is learning, working, and living from home, we wanted to install CheerLights at the MathWorks campus in Natick, MA. We also installed a camera for anyone to check out the lights no matter where you are. They look awesome at night and even better with a lot of snow.

Our lights at MathWorks include a sparkling effect to display the latest color. You might have noticed that effect on our live webcam. The WS2811 RGB LED strips are connected to ThingSpeak using a Particle Argon Wi-Fi device. The open-source code for this effect is on GitHub. Let us know if you try it out.

You have two options to get the latest color: HTTP and MQTT. It’s easy to get the latest color using HTTP, just send a GET request to this address: https://api.thingspeak.com/channels/1417/fields/1/last.txt, since CheerLights is using channel 1417 and the color name, is in field 1. You will need to keep checking this address to get the latest color. If you use MQTT, you can subscribe to the channel and your device will get updates when the color changes. Check out ThingSpeak Documentation to learn more.

Since each color is being stored in a ThingSpeak channel, we can use MATLAB to do some IoT analytics on the CheerLights channel. As of today, the most popular color requests have been red, white, and pink in the past month. But, the color that tends to stay the longest is cyan! I wouldn’t have guessed that. It is always nice to use a tool like MATLAB to find something out rather unexpected.

To learn how to build your own set of CheerLights and to join the project, check out CheerLights.com. Let us know what you build and how you use this project in the comments.

Stay healthy. Stay connected.

  • print


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.