Soccer Scarf With Blinking Leds

Photo of andyjoyce

Made by andyjoyce

About the project

An LED flashing scarf which uses an Adafruit Pro Trinket with a rechargeable Li-Po battery and an Ardunio microcontroller.

Project info

Difficulty: Easy

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Lithium Battery 3.7V 2Ah Rechargeable Lithium Battery 3.7V 2Ah Rechargeable x 1
Usb Enclosure, Usb Slot, Black Abs 94hb, l-2.00" w-1.00" t-0.50" Usb Enclosure, Usb Slot, Black Abs 94hb, l-2.00" w-1.00" t-0.50" x 1
Wire, Hook-up; SPC; 24 AWG; 19x36 strand; TFE ins.; 300V; UL AWM 1180; Red Wire, Hook-up; SPC; 24 AWG; 19x36 strand; TFE ins.; 300V; UL AWM 1180; Red x 1
Switch Tactile N.O. SPST Round Button Wire Lead 2A 14VDC Switch Tactile N.O. SPST Round Button Wire Lead 2A 14VDC x 1
Adafruit Pro Trinket LiIon/LiPoly Backpack Add-On Adafruit Pro Trinket LiIon/LiPoly Backpack Add-On x 1
Development Boards & Kits; AVR Pro Trinket 3V 12MHz Development Boards & Kits; AVR Pro Trinket 3V 12MHz x 1
Adafruit LED Sequins - Royal Blue - Pack of 5 Adafruit LED Sequins - Royal Blue - Pack of 5 x 1
Adafruit LED Sequins - Warm White - Pack of 5 Adafruit LED Sequins - Warm White - Pack of 5 x 1

View all

Software apps and online services

Arduino IDE Arduino IDE

Story

Background

My friend is president of an FC Dallas (pro soccer) supporter group called the Dallas Guardians.  That’s their official name but they have always been known as the Dallas Beer Guardians because the section they occupy in Toyota Stadium is the beer garden.  Anyway,  they are a very loud, rabid group of fans and they all have these scarves (see photo).  So I thought about adding a bunch of twinkling LEDs to make this one stand out.

I decided to I wanted it to use an Adafruit Pro Trinket with a rechargeable Li-Po battery.  For the LEDs I went with Adafruits LED sequins because they would be easy to solder to and be stitched to the scarf.  The Pro Trinket has 10 digital I/O lines that can handle 15mA each.  The LED sequins are about 5mA each, so I decided to put three sequins on each digital I/O line for a total of 30 LEDs.  Here is what the wiring diagram looks like.

The scarf itself is 5 feet long and I wanted to distribute the LED sequins in somewhat random pattern.  I decided I would put the Pro Trinket and battery in the center of the scarf and run half of the LEDs to the left and the other half to the right.  I laid out my pattern by pinning the LEDs to a long piece of foam and then I started soldering.

The Pro Trinket needed to go into a very small enclosure and when I first attached the charging system backpack to the Pro Trinket using a header I realized the overall thickness was going to be too much.  So I took the backpack off and attached it to the Pro Trinket using some short wires.  I added a piece of electrical tape to the bottom of the backpack and I was then able to set it directly on the Pro Trinket and fit it all into the enclosure.

Using the Arduino IDE I played around with simple programs to make the LEDs blink and I decided on a pattern where they would start off slowly blinking in a random pattern and then speed up until all of them are on at one time.  I’m sure there are more efficient ways to write this code but I’m an amateur. 

The Code

/*

  Scarf_blink

  Blinks the sequin LEDs repeatedly. 

 */

  1. // the setup function runs once when you press reset or power the board
  2. void setup() {
  3. // initialize digital pin 13 as an output.
  4. pinMode(13, OUTPUT);
  5. pinMode(12, OUTPUT);
  6. pinMode(11, OUTPUT);
  7. pinMode(10, OUTPUT);
  8. pinMode(9, OUTPUT);
  9. pinMode(3, OUTPUT);
  10. pinMode(4, OUTPUT);
  11. pinMode(5, OUTPUT);
  12. pinMode(6, OUTPUT);
  13. pinMode(8, OUTPUT);
  14. }
  15.  
  16. void loop (){
  17. //These are the functions that will run after loading the code. The number after the function name indicates the delay in miliseconds before the next function runs. In this example there are two different functions. The function
  18. //called scarfcycle runs through several cycles starting with a 500ms and repeats with shorter delays until the all-on function is called and runs for 1.5 seconds.
  19. scarfcycle(500);
  20. scarfcycle(200);
  21. scarfcycle(150);
  22. scarfcycle(125);
  23. scarfcycle(100);
  24. scarfcycle(75);
  25. scarfcycle(50);
  26. scarfcycle(20);
  27. scarfcycle(10);
  28. scarfcycle(5);
  29. scarfcycle(5);
  30. scarfcycle(5);
  31. scarfcycle(3);
  32. scarfcycle(2);
  33. scarfcycle(1);
  34. all_on(1500);
  35. }
  36.  
  37. // this function defines the blink pattern for all of the LEDs
  38. void scarfcycle(uint8_t wait) {
  39. //digitalWrite(pin#,state) - The ProTrinket has 10 digital lines that can be turned on or off by using HIGH or LOW as the state. The pin# can be 3, 4, 5, 6, 8, 9, 10, 11, 12 or 13.
  40. digitalWrite(13, HIGH); // digitalWrite with "HIGH" turns on the LEDs attached to the pin
  41. delay(wait);
  42. digitalWrite(3, HIGH);
  43. delay(wait);
  44. digitalWrite(13, LOW); //digitalWrite with "LOW" turns off the LEDs attached to the pin
  45. //delay(wait);
  46. digitalWrite(11, HIGH);
  47. delay(wait);
  48. digitalWrite(5, HIGH);
  49. delay(wait); //by using "wait" in the parentheses the actual delay times will be specified when the functions are called above
  50. digitalWrite(3, LOW);
  51. //delay(wait);
  52. digitalWrite(9, HIGH);
  53. delay(wait);
  54. digitalWrite(8, HIGH);
  55. delay(wait);
  56. digitalWrite(11, LOW);
  57. //delay(wait);
  58. digitalWrite(12, HIGH);
  59. delay(wait);
  60. digitalWrite(10, HIGH);
  61. delay(wait);
  62. digitalWrite(5, LOW);
  63. //delay(wait);
  64. digitalWrite(6, HIGH);
  65. delay(wait);
  66. digitalWrite(4, HIGH);
  67. delay(wait);
  68. digitalWrite(9, LOW);
  69. //delay(wait);
  70. digitalWrite(13, HIGH);
  71. delay(wait);
  72. digitalWrite(3, HIGH);
  73. delay(wait);
  74. digitalWrite(8, LOW);
  75. //delay(wait);
  76. digitalWrite(11, HIGH);
  77. delay(wait);
  78. digitalWrite(5, HIGH);
  79. delay(wait);
  80. digitalWrite(10, LOW);
  81. //delay(wait);
  82. digitalWrite(9, HIGH);
  83. delay(wait);
  84. digitalWrite(8, HIGH);
  85. delay(wait);
  86. digitalWrite(12, LOW);
  87. //delay(wait);
  88. digitalWrite(6, LOW);
  89. //delay(wait);
  90. digitalWrite(4, LOW);
  91. //delay(wait);
  92. digitalWrite(3, LOW);
  93. }
  94. // this function turns all of the LEDs on at one time
  95. void all_on(uint16_t wait){
  96. digitalWrite(13, HIGH);
  97. digitalWrite(3, HIGH);
  98. digitalWrite(11, HIGH);
  99. digitalWrite(5, HIGH);
  100. digitalWrite(9, HIGH);
  101. digitalWrite(8, HIGH);
  102. digitalWrite(12, HIGH);
  103. digitalWrite(10, HIGH);
  104. digitalWrite(6, HIGH);
  105. digitalWrite(4, HIGH);
  106. delay(wait);
  107. }

Once everything was working on the layout board it was time to figure out how to get it all inside of the scarf.  I laid everything out on a piece of muslin that would fit inside of the scarf and I started sewing.  I ran a few stiches around each LED and then a lot of stiches around the Pro Trinket enclosure, the battery and the switch. 

I then opened up one end of the scarf and turned it inside out.  I laid the strip of muslin on the scarf with the LEDs facing so that they would shine out of the front of the scarf.  I then stitched the muslin to the inside of the scarf in several places so it would stay in place when I turned the scarf back outside.  The last steps were stitching the end of the scarf back up and making a small hole in the top center edge of the scarf to get access to the USB port so it the battery can be charged.  The switch can be pressed through the fabric of the scarf and LED sequins start shining through.

(I would like to insert a photo here of the finished product but I can’t get a good photo of the scarf with the LEDs shining through. If I do it in the dark the lights are fuzzy and if I do it with the lights on you can’t see the LEDs.  Ideas?)

Credits

Photo of andyjoyce

andyjoyce

Electronic engineer who loves hacking software and hardware. Open Source / Linux / Devops consultant. Enjoying being part of the maker community.

   

Leave your feedback...