Maker.io main logo

Getting Started with Cheerlights

2023-12-10 | By bekathwia

Arduino ESP32

Today I’m going to show you how to set up your first CheerLights circuit.

Getting Started with Cheerlights

Getting Started with Cheerlights

Getting Started with Cheerlights

Getting Started with Cheerlights

CheerLights is a global LED color-sharing platform created by Hans Scharler in 2011. You send it a color, and all the folks with CheerLights will see the new color on their own setups. It used to use Twitter, but now you can control CheerLights using Discord. It’s a super easy beginner IoT project.

Supplies

Getting Started with Cheerlights

For this project, you’ll need some RGB LEDs and a Wi-Fi microcontroller. I’m using a strip of WS2812 addressable pixels, also called NeoPixels, and an Arduino Nano ESP32 Wi-Fi microcontroller board.

Here's a full list of everything you'll need:

Getting Set Up

The first step is to make sure your Arduino IDE is set up for your Wi-Fi board, which in most cases requires installing another boards package and any drivers necessary for your specific hardware.

Getting Started with Cheerlights

Since this is an Arduino brand board, the IDE comes with board support already installed.

Getting Started with Cheerlights

Then you’ll need to install the NeoPixel library and open the strandtest example that comes with it.

Getting Started with Cheerlights

Getting Started with Cheerlights

It’s important to run a test sketch on your circuit to verify that you can communicate with the board successfully. Connect your pixel strip to power, ground, and a data output, then make sure your Arduino code references that same output pin.

Getting Started with Cheerlights

If all goes well, you’ll see the pixels light up. Now you’re ready to move on to the internet code.

Code

Getting Started with Cheerlights

I got this code example from the CheerLights GitHub. Even though it says it's for the ESP8266, it works fine on the ESP32.

Getting Started with Cheerlights

Then I updated my Wi-Fi network name and password, as well as the pixel pin, to match my own.

Getting Started with Cheerlights

The code periodically checks for updates on the ThingSpeak channel used to communicate the CheerLights color, then sets the LEDs to that color.

Getting Started with Cheerlights

Getting Started with Cheerlights

That's all there is to set up the hardware and software for your CheerLights project. The physical form is up to you. I put my LED strip in a piece of crinoline tubing, then twisted it up into a decorative knot to put on top of my Christmas tree.

Getting Started with Cheerlights

Getting Started with Cheerlights

I made a second CheerLights circuit using the TinyPico board and a smaller strip of pixels inside a ping-pong ball.

Getting Started with Cheerlights

But aren't ping-pong balls flammable!? Yes, technically ping-pong balls can catch on fire. But not from these regular LEDs. It’s a common misconception that LEDs can get hot enough to set their diffusion on fire– surely some of the super high-power ones could, especially if you didn’t heatsink them properly, but those are not your run-of-the-mill LEDs.

It takes a lot to set a ping-pong ball on fire. A casual grazing of it with direct flame from a lighter doesn’t do it, you really have to hold that heat source right on it for quite some time. Admittedly, once it catches, it does keep itself burning for quite some time. They’re made of nitrocellulose and camphor. But could my CheerLights start that fire? No way.

Conclusion

Having the CheerLights LED circuit around and noticing it change color is really fun, knowing that another person sent that color and is probably looking at their CheerLights right now. And that makes more folks notice theirs and send a color of their own.

Getting Started with Cheerlights

Getting Started with Cheerlights

Cheer is exactly the word I’d use to describe that feeling of “hey, it changed color!” then immediately pull out my device to send along a color of my own in response, contributing to an ongoing color conversation. It's super fun and easy, and I hope you’ll give it a try.

制造商零件编号 ABX00092
ARDUINO NANO ESP32 WITHOUT HEADE
Arduino
制造商零件编号 TINYPICO-U-01
TINYPICO V3 USB-C U.FL
Pimoroni Ltd
制造商零件编号 2552
ADDRESS LED STRIP SERIAL RGB 1M
Adafruit Industries LLC
制造商零件编号 FIT0096
BREADBRD TERM STRIP 3.20X2.00"
DFRobot
制造商零件编号 DH-20M50052
USB AM TO USB C, USB 2.0 - 1 MET
Cvilux USA
制造商零件编号 4128
JUMPER WIRE M TO F 7.874" 10PCS
Kitronik Ltd.
制造商零件编号 AL-04-18-9-M
CBL TIE LOCKING NAT 18LB 4.13"
Advanced Cable Ties, Inc.
制造商零件编号 1427
SCOTCH MULTI-PURPOSE SCISSORS 14
3M
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum