This Japanese style hair ornament combines an upcycled chopstick with felt, embroidery, beads and a GEMMA M0 or GEMMA v2 microcontroller. A NeoPixel Jewel provides the real beauty with kaleidoscopic flower designs. Make a hair stick for every season of the year and you'll be the tea ceremony favorite. Don't have long hair? No worries, just eliminate the chopstick and glue/stitch a barrette on the back of your ornament.

This guide was written for the Gemma v2 board, but can be done with either the original or Gemma M0. We recommend the Gemma M0 as it is easier to use and is more compatible with modern computers!
This guide was written for the Gemma v2 board, but can be done with either the original or Gemma M0. We recommend the Gemma M0 as it is easier to use and is more compatible with modern computers!

What would an electric kanzashi look like? That was the question I was considering when I designed this piece. The simple circular shapes of the Jewel and GEMMA brought the answer. You'll be using plenty of crafting skills, with a wee bit of tools for this beginner's project. The hardest part will be choosing the colors you want for your ornament.

Make sure you take the time to read the following guides. Jewel is a type of NeoPixel cluster and operates similarly to the other NeoPixel products.

 

 

Take your chopstick and measure 6" starting at the tiny tip and mark a line. Then, cut using a hobby knife or saw. 

 

Sand the raw edge of the cut until smooth, and also sand the tip of the chopstick so it is a nice point. Now, give the entire chopstick a light sanding, as this will make the stick slide through the hair easier and also produce a better paint job.

Apply three coats of acrylic paint to the entire chopstick, allowing correct drying time between coats. It's helpful to clamp a clothespin on the thicker end and stand the pin up so the chopstick is positioned at the top, with its point on the table. 

If you are ambitious, start soldering your circuit, but don't forget to come back here to finish the chopstick. For the final touch, add 2 coats of clear nail polish to give a lacquered appearance. 

This diagram uses the original Gemma but you can also use the Gemma M0 with the exact same wiring!

Okay, get set -- all soldering will be done on the back side of the GEMMA and Jewel. Notice I've used the same color wire for all three connections on my finished piece to coordinate with the felt. Wire can be beautiful!

GEMMA --> Jewel

  • D1 --> Data In
  • GND --> GND
  • Vout --> Power

Lay your GEMMA and Jewel side by side as in the photo. The wires will be going in the area between the two parts. Trim and strip three pieces of wire--2 at 2 1/4" and 1 at 2 3/4". 

Tin just the one side of each of the wires. This will be the side that gets inserted into the fat pads of the GEMMA. The other side we will leave without solder, so it is easier to insert into the small pads of the Jewel.

Don't forget that you will be inserting your wires into the back side of each of these parts to solder.

Now solder wires using the longer wire for the ground connection.

GEMMA --> Jewel

  • D1 --> Data In
  • GND --> GND
  • Vout --> Power

Nip off the excess tips of the wires.

 

Usually you wait until the end of the project to do the programming. In this case, this is the best way to make sure your parts are working before you glue them down. Connect your GEMMA to your computer with the cable and upload the following code. Notice the section with the colors--you can hack that to be any combination you like. I found that deeper colors work better than lighter ones, but it can be fun to have a subtle mix.

The Arduino code presented below works equally well on all versions of GEMMA: v1, v2 and M0. But if you have an M0 board, consider using the CircuitPython code on the next page of this guide, no Arduino IDE required!
// SPDX-FileCopyrightText: 2017 Leslie Birch for Adafruit Industries
//
// SPDX-License-Identifier: MIT

/* 
Jewel Hairstick by Leslie Birch for Adafruit Industries
Based on NeoPixel Library by Adafruit
*/
 
// This section is NeoPixel Variables
 
#include <Adafruit_NeoPixel.h>
 
#define PIN 1
 
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(7, 1, NEO_GRB + NEO_KHZ800);

//You can have fun here changing the colors for the code
uint32_t color1 = strip.Color(236, 79, 100); //Salmon Pink
uint32_t color2 = strip.Color(246, 216, 180); //Cream
uint32_t color3 = strip.Color(174, 113, 208); //Lavendar
uint32_t color4 = strip.Color(182, 31, 40); //Red
uint32_t color5 = strip.Color(91, 44, 86); //Purple


  
void setup() {
   //This is for Neopixel Setup
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}
 
void loop() 
{
  
    
  strip.setBrightness(30);
  // the first number is the pixel number for Jewel. O is the center one 
  strip.setPixelColor(1, color1); 
  strip.setPixelColor(2, color1); 
  strip.setPixelColor(3, color1); 
  strip.setPixelColor(4, color1); 
  strip.setPixelColor(5, color1); 
  strip.setPixelColor(6, color1); 
  strip.setPixelColor(0, color2); 
  
  strip.show();
  delay(3000);
  
  
  strip.setPixelColor(1, color2); 
  strip.setPixelColor(2, color2); 
  strip.setPixelColor(3, color2); 
  strip.setPixelColor(4, color2); 
  strip.setPixelColor(5, color2); 
  strip.setPixelColor(6, color2); 
  strip.setPixelColor(0, color3); 
  
  strip.show();
  delay(3000);
  
  strip.setPixelColor(1, color3); 
  strip.setPixelColor(2, color3); 
  strip.setPixelColor(3, color3);
  strip.setPixelColor(4, color3); 
  strip.setPixelColor(5, color3); 
  strip.setPixelColor(6, color3); 
  strip.setPixelColor(0, color4); 
  
  strip.show();
  delay(3000);
  
  strip.setPixelColor(1, color4); 
  strip.setPixelColor(2, color4); 
  strip.setPixelColor(3, color4); 
  strip.setPixelColor(4, color4); 
  strip.setPixelColor(5, color4); 
  strip.setPixelColor(6, color4); 
  strip.setPixelColor(0, color5); 
  
  strip.show();
  delay(3000);
  
  strip.setPixelColor(1, color5); 
  strip.setPixelColor(2, color5); 
  strip.setPixelColor(3, color5);
  strip.setPixelColor(4, color5); 
  strip.setPixelColor(5, color5); 
  strip.setPixelColor(6, color5); 
  strip.setPixelColor(0, color1); 
  
  strip.show();
  delay(3000);
  
}

Installing Arduino libraries is a frequent stumbling block. If this is your first time, or simply needing a refresher, please read the All About Arduino Libraries tutorial.If the library is correctly installed (and the Arduino IDE is restarted), you should be able to navigate through the “File” rollover menus as follows:

File→Sketchbook→Libraries→Adafruit_NeoPixel→strandtest

Connect up your NeoPixels in a solderless breadboard and use alligator clips to attach to GEMMA, referring to the circuit diagram if necessary.

You’ll need to change a few lines in the code regarding the data pin (1), type of pixels (RGB vs GRB), and number of pixels (5). The resulting (and slightly simplified) code is below:

From the Tools→Board menu, select the device you are using: 

  • Adafruit Gemma M0
  • Adafruit Gemma 8 MHz 
  • Connect the USB cable between the computer and your device. The original Gemma (8 MHz) need the reset button pressed on the board, then click the upload button (right arrow icon) in the Arduino IDE. You do not need to press the reset on the newer Gemma M0 or Trinket M0.

When the battery is connected, you should get a light show from the LEDs. All your pixels working? Great! You can take apart this prototype and get ready to put the pixels in the collar. Refer to the NeoPixel Uberguide for more info.

GEMMA M0 boards can run CircuitPython — a different approach to programming compared to Arduino sketches. In fact, CircuitPython comes factory pre-loaded on GEMMA M0. If you’ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the Adafruit GEMMA M0 guide.

These directions are specific to the “M0” GEMMA board. The original GEMMA with an 8-bit AVR microcontroller doesn’t run CircuitPython…for those boards, use the Arduino sketch on the “Arduino code” page of this guide.

Below is CircuitPython code that works similarly (though not exactly the same) as the Arduino sketch shown on a prior page. To use this, plug the GEMMA M0 into USB…it should show up on your computer as a small flash drive…then edit the file “code.py” with your text editor of choice. Select and copy the code below and paste it into that file, entirely replacing its contents (don’t mix it in with lingering bits of old code). When you save the file, the code should start running almost immediately (if not, see notes at the bottom of this page).

If GEMMA M0 doesn’t show up as a drive, follow the GEMMA M0 guide link above to prepare the board for CircuitPython.

# SPDX-FileCopyrightText: 2017 Leslie Birch for Adafruit Industries
#
# SPDX-License-Identifier: MIT

# Jewel Hairstick by Leslie Birch for Adafruit Industries
# Based on NeoPixel Library by Adafruit

import time

import board
import neopixel
from digitalio import DigitalInOut, Direction

pixpin = board.D1
numpix = 7

led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT

# defaults to RGB|GRB Neopixels
strip = neopixel.NeoPixel(pixpin, numpix, brightness=.1, auto_write=True)
# uncomment the following two lines for RGBW Neopixels
# strip = neopixel.NeoPixel(
#   pixpin, numpix, bpp=4, brightness=.3, auto_write=True)

# You can have fun here changing the colors for the code
color1 = (236, 79, 100)  # Salmon Pink
color2 = (246, 216, 180)  # Cream
color3 = (174, 113, 208)  # Lavendar
color4 = (182, 31, 40)  # Red
color5 = (91, 44, 86)  # Purple

while True:
    # the first number is the pixel number for Jewel. O is the center one
    strip[1] = color1
    strip[2] = color1
    strip[3] = color1
    strip[4] = color1
    strip[5] = color1
    strip[6] = color1
    strip[0] = color2
    time.sleep(3)

    strip[1] = color2
    strip[2] = color2
    strip[3] = color2
    strip[4] = color2
    strip[5] = color2
    strip[6] = color2
    strip[0] = color3
    time.sleep(3)

    strip[1] = color3
    strip[2] = color3
    strip[3] = color3
    strip[4] = color3
    strip[5] = color3
    strip[6] = color3
    strip[0] = color4
    time.sleep(3)

    strip[1] = color4
    strip[2] = color4
    strip[3] = color4
    strip[4] = color4
    strip[5] = color4
    strip[6] = color4
    strip[0] = color5
    time.sleep(3)

This code requires the neopixel.py library. A factory-fresh board will have this already installed. If you’ve just reloaded the board with CircuitPython, create the “lib” directory and then download neopixel.py from Github.

Get your felt out, as well as a shot glass. Trace the larger side of the shot glass on the felt for a 2" circle. Fold the fabric so you can cut 2 circles at one time.

Now take your scrap of cardboard and use the other side of the shot glass to trace a 1 1/2" circle. Cut one of these.

Get your chopstick, which should now have its finished gloss. Use your hot glue gun to attach the fat side of the chopstick onto the cardboard. The chopstick should lay just a tad under the center of the cardboard, to allow room for the battery.

Next, glue one circle of felt to the cardboard. Be sure to spread the glue evenly as this will be a support for the Jewel. Glue the other circle of felt just to the stick, and not the cardboard. This will form the pocket for the battery.

Embroidery time! Thread a piece of floss and use a split stitch through the edges of the felt with the cardboard side facing up. You must stay close to the edge to allow room for the battery.

When you get close to the 10 o'clock position of the circle, only stitch through the top fabric, creating an opening for the battery. Put your battery inside so you know how wide to leave the opening. Then, finish the rest of the edges going through both layers of fabric, until you get to the stick. There you will only be able to get through one layer.

Gather the jewelry pieces. Using a head pin, thread your beads in your preferred pattern. Then, use your pliers to create a circle at the top of the wire. Create three of these units.

Select an eye pin, and thread your same pattern. When you are done, attach it to one of the other head pin units you made earlier. This will be the one longer strand of the dangle.

Using a jump ring, rotate the split ends apart by moving one side towards you. Don't pull the ring apart side to side or you will never regain the circular shape. Thread the three beaded units onto the ring. Then, attach the jump ring to the bottom of the Jewel on the unmarked hole at the bottom. Use the pliers to clamp the jump ring shut.

Now glue the Jewel onto the cardboard backed felt piece. Then, glue the GEMMA onto the stick/felt side. Concentrate the glue on the top half of the GEMMA where it will adhere nicely to the felt. The rest of the part will sit on the stick. You may want to poke something flat like a spoon handle into the felt pocket to help the GEMMA stick well to the felt and to keep the felt from sticking to the cardboard. 

Wrap the top of your battery with a little Gaff or masking tape to help add strain relief to the wires. Then, tuck it into its pocket and plug into GEMMA. Finally, switch GEMMA on and weave the stick into your hair. It's helpful to poke it through a hairband to help keep it from twisting. Practice your bows and have fun sharing your Japanese style!

This guide was first published on Mar 30, 2015. It was last updated on Mar 30, 2015.