Build it step by step
0 of 7 doneTest one LED
Light it with the NeoPixel example.
Chain six
Run a simple colour wipe.
Write the sparkle
Fade a random LED in and out.
Write the rainbow
Fade colours along the tie.
Add the switch
Put it in the battery lead.
Fit the battery
Insulated pouch in the knot.
Sew the tie
Cover the LEDs with thin white fabric.
How do you build an LED bow tie?
A bow tie with tiny addressable LEDs that sparkle, run on a coin cell or small Li-po. You need Digispark ATtiny85 USB board, WS2812B single LED module (8 mm / breakout) × 6, Li-Po battery 3.7 V 500 mAh and Slide switch SPDT (SS12D00). It takes 7 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 4
Parts list
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| LED module 1 DIN | Digispark P0 | Data |
| LED module DOUT | Next module DIN | Chain of six |
| LED modules VCC and GND | Digispark 5V pin and GND | Power (fed from the LiPo, see the notes) |
| LiPo plus | Slide switch, then Digispark 5V pin | Power switch |
| LiPo minus | Digispark GND | Ground |
Code
The Digispark is a tiny ATtiny85 board that runs the NeoPixel library. Its on-board regulator wants a higher voltage, so with a 3.7 V LiPo you feed the cell straight to the 5V pin, which most people do; the LEDs and chip then run at 3.7 V and still work at low brightness. A coin cell cannot give the current LEDs need, so use a small LiPo and keep brightness at about 12 percent, which gives hours of light. Use a protected LiPo, put it in an insulated pouch hidden in the knot, never wear it while it charges, and take it off if it feels warm. The effects here are slow fades, avoiding fast flashing that can trigger people with photosensitive epilepsy. Install the Digispark board support from Digistump and upload by plugging the board in only when the IDE asks you to. The tie must sit comfortably and nothing sharp should press on the neck.
Runs on a virtual Digispark ATtiny85 in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// LED bow tie: sparkle and slow rainbow. Library: Adafruit NeoPixel. Board: Digispark (Default - 16.5 MHz).
#include <Adafruit_NeoPixel.h>
#define PIN 0
Adafruit_NeoPixel px(6, PIN, NEO_GRB + NEO_KHZ800);
unsigned long modeStart = 0;
int mode = 0;
void setup() {
px.begin();
px.setBrightness(30); // low brightness: easy on the battery and on the eyes
randomSeed(analogRead(1));
}
void loop() {
if (millis() - modeStart > 15000) { mode = (mode + 1) % 2; modeStart = millis(); }
if (mode == 0) { // sparkle: a random LED twinkles softly
px.clear();
int i = random(6);
for (int b = 0; b <= 255; b += 17) { px.setPixelColor(i, px.Color(b, b, b / 2)); px.show(); delay(8); }
for (int b = 255; b >= 0; b -= 17) { px.setPixelColor(i, px.Color(b, b, b / 2)); px.show(); delay(8); }
delay(random(100, 400));
} else { // slow rainbow across the tie
static uint16_t hue = 0;
for (int i = 0; i < 6; i++) px.setPixelColor(i, px.gamma32(px.ColorHSV(hue + i * 4000)));
px.show(); hue += 200; delay(30);
}
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Switch on | Sparkle starts |
| After 15 seconds | Slow rainbow |
| Brightness | Comfortable, no glare |
| Switch off | All dark, no glow |
If it does not work
LEDs do not light
Check DIN goes to P0 and the polarity.
Random colours
Check the chain order and the NEO_GRB setting.
Upload fails
Plug the board in only when the IDE asks.
Dim or flickering
Charge the cell.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the LED bow tie?
Digispark ATtiny85 USB board, WS2812B single LED module (8 mm / breakout) × 6, Li-Po battery 3.7 V 500 mAh and Slide switch SPDT (SS12D00).
How long does the LED bow tie take to build?
About 60 minutes for a beginner maker, in 7 steps.
How do I know the LED bow tie works?
Switch on: Sparkle starts. After 15 seconds: Slow rainbow. Brightness: Comfortable, no glare.
LEDs do not light: what should I check?
Check DIN goes to P0 and the polarity.
Random colours: what should I check?
Check the chain order and the NEO_GRB setting.
Upload fails: what should I check?
Plug the board in only when the IDE asks.
Dim or flickering: what should I check?
Charge the cell.
