CheerLights for Raspberry Pi Zero W and Blinkt!

Well, it’s that time of year… CheerLights time of year! I started CheerLights back in 2011 with one set of lights. Now there are lights synchronized all over the world and the project gets popular around the holidays. The idea behind CheerLights is to show how we are all connected. We are in this together. When someone changes the CheerLights color (via Twitter), all of the connected lights also change to that color.

For this season, I wanted to try out the Blinkt! kit from Pimoroni. I really what I am seeing from Pimoroni. Their starter kits and accessories for the Raspberry Pi are really well designed, colorful, and useful. If you are in the US, some of the Pimoroni kits are on Amazon.

Pimoroni Raspberry Pi Zero W Starter Kit

I do recommend the Pimoroni Raspberry Pi Zero W Starter Kit if you are using the Raspberry Pi Zero W for the first time. The main reason for using a starter kit is that the ports on the Raspberry Pi Zero W need some adapters. You need to get a mini to full-size HDMI adaptor and a Micro-USB adapter to be able to connect a monitor, keyboard, and mouse to the Raspberry Pi Zero W. The kit also includes a 16GB micro-SD card with an operating system pre-loaded.

Connect a monitor, keyboard, and mouse to the Raspberry Pi Zero W and connect the USB cable to a reliable 5V USB power supply and you are ready to start programming.

Raspberry Pi Zero W with Blinkt! LED Strip

I followed Pimoroni’s getting started tutorial to install the Blinkt! python library. The Blinkt! board is a strip of LEDs that sit on top of the Raspberry Pi’s GPIO pins. Blinkt! is a cool way to get started with controlling things with the Raspberry Pi. Consider turning on the LEDs for the first time using code as your “Hello World” program for physical computing.

After connecting your Raspberry Pi Zero W to your Wi-Fi network, open a terminal window and enter the following comment to install the Blinkt!~ libraries (type ‘y’ or ‘n’ when prompted).

curl https://get.pimoroni.com/blinkt | bash

Create a new file in your home directory called “cheerlights.py”. This file will contain the code that gets the latest CheerLights color on ThingSpeak and sets the color of the Blinkt! LEDs. Copy this code into the “cheerlights.py” file and save it.

python cheerlights.py

After a few seconds, you should see the latest CheerLights color on the Blinkt!

To keep the “cheerlights.py” running all of the time, you need to add the script to crontab. This will make the script stays running in case of an error or reboot of the device.

sudo crontab -e

Then, add this line to the end of the crontab file and save the file.

@reboot sleep 60 && sudo python /home/pi/cheerlights.py

A couple of years ago, I noticed that a maker space along with Qwirkshop created a desktop light kit for the Raspberry Pi Zero W and Blinkt! board. The kit was sold for a brief time on Etsy and I picked up a few kits. Well, I just found them in my storage closet! The kit is a bunch of laser cut pieces that you assemble together. It is an ingenious kit in that it was designed in layers and holds together with no glue. The results were beautiful.

Let me know if you build something to display the latest CheerLights color. I am always looking for new ideas for the CheerLights blog.

Let’s stay connected!

Adafruit Matrix Portal LED Display Diffused Acrylic Stand

I bought some parts over at Adafruit to build some ThingSpeak and CheerLights projects. If you know me, I am always attracted to multicolored lights and even more so around the holidays. Adafruit has simplified the way to work with LED matrix panels by offering a new device called the Adafruit Matrix Portal. The Matrix Portal connects to any HUB-75 compatible LED display and gives you Wi-Fi control, USB-C power, an accelerometer, and a processor to help you create animations and graphics. With all of these options, you can build anything from an On-Air sign to a kinetic sand toy.

LED panels are really bright without a diffuser. You can buy a diffuser to enhance the look of the display… if you remember to buy one. I found an 8×10 clear document frame stand at my house and remembered that I have Rust-Oleum Frosted Glass Spray Paint the I used for my arcade cabinet project. I sprayed on three coats of the frosted glass spray while allowing for each coat to dry for about 15 minutes.

Before and after applying the frosted glass spray

As an added bonus, the document frame also doubled as a stand for the Matric Portal display. The frosted glass enhancement turned out really well and greatly enhances the look of the LEDs.

Take a look at what Adafruit’s LED Sand demo looks like behind the diffused acrylic stand.

Adafruit Matrix Portal Sand Demo

‘On Air’ Light for Microsoft Teams and Zoom Meetings

Back in the 90’s, the 1990’s, I used to be a late-night radio show host on Froggy. I was known as Jeremiah Bullfrog. When I left the radio business to start my own software company, Troy, the head engineer, gave me a parting gift – an ‘On Air’ light. Our company had remodeled and consolidated studios and lots of surplus gear had accumulated. I had the On Air light on my office shelf for over 20 years. With the recent events, I came up with a project to put the On Air light to use.

On Air Light

Along with the rest of the world, I have been working at home for the past couple of weeks. All of my meetings are now online/virtual ones and we use Microsoft Teams and Zoom. We also use video to better facilitate a connection and help us focus on the meeting. The camera that I have doesn’t have a light indicator showing whether it is in use. So, I put two and two together and come up with a remote controllable ‘On Air’ light for online meetings. It was the perfect project to entertain my three-year-old for a few hours. He was delighted every time the light turned on.

George helping me hack the ‘On Air’ light in my shop

George and I ripped apart a Sunbeam Touch Light that I got for $1 in a surplus sale. This light had a strip of LEDs, a controller, and a power supply. I just added an ESP8266 module and connected it to ThingSpeak using my tutorial that I published a few years ago. I wrote a little Visual Basic.NET script based on a project that I found on CodeGuru to detect whether or not the webcam was in use or not. If it’s in use, the script sends a signal to ThingSpeak to turn on the light.

Real-time Colors on CheerLights

CheerLights now supports the MQTT protocol. This means that devices and apps can receive real-time updates to changes in the CheerLights color without polling for the latest color.

How to use MQTT

Connect your device to mqtt.cheerlights.com:1883 and subscribe to the “cheerlights” topic. When the CheerLights color changes, the color name will be streamed to your device. You no longer have to poll for the latest CheerLights color on the ThingSpeak API.

Here are the valid color names:

  • red (#FF0000)
  • green (#008000)
  • blue (#0000FF)
  • cyan (#00FFFF)
  • white (#FFFFFF)
  • oldlace / warmwhite (#FDF5E6)
  • purple (#800080)
  • magenta (#FF00FF)
  • yellow (#FFFF00)
  • orange (#FFA500)
  • pink (#FFC0CB)

Check out the CheerLights API documentation for more detail.

Star Wars R2D2 Lamp on Twitch

This news is just in time for an R2D2 Lamp live streaming on Twitch.

Lovebox: Internet of Things for Valentine’s Day

It’s that time of year again… It’s time to show the person who you love how much you love them with an internet-connected gift. I got aggressively marketed to on Facebook to purchase something called the Lovebox. How did the Facebook algorithm know that I would be interested in an IoT device that displays messages? I got the Lovebox two days after I ordered here in the US shipped directly from France where the startup is based. The whole experience was excellent.

The Lovebox is an internet-connected device that displays messages that you write using their mobile app (for iOS and Android). Here’s what it looked like on my app. I got a flood of hearts on my screen when Becky acknowledged the receipt of my message.

The Lovebox rotates the heart on the front to tell the recipient that there is a message waiting. They open the lid to see the message. The device is sitting comfortably in my wife’s office. I love the idea of being able to send a notification to her without it being a text message.

The idea of the Lovebox is simple, but it is perfectly executed. I was quite impressed with the mobile app, the setup experience, and its utility. Love is all over every aspect of this device and system. Check it out on Lovebox.love.  C’est si bon.

(My) History of the Internet of Things

Back in 2007, Jason Winters and I started working on what would become ioBridge, RealTime.io, and ThingSpeak. The phrase “Internet of Things” got added to the discussion when Richard MacManus resurrected it from the RFID days in the late 90s and applied it to companies like ourselves in a 2009 article in the New York Times. Jason and I had experience with projects going viral such as a remote-controlled tractor with a webcam and an aquarium with real-time controls and monitoring. “Jason’s Fishcam” had sensors reporting temperature on a webpage and an interactive gator inside the aquarium. People used to watch the fish and control the gator mouth.

Jason’s Fishcam (January 2006)

The “Slashdot Effect” used to crush our homespun servers and render our projects useless for a period of time. Jason had the idea of moving the “control” part of our projects to the web. If all commands routed to and from a web server instead of going directly to a device, then we could control which commands went through, secure the connections using SSL, create access lists, and change things on the fly. This idea became our obsession for over a decade with several patents, licenses, open source projects, and customers from all over the world to show for the effort. We still work on large-scale IoT, Internet of Things for short, projects and have helped companies of all sizes reduce costs, predict equipment failures, and bring about connected products that serve a purpose.

“Twitter for Things” Demo App

When I first heard about Twitter back in 2006, I thought this is a perfect idea for things. Why would a human want to post short statues? Devices have a lot to say. “The HVAC system just turned on.” “The conveyor is drawing 3.1 amps.” “SYSTEM FAILURE: Code 87643.” If a web application could capture these messages, then the messages could be used for analysis. Jason and I started ioBridge in July of 2008 and built a scalable out-of-the-box solution plus a hardware dev kit. The only issue is that we only knew 30 people that were interested in the aquarium project. We sent an email to all 30 people and one person named Pete purchased a dev kit. He built a monitoring system for large aquariums in the Baltimore area. The next wave of users and customers didn’t come until Stephen Myers created an interactive pet treat dispenser for his dog. Stephen didn’t have an aquarium, but he did have a dog. Everything is a remix. Stephen blogged about his project on December 3, 2008, and his project got picked up by “The Unofficial Apple Weblog” since he used the iPhone as the controller.

iPhone Controlled Pet Treat Dispenser (December 2008)

To demonstrate the idea for a “Twitter for Things” to investors, I created @MyToaster – a Tweeting Toaster that used our system to send status updates about whether or not it was toasting. I followed Stephen’s idea and blogged about the toaster with my article, “Social Networking for My Toaster” on December 8, 2008, and described in detail how to build your own connected appliance. A few days later, Priya Ganapati picked up the story of MyToaster and wrote an article for Wired Magazine. This project and our company… took off.

First MyToaster Article in Wired Magazine (December 2008)

The toaster allowed me to start conversations with product manufacturers and designers that had ideas for new products. I worked on a number of consumer products and industrial systems that all use the same technology that Jason and I created. The Amazon Echo wouldn’t be possible if the Echo device had to understand all aspects of speech and user intents locally. The web allows Echo to tap into a huge data set that enhances its functionality. ThingSpeak is still going strong. You can still sign up today for a free, non-commercial account and join a community of over 350,000 developers around the world that are all learning about IoT and building new IoT applications.

ThingSpeak System Diagram (December 2010)

Fast forward 10 years, and we are still working on the same thing, but the things are now factories, agricultural systems, windmills, and space probes. I was really happy when Katie Blackley from Pittsburgh’s NPR New Station asked me for an interview and an update regarding the MyToaster that started my journey. It has been 10 years and the toaster still works. It is now outfitted with a Particle Photon and uses the ThingSpeak web service to update its thousands of followers. I am glad she reached out to me as it caused me to reflect a bit about the journey and prompted me to share my history of the Internet of Things.

Appendix: MyToaster

MyToaster has been popular on its own for a long time. I have gotten requests to talk about the toaster on news stations, interviews for magazines, and to have the toaster brought to IoT conferences. Every trade show we did had MyToaster on display. The “touring toaster” was a stand-in and took a lot of abuse over the years.

Another significant event for MyToaster is when the Washington Post posted an infographic on “The Marriage of Appliance and Internet“.

They listed that MyToaster from 2008 was a significant event that shaped “Connected Appliances” and “Consumer Internet of Things Products”.

2008 – @mytoaster joins Twitter. It’s a toaster that Tweets. Hans Scharler rigged up his toaster to his Twitter so the appliance Tweets one of two things: Toasting or Done Toasting.

Time Logo

A man in Pittsburgh, Pennsylvania has rigged his toaster to tweet “Toasting” or “Done Toasting” with each use, and — despite the account’s lack of variety — has gained more than 2,000 followers.

In order to further connect us with our possessions, Scharler and his friend Jason Winters created a platform for developers called ThingSpeak— a sort of Twitter for things — that lets objects send messages, broadcast their location, graph their temperature, and more.

 / Time

Wired Logo

“Tweeting appliances speaks to this whole ‘internet of things’ idea,” says Hans Scharler, a tech consultant who also writes comedy material. “If your appliances were outputting information, it can always go to a database. But we love to share information. So why not find a way to do that?” Scharler found online fame for his twittering toaster, whose tweets alternate between “toasting” and “toast is done.” @mytoaster has about 200 twitter followers.

Priya Ganapati / Wired

Control IFTTT Webhooks with MATLAB

Yesterday, I was building an integration with IFTTT and my Philips Hue lights in my office. I wanted the Philips Hue lights to change to the latest CheerLights color. IFTTT offers a webhook as a trigger, so I decided to use MATLAB to trigger the webhook. MATLAB will get the latest CheerLights color, then send it to IFTTT and IFTTT sends the color to Philips Hue.

When I created the IFTTT webhook, IFTTT presented a CURL example:

curl -X POST -H “Content-Type: application/json” -d ‘{“value1″:”green”}’ https://maker.ifttt.com/trigger/mwOffice/with/key/xxxyyyzzz

Here’s how to turn the CURL request into a MATLAB command:

webwrite(‘https://maker.ifttt.com/trigger/mwOffice/with/key/xxxyyyzzz’,’value1′,’green’);

Check out the IFTTT documentation for more information.

ThingSpeak at the Boston TechJam

I recently got the change to give a ThingSpeak IoT demo at Boston TechJam. MathWorks is one of the sponsors so we got to participate with other tech companies and over 8,000 students and entrepreneurs from Boston. My demo used MATLAB to detect multiple faces from a live stream of video. The MATLAB analysis code sends the count to a ThingSpeak channel. I used the new ThingSpeak gauge widget to show how many people stopped and participated in the demo.

To learn how to build a ThingSpeak People Counter with MATLAB, check out File Exchange. To learn about the new ThingSpeak gauge widgets, check out the MathWorks Documentation for ThingSpeak or the MathWorks IoT Blog. Thanks for stopping by!

Getting Ready for the Bay Area Maker Faire!

I have a lot of favorite times of the year. I get excited about the holidays, weekends, evenings, and days. I am usually filling each day with something new and/or pushing a project further along. One of my favorite events is the Bay Area Maker Faire. Imagine over 120,000 makers, hackers, builders, engineers, and students putting on the world’s biggest show-and-tell? You will see things that spark new ideas and you will see giant robotic giraffes.

You never know who you are going to run into. I was so happy to meet one of the first users of ThingSpeak! This is Andy Leer of Leer Media. Andy was introduced to my IoT projects back in 2008 at Hack Pittsburgh! He was instrumental in me being able to kickstart my startup and help support my growing community. Andy provided meeting space for my IoT Meetup in Pittsburgh.

A couple of the Mythbusters also showed up at the Bay Area Maker Faire. I got to talk about MathWorks software with both Adam Savage and Grant Imahara. Grant remembers using MATLAB quite a bit in his education and later his engineering projects.

This slideshow requires JavaScript.

I have been getting ready for this year’s Bay Area Maker Faire. Stop by the MathWorks booth to see our latest hardware projects and demos. We have giveaways and info on the latest products. See you soon at the Maker Faire!

Use the New MQTT Service from ThingSpeak for Real-time CheerLights Updates

It’s that time again. That time when people all across the world synchronize their lights together with CheerLights! People have built amazing CheerLights displays. I have seen everything from color-changing shoes to snowmen… and trees.

 

CheerLights Introduction

Here’s a quick introduction to the CheerLights project for those who are new to the project. Imagine 1000’s of multicolored lights all around the world synchronized to one color. When one of the lights turns red, they all turn red. To control CheerLights, send a tweet to @cheerlights or include “cheerlights” somewhere in your message with the name of a color. This will cause a chain reaction and all of the CheerLights displays and apps will change their color to red.

 

ThingSpeak MQTT Service

CheersLights is powered by ThingSpeak IoT. And, this year, I am happy to introduce real-time CheerLights updates using ThingSpeak’s new MQTT service. Using the MQTT service by ThingSpeak, your CheerLights change instantly. ThingSpeak has posted an example that gets a Particle Photon connected to CheerLights using MQTT. The Subscribe to Channel Updates Using Particle Photon Client example shows you how to use a Particle Photon Wi-Fi board to subscribe to channel updates from the CheerLights channel. The program displays the color read from the channel on the built-in LED on the Photon board. You can subscribe to the channel feed or directly to the color field on the CheerLights channel.

Once you learn how to use the MQTT service from ThingSpeak, you can easily adapt it to your IoT project. This is a great way to have real-time control of a device or real-time monitoring of sensors.

If you want to follow the project and see what others are building, visit CheerLights.com or follow on Twitter.