I’ve been playing around with hardware for the past year. Mainly, I’ve been interested in making little, useless things that flash and glow all colors of the rainbow with LEDs. I’m not super interested in using hardware for home automation or for real practical uses, really. For me, working with hardware is where I can be silly and indulge my child-like wonder. I like creating art or fashionable things whose only purpose is to bring a little joy to those around me (& myself).
I recently saw that Adafruit had released a new Arduino board called the Circuit Playground Express and was pretty anxious to try out this little board.
So, I obviously used this opportunity to make a fancy collar my doggo for night walks. He’s a good boye and totally deserves a special collar. I also think that the steps in this build could just as easily be applied to other lighted apparel applications like adding some LEDs to your denim jacket or backpack or hat or <insert your awesome idea here>... ✨
Let’s jump into the build process!
Note: Some thoughts about being a new maker & soldering.
Don’t shy away from jumping into playing around with hardware and LEDs because you don’t feel confident or don’t have the supplies to solder yet!
The Circuit Playground Express is extremely versatile. It’s tons of fun on its own with the built-in 10 Neopixel LEDs without needing to solder any additional LEDs to it. Don’t worry about adding additional LEDs until you wanna explore more in-depth and go bigger. :-)
- Adafruit Circuit Playground Express
- Neopixels RGBW 30/m LED strip, approximately 12"
- LiPoly 2000mAh battery
- An old dog collar
- 22 AWG wire
- Soldering iron + Soldering wire
So, for this first step, I wanted the built-in LEDs to flash a simple rainbow animation. You can use multiple
On the left side of the screen, the editor shows a simulator of what your running code will look (or sound) like on the Circuit Playground Express!
When you are ready to load the code onto your board, you just click the ‘Download’ button, enter Bootloader mode by clicking the reset button on the board, and drag-n-drop the downloaded .utf2 file onto the removable drive CPLAYBOOT in Finder. Adafruit has great tutorials on all of this, so check those out for the most detailed directions: https://learn.adafruit.com/makecode/downloading-and-flashing
I felt happy with my first go in MakeCode and that it was working on my board, so next I dove into soldering the additional Neopixel LED strip to the board.
To connect the Neopixels LED strip to the Circuit Playground Express, I needed to solder 3 connections:
- GND to GND (the ground)
- 5V to VOUT (powers the LEDS)
- Din to A1 (sends data to the LEDs & tells it what to do)
Coding the Collar:
- It should continually run a rainbow 🌈 animation on the board and strip’s LEDs.
- If it detects a shake, it should sparkle ✨ randomly on the strip for 1 second.
- If I press button A, it will turn off all the LEDs.
- If I press button B, it will turn on the rainbow animations on all LEDs again.
To start off, I used a forever loop method. In the loop, I first check if the
true. If so, I run the
setupStrip() method to set the colors initially for the LED strip. Then, I check if the LEDs are paused (this happens if Button A is pressed). If not, it will run the rainbow animation indefinitely.
The only actions that can interrupt the rainbow animation loop are (1) if the collar detects a sudden shaking moment or (2) if Button A is pressed. If a shake is detected, the LED strip will sparkle randomly for 1 second. If Button A is pressed, all the LEDs will turn off until Button B is pressed.
Below is my final code for the collar (for now, at least).
Full build disclosure:
I totally goofed the soldering of the Din to the wrong pin on the Circuit Playground Express. 😞
I was so excited to get started, that I neglected to carefully look at the Pinout info on the product page. Always do this first and save yourself the same grief as me!
I didn’t and ended up soldering a wire from the Din to A0. While this worked, the Circuit Playground made a constant clicking noise when the lights were cycling. This is because the A0 pinout will interfere with the built-in speaker if it’s used as an output. I didn’t want the collar making weird sounds when it was running, so I had to fix it. But, no fear, I heated up the connections again with the soldering iron, loosened the wire, and re-soldered it to the A1 pinout. 😎
I hope you feel inspired to check out the Circuit Playground Express, MakeCode, and will try coding your first hardware project! ✌️