Con Badge with Circuit Playground Express
2018-04-18 | By Adafruit Industries
License: See Original Project Circuit Playground
Courtesy of Adafruit
Guide by Sophy Wong
Overview
Just in time for convention season, this unofficial badge is perfect for PyCon, Maker Faire, or just for fun! The design uses a laser cut base, copper tape for capacitive touch, and Circuit Playground Express for lots of blinking, sensors, and programming possibilities. Anyone can hack this badge!
If this is your first time using Circuit Playground Express, prepare to be hooked! Circuit Playground Express is packed with NeoPixels, an accelerometer, an infrared sensor, and more, all built-in and ready for you to tinker with. It's perfect for tricking out a con badge! The code in this guide uses capacitive buttons to play different NeoPixel animations, but the best part of #badgelife is hacking your badge - use your imagination and make it your own!
In this project, I've used a small wire as a bridge between the conductive pins of the Circuit Playground Express and the foil tape areas. If soldering wire is not an option, try extending the foil tape so that it sits directly under each pin. Use a double layer of copper foil tape to make sure each pad touches its pin on the CPX snugly.
Check out the Circuit Playground Express guide before getting started, and visit makecode.adafruit.com to get started with programming.
Tools and Materials
You'll need:
- Circuit Playground Express
- Copper Foil Tape
- Solid-Core Wire or Magnet Wire
- 2x 2032 Coin cell battery holder or small lipo battery
- double sided tape or small zip ties (8) for mounting the Circuit Playground Express
You'll also need to cut the backplate of the badge out of acrylic, plywood, or whatever laser-cuttable material you prefer. If you don't have access to a laser cutter, you can look for a maker space near you that has one, or send the files out to a service for cutting.
Laser Cutting
Download the artwork .svg file below for laser cutting. Cutting, etching, and scoring passes are separated by layers and color coded. See diagram below.
Don't cut all the layers! One layer is a cut layer, one is a score layer, and one is an engrave layer.
I cut my badges on a Glowforge laser cutter, using proof grade materials from Glowforge and the default settings for each. For other laser cutters, you'll need to do some tests and sample cuts to dial in the correct settings for your material. You will need to determine settings for cut, score (vector lines), and engrave (raster/fill).
Here are some different materials I cut on the Glowforge. The badge looks great on translucent materials, especially if worn over a dark shirt. Depending on the material and settings, these took between 6 and 11 minutes to cut.
Fluorescent Green Acrylic (Glowforge Proof Grade Material)
Blue Translucent Acrylic (protective paper left on snake)
Frosted Clear Acrylic (Glowforge Proof Grade Material)
Medium Maple Plywood (Glowforge Proof Grade Material)
After cutting, peel off the protective film. Keep the small trapezoidal pieces to use as templates for cutting the foil tape.
Program the Circuit Playground Express
The easiest way to get started with programming the Circuit Playground Express is with MakeCode, a visual programming tool. Start by reading the guide below on using MakeCode, then head over to makecode.adafruit.com and start a new project.
Programming Circuit Playground Express with MakeCode
Here is the badge program I wrote in MakeCode. It uses the badge’s four conductive pads to change animations on the Circuit Playground Express NeoPixel ring.
Let's Make Some Code
Start by dragging an if/else block into your forever loop. We'll use this to set up the different animation modes we want to use. Grab a 0 = 0 conditional block from the Logic category and drop it into the if line.
Make a variable for the animation mode. In the Variables category, click "Make a Variable" and name it "mode". Click "OK", and your new mode variable should appear in the Variables window. Drag it onto the first slot of your 0 = 0 condition, replacing the first 0.
Next, let's assign the sparkle animation as the first mode in our program. Change the 0 to 1. From the Light category, grab the show animation block and drop it under the if line. Now, when the mode is set to 1, the Circuit Playground will show the sparkle animation.
Because we have 4 conductive inputs, let's set up 4 different animation modes. Click the + on the if/else block to add another condition, and repeat the step above to assign animations to modes 2, 3, and 4. Set the else condition to show the rainbow animation, this will be our default mode.
Next, we'll set each of our four conductive inputs to select one of the modes we just created. From the Inputs category, drag an on button click block onto the workspace. Use the drop-down menu to change the button A to pin A2.
From the Variables category, drag a Set item to 0 block into the slot. Click on item and change it to our mode variable. Then change 0 to 1 for the sparkle animation. Now, when pin A2 is touched, the Circuit Playground Express will show the sparkle animation. You can check it by clicking the A2 pin in the MakeCode simulator!
Repeat the steps above to set up pins A3, A6, and A7 to show the other three animation modes when touched.
We're almost done! Let's add a way to show the default animation. Since we set else in our if/else block to the rainbow animation, if we set the mode to anything other than 1, 2, 3, or 4, the rainbow animation will play. So let's add another On Button Click block to the workspace, but this time set it so that when Button A is clicked, the mode is set to 0.
You're done! Plug your Circuit Playground Express into your computer, and it will show up as a drive named CPLAYBOOT. Download your code and drag it onto the drive to load it. Check it by pressing the conductive pins and the button we set up. If everything looks good, move on to building the badge!
Assemble the Badge
Solder Wires to the CPX
Start by adding small wires to the four pins on the Circuit Playground Express that will be our conductive inputs. Thin solid-core wire or magnet wire works well for this. (If using magnet wire, scrape away the wire's enamel coating with sandpaper.)
Cut 4 pieces of bare wire about 1 1/2" long. It's easiest to strip one section of wire first and then cut it. Tin one end of each wire.
Tin the four pins we'll be using on the Circuit Playground Express: A2, A3, A6, A7. Then solder one wire to each pin.
Attach the Circuit Playground Express
Center the Circuit Playground Express on the badge and check that your wires will reach the foil areas easily without touching each other.
For each pad, use small pliers to bend each wire flat against the sides of the Circuit Playground Express. Then bend each wire outward so that the wires will lay flat against the badge.
Use strong double sided tape (or a few thin swipes of hot glue) to attach the board to the badge.
Alternatively, mounting holes are provided on the badge to mount through the power and ground pins on the board. You can use small nuts and bolts or zip ties (two per hole) to attach the board to your badge.
Cut the wires so they don't extend beyond the conductive pad areas.
Make the Conductive Pads
If you saved the little trapezoidal pieces of protective film from your laser cut badge, you can use them as templates for cutting the foil. Otherwise, print the artwork and cut out the trapezoids for templates. Cut four pieces of foil tape to fit into the four foil areas outlined on the badge.
Apply the foil tape pieces to the badge, covering the wire pieces you soldered to the Circuit Playground Express. Press the foil firmly onto the badge. I found that the tape did not stick well to the coated plywood from Glowforge. A thin dab of glue can be used to keep the foil down on either side of the wire, but for good conductivity, don't coat the wire with glue.
Attach the Battery
Coin Cell Battery Option:
It's tough to travel with LiPo batteries, so if you’re flying to your convention, you may want to use a coin cell battery holder. Before inserting the batteries, shorten the wires to the JST connector on the holder to about 1 1/2”.
On the back of the badge, attach the battery pack with double-sided tape or hot glue, with the wire pointing toward the bottom of the badge. Feed the JST connector through the hole in the badge and plug it into the Circuit Playground Express. Insert batteries and turn the battery pack switch to on.
LiPo Battery Option:
If you prefer to use a small LiPo battery, simply plug it into the Circuit Playground Express through the keyhole slot at the bottom of the badge. It’s a good idea to cover your LiPo battery with gaff tape for extra protection out in the wild. To hold the battery in place, use double-sided tape or adhesive velcro. Velcro makes it easy to change batteries on the go.
Instead of shortening the wires on a LiPo battery, simply tape the extra length out of the way on the back of the badge.
Your badge is complete! Wear it to conventions, parties, the grocery store... wherever you want to let your maker flag fly!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum