Wearable Party! LED Crochet Scarf
by bergmaad in Circuits > Wearables
143 Views, 2 Favorites, 0 Comments
Wearable Party! LED Crochet Scarf



This scarf is cozy and cool! The woven in LEDs in this crocheted scarf can be lit up in a number of different fun and interactive ways. Shake the scarf and a rainbow will appear; touch the sensors, and random lights will sparkle random colors or the lights will light in colors corresponding to real-time temperature changes or just turn off all the lights! Each mode can also be set via Bluetooth on the BluefruitConnect app.
Supplies


Crochet
- Scarf pattern: I purchased this one from Etsy seller Lulaorcrochet
- 5mm or 5.5mm crochet hook, depending on how loose you want your gauge
- Medium (4) Yarn: I used Yarnspirations Caron® Cinnamon Swirl Cakes in Citrus Twist
- Scarf: 227g
- Granny Squares: 55g
- Tapestry needle
Circuitry
- CircuitPlayground Bluefruit (CPB)
- Wire strippers
- NeoPixel LED strand with 4" pitch
- Small screwdriver
- Bolt-On Kit for Circuit Playground
- Adafruit MCP9808 High Accuracy I2C Temperature Sensor Breakout - STEMMA QT / Qwiic
- JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic
- 3x Small Alligator Clip Test Lead
- USB Data Cable
- 3 x AAA Battery Holder with On/Off Switch, JST, and Belt Clip
- 3x AAA Batteries
Crochet Scarf

This step will vary based on your pattern!
Wiring






Neopixel strand
- Strip the wires at the end of your Neopixel strand.
- Attach the wires as follows: Black/Ground to GND, Red/Power to VOUT, and Green/Signal to A1.
- Use the bolt-on kit and the screwdriver to secure your the Neopixel wires to the board.
Temperature sensor
Connect the MCP9808 Temperature Sensor Breakout to your CPB using the JST 4-Pin Cable with Alligator Clips - STEMMA QT / Qwiic: Black/Ground to GND, Red/Power to 3.3V, Yellow/I2C SCL to A4, Blue/I2C SDA to A5.
Capacitive touch
Clip alligator clip test leads to your CPB at pins A2, A3, and TX.
Data and power
- When uploading your code, connect the USB data cable to your CPB and computer.
- To make the build portable once the code has been uploaded to your CPB. insert the 3AAA batteries into your battery holder and connect it to the battery port on your CPB. Make sure to switch on when using the wearable and off when not to conserve power.
Code
Upload the code
- Plug in your CPB to your computer using the USB data cable.
- In your python IDE (I use PyCharm), copy and paste the code onto your CPB's code.py file.
The code can be modified if you do not want to connect to Bluetooth or if you do not want to physically manipulate the CPB.
Explanation
Random lights mode - assigns a random color in the color list to a random light on your LED strand. Then it turns that light off and repeats with another color on another light.
Temp mode - takes two temperature readings and compares them, assigning a color to 1 LED at a time. This way, your scarf can tell real time changes in the temperature - or just look cool!
Shake mode - if the CPB is shaken, a rainbow comet animation will appear on the LEDs.
Troubleshooting
Line 14: If multiple people are using the same code, each device should have a unique name (e.g., "Scarf1", "ScarfAbby"). Avoid special characters and to keep names under 20-characters.
Line 16: If num_leds based on the number of LEDs in your strand that fit on your scarf.
Line 123: To activate the shake, you may have to shake harder than you expect. Feel free to play around with the shake threshold parameter setting.
Downloads
Assemble


Weave the LED strand into your scarf
I did this by weaving the strand in and out so that only each LED was showing on one side of my scarf. I had 4 extra LEDs at the end.
Crochet two pockets
One pocket will hold your CPB, battery, and wires. The other is optional and can hold any extra LEDs on your strand that are too long for your scarf. If you have extra LEDs (like I did), make sure to adjust your code based on the number of LEDs you have woven into your scarf).
For these pockets, I made four sunburst granny squares following a US-based crochet pattern.
- Any granny square pattern will do, as long as your squares are about the width of your scarf.
- Each pocket will be two granny squares (a front and a back).
- For at least two squares, leave a long tail for sewing your squares together.
- I did not block mine, but blocking them would yield a cleaner finish.
Sew the pockets and attach them to the scarf
- Align two granny squares together.
- Using the tapestry needle and one of the long ends, sew together three edges, leaving the top open.
- Place the open side of the pocket on top of the edge of the scarf.
- Sew the inside of the pocket to the bottom of the scarf.
- Cut off or weave in the ends.
- Repeat for the other pocket, if used.
Add the wired-up CPB
- Place the CPB and the wired up components inside of the pocket, making sure all the connections stay intact.
- The belt clip of the battery holder can stick onto the pocket in a variety of ways. You can choose your orientation based on how easily you want to access the on/off switch.
- Clip the three alligator clips to the pocket. You can also do this in a variety of ways. I chose to leave the clips up so I could see the colors. In my case, the yellow clip activates the random color, random light sparkle mode, green activates the temperature-based light mode, and black turns off the LEDs.
Test!



Try it!
You can interact with your scarf in two ways:
- Manipulating the CPB via capacitive touch or activating the shake sensor in the internal accelerometer
- Entering valid strings into the UART serial communication via the BluefruitConnect application.
Physical testing
- Shake the CPB - this will trigger the rainbow comet animation.
- Press the alligator clips!
- Clip at A2 pin will trigger the temperature-based light mode.
- Clip at A3 will trigger random colors, random light sparkle mode.
- Clip at TX pin will turn off the LEDs.
- When running the temperature-based light mode, try warming the MCP9808 in your hands!
Bluetooth testing
- Download the BluefruitConnect application.
- Connect to your scarf.
- In the UART terminal, enter in one of the digits below.
- 1 = temperature-based lights
- 2 = random colors, random light sparkle
- 3 = rainbow comet animation
- 0 = all LEDs off (there may be a short delay)
Have fun!! Let me know if you tried this - tag me in any builds or reach out with questions on Bluesky!