# Gemma Color Touch Pendant Necklace

## Overview

https://youtu.be/gejrUaEHVJw

Make a stunning light up necklace that goes with anything in your closet.&nbsp; It twinkles softly, showing a beautiful color gradient animation.&nbsp; Touch the face of the pendant to make the necklace change color.&nbsp; It's easy to customize the code to include as many different color combinations as you'd like.

Gemma M0's onboard capacitive touch pad combined with a solid metal pendant face make this magic happen.&nbsp; We've added two different sized NeoPixel rings for 28 beautiful pixels of light.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/386/medium800/led_pixels_11_finished.jpg?1539204015)

## Parts
### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
![Pink polished fingers holding a Adafruit GEMMA M0 - Miniature wearable electronic platform. ](https://cdn-shop.adafruit.com/product-videos/640x480/3501-05.jpg)

### NeoPixel Ring - 12 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 12 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1643)
Round and round and round they go! 12 ultra bright smart LED NeoPixels are arranged in a circle with 1.5" (37mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1643)
[Related Guides to the Product](https://learn.adafruit.com/products/1643/guides)
![Hand holding NeoPixel Ring with 12  x 5050 RGB LED, lit up rainbow](https://cdn-shop.adafruit.com/640x480/1643-00.jpg)

### NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1463)
Round and round and round they go! 16 ultra bright smart LED NeoPixels are arranged in a circle with 1.75" (44.5mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1463)
[Related Guides to the Product](https://learn.adafruit.com/products/1463/guides)
![Hand holding NeoPixel Ring with 16 x 5050 RGB LED, lit up rainbow](https://cdn-shop.adafruit.com/640x480/1463-00.jpg)

### Lithium Ion Polymer Battery - 3.7v 150mAh

[Lithium Ion Polymer Battery - 3.7v 150mAh](https://www.adafruit.com/product/1317)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 150mAh for a total of about 0.6 Wh. If you need a larger battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1317)
[Related Guides to the Product](https://learn.adafruit.com/products/1317/guides)
![Angle Shot of Lithium Ion Polymer Battery 3.7v 150mAh with JST 2-PH connector](https://cdn-shop.adafruit.com/640x480/1317-03.jpg)

### Adafruit Micro Lipo - USB LiIon/LiPoly charger

[Adafruit Micro Lipo - USB LiIon/LiPoly charger](https://www.adafruit.com/product/1304)
Oh so adorable, this is the tiniest little lipo charger, so handy you can keep it any project box! Its also easy to use. Simply plug in the gold plated contacts into any USB port and a 3.7V/4.2V lithium polymer or lithium ion rechargeable battery into the JST plug on the other end. There are...

In Stock
[Buy Now](https://www.adafruit.com/product/1304)
[Related Guides to the Product](https://learn.adafruit.com/products/1304/guides)
![Top view of Adafruit Micro Lipo - USB LiIon/LiPoly charger - v1 above a 2-pin JST cable.](https://cdn-shop.adafruit.com/640x480/1304-06.jpg)

### Silicone Cover Stranded-Core Wire - 2m 30AWG Red

quantity: 3
[Silicone Cover Stranded-Core Wire - 2m 30AWG Red](https://www.adafruit.com/product/2001)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

In Stock
[Buy Now](https://www.adafruit.com/product/2001)
[Related Guides to the Product](https://learn.adafruit.com/products/2001/guides)
![Bundle of red, silicone cover, stranded-core wire.](https://cdn-shop.adafruit.com/640x480/2001-01.jpg)

## Materials

In addition to the products above, you'll need:

- A solid, conductive, non-coated metal pendant, around 2" or larger in diameter, with cutouts that allow the light through.&nbsp; [I used this one from hildie & jo](http://www.joann.com/hildie-jo-boulevard-sunburst-silver-pendant-clear-crystal-beads/15478811.html#prefn1=brand&prefn2=collection&prefv3=Silvers&prefv1=hildie%20&%20jo=&prefv2=hildie%20&%20jo%20Boulevard=&prefn3=refinementColor&addShipToHomeConditions=false&start=1)
- Soldering iron & solder
- E6000 glue or epoxy
- A necklace cord or chain

A [multimeter](https://www.adafruit.com/product/2034?gclid=Cj0KCQjwzIzWBRDnARIsAAkc8hHaO2z5WyFV-81RROl5dT53N_yH_BPT42_IVCmzvUSz6GRaX77t6xIaAgCLEALw_wcB) can also be handy to be sure your pendant conducts electricity.&nbsp; Bring it to the craft store with you and test all the pendants you can find.

# Gemma Color Touch Pendant Necklace

## Wiring Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/052/539/medium800/led_pixels_colortouch_wiring.jpg?1522094808)

We'll stack the two NeoPixel rings with the smaller ring on top, and nestle the battery inside the larger ring.&nbsp; The gemma will sit on the back of the assembly, so the on/off switch, USB port and battery port are accessible.&nbsp;&nbsp;

## Wiring Connections

The Assembly page will show step-by-step wiring. Here is a table of the connections that will be made:

![](https://cdn-learn.adafruit.com/assets/assets/000/052/540/medium800/led_pixels_00_testconductivity.jpg?1522095149)

For the capacitive touch pad to work when it's connected to your pendant, you'll need to be sure to use a pendant that conducts electricity.&nbsp; Use your multimeter to test and be sure your pendant is conductive.

If your pendant doesn't conduct electricity you can still make this work.&nbsp; Instead of touching the face of the necklace to change colors, you'll just need to flip it over and touch the gemma's capacitive touch pad directly.

# Gemma Color Touch Pendant Necklace

## Software

It's a great idea to get your software all set up and loaded onto your board right away, to make testing your connections easier later on.

To get the code running you'll need:

1. Arduino IDE (1.8 or newer preferred)
2. Adafruit Board support for Gemma M0
3. Arduino libraries: FastLED, Adafruit\_FreeTouch, Adafruit\_NeoPixel

### 1. Arduino IDE

If you’re not using a recent version of the Arduino IDE (1.8.5 or newer), this would be a [good time to upgrade](https://www.arduino.cc/en/Main/Software).&nbsp; If this is your first time using Arduino, [head over to this guide to get it installed](../../../../adafruit-arduino-ide-setup/arduino-1-dot-6-x-ide).&nbsp; It's free and fairly simple to get set up.

### 2. Board Support

You'll need to tell the Arduino IDE which board you're using.&nbsp; This takes just a few minutes of setup, and you'll only need to do it once.&nbsp;

[Here is a step-by-step tutorial for setting up Gemma M0](../../../../adafruit-gemma-m0/arduino-ide-setup)

### 3. Libraries

All three libraries can be installed using the Arduino Library Manager — use **Sketch** → **Include Library** → **Manage Libraries…** and search for all or part of the library’s name, then click “Install.”

Look for:

- `FastLED`
- `Adafruit_FreeTouch`
- `Adafruit_NeoPixel`

`Adafruit_NeoPixel` isn’t absolutely required for this project, but it’s handy to have installed in case you have problems with FastLED. Troubleshooting the basics is a little easier with `Adafruit_NeoPixel`.

## Upload the Code

Plug your microcontroller into your computer with a USB cable.&nbsp; In the Arduino IDE, go to **Tools -\> Boards** and select the name of the board.&nbsp; Then go to **Tools -\> Port** and select the board there too.&nbsp; (If it's not showing up there, be sure your microcontroller is plugged into your computer via USB).

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/color_touch_pendant/color_touch_pendant.ino

# Gemma Color Touch Pendant Necklace

## Assembly

Start with your smaller 12 pixel ring.&nbsp; Solder a red wire to 5v, a black wire to G, and a white wire to Data IN.&nbsp; It's easiest to insert the wires from the front and solder on the back of the ring.

&nbsp;

Trim the wires to about 1/2" and strip the ends.&nbsp; Twist another red wire and another black wire together with the wires you soldered.&nbsp;

![led_pixels_00_solderring1.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/526/medium640/led_pixels_00_solderring1.jpg?1522092652)

![led_pixels_01_addwires.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/527/medium640/led_pixels_01_addwires.jpg?1522092669)

Place the 12 pixel ring on top of the 16 pixel ring.&nbsp; Solder BOTH the twisted red and black wires into the respective 5v and G holes on the second ring.&nbsp;

&nbsp;

Solder the white wire coming from the smaller ring into the Data OUT pin.&nbsp; Then, add another wire to the 16 pixel ring's Data IN pin.

![led_pixels_02_solderring2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/528/medium640/led_pixels_02_solderring2.jpg?1522092845)

![led_pixels_03_datainwire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/529/medium640/led_pixels_03_datainwire.jpg?1522092857)

Pull the three loose wires through so they come out the back of the larger ring.&nbsp; Trim the wires and solder them to the Gemma: red to Vout, black to GND, and your data wire to D1.

![led_pixels_04_pullwiresthrough.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/530/medium640/led_pixels_04_pullwiresthrough.jpg?1522092954)

![led_pixels_05_soldergemma.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/531/medium640/led_pixels_05_soldergemma.jpg?1522092967)

Solder a 2" wire to gemma's pin D0.&nbsp; This wire will connect Gemma's capacitive touch pad to your metal pendant front to activate the capacitive touch features.

![led_pixels_07_captouchwire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/532/medium640/led_pixels_07_captouchwire.jpg?1522093054)

Plug your battery into the Gemma and flip the switch to "on".&nbsp; Be sure both rings are lighting up.&nbsp; Test the capacitive touch function by stripping the other end of the wire you soldered to D0, and touch the bare wires to make the lights change color.

If they're not changing, or if they appear to be changing lightning-fast, you may need to calibrate your code.&nbsp; Check the calibration section later in this guide.&nbsp;&nbsp;

Set the battery inside the large ring and nestle it against the back of the smaller ring.&nbsp; Center the rings so the LEDs show as much as possible.&nbsp;

&nbsp;

Place the Gemma on the back of the pile, with the switch facing up.&nbsp; Be sure the battery wire can be pulled out easily and replaced -- you'll need to unplug this for charging.&nbsp; Once it's all aligned, glue all the components together with E6000 glue or epoxy.

![led_pixels_08_gluedtogether.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/535/medium640/led_pixels_08_gluedtogether.jpg?1522093320)

![led_pixels_09_gluedtopendant.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/536/medium640/led_pixels_09_gluedtopendant.jpg?1522093336)

Glue the whole assembly to the back of your pendant.

Thread the capacitive touch wire UNDER the battery wires if needed.&nbsp; Trim the wire and strip and tin the end.&nbsp; Solder it securely to the back of your metal pendant.&nbsp; Add a blob of glue on top of the solder to keep it secure.

![led_pixels_10_soldercaptouch.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/537/medium640/led_pixels_10_soldercaptouch.jpg?1522093531)

Add a necklace cord.&nbsp; Put your pendant on, above your bare skin (not over a shirt or sweater) and touch to change color modes.&nbsp;&nbsp;

&nbsp;

You may need to do some calibration in the code to get it reacting correctly to your touch.&nbsp;

![led_pixels_11_finished.jpg](https://cdn-learn.adafruit.com/assets/assets/000/052/538/medium640/led_pixels_11_finished.jpg?1522093602)

# Gemma Color Touch Pendant Necklace

## Calibration

## Capacitive Touch Sensitivity

Capacitive touch pads can be finicky, especially for wearables and battery powered projects.&nbsp; Capacitive touch functionality is happiest when there's a strong ground connection, like you get with a wall plug.&nbsp; For small battery powered projects there's no real ground.&nbsp; But that's okay!&nbsp; Our body's electromagnetic field can work as our ground connection.

When this necklace is being worn against bare skin, the electronics have contact with the body, and through the body, the ground.&nbsp; You may find the necklace won't change colors if you touch it when you aren't wearing it, or if it's being worn over a sweater or other clothing.&nbsp; It needs that skin contact to be able to read your touch.&nbsp;&nbsp;

This can make calibration a little bit tricky, but with some trial and error you can get it to respond correctly.

![](https://cdn-learn.adafruit.com/assets/assets/000/052/730/medium800/led_pixels_serial_monitor2.jpg?1522788284)

With your necklace fully assembled, plug it in to your computer's USB port and switch it on.&nbsp; Open the code in your Arduino window, then open the serial monitor.&nbsp; You should see numbers scrolling by.&nbsp; (If you don't see them, try re-uploading the code)

Touch the pendant's face firmly with the pads of your fingers.&nbsp; You should see a change in the numbers scrolling by when the necklace reads your touch. When you let go, the values will revert.

Now look at your code and find this line near the top:

```auto
// Calibrating your capacitive touch sensitivity: Change this variable to something between your capacitive touch serial readouts for on and off
int touch = 850;  
```

Change the number to a number roughly halfway between your "touched" and "not touched" numbers.&nbsp; Since I have 700-ish as "not touched" and 1000-ish as "touched", I chose 850.

Re-upload the code.&nbsp; Now the color should change when you touch the necklace.&nbsp; &nbsp;

You're not quite done yet!&nbsp; Unplug the necklace and put it on, so that the back of the necklace is touching your skin (not over your shirt).&nbsp; &nbsp;See if it still works the same way.&nbsp; If so, you're golden!&nbsp; If not, plug your necklace back in and try adjusting this value until it works the way you like.

## Color Calibration

There are several other variables you can change that will allow you to customize the way your necklace acts.&nbsp;&nbsp;

BRIGHTNESS: This will adjust the brightness -- use a value between 0 and 255.

SATURATION: Make your colors more pastel (lower number) or more rainbow-bright (255 max).

COLORCHANGE:&nbsp; Use this variable to define how much the color value changes each time you touch the necklace.&nbsp;

The code starts with a hue of 0, also known as "red".&nbsp; FastLED breaks down hue values on a range of 0-255, with red at 0, yellow around 60, and blue around 180, until it cycles back to red at 255.&nbsp; &nbsp;Using a value of 50 means that each time you touch the necklace, the hue will jump by 50.&nbsp; This gives me 6 different modes: red-orange (0), yellow-green (50), green-blue (100), blue-purple (150), purple-pink (200), and red-purple (250).&nbsp;&nbsp;

Using a value of 30 would give me 8 different color modes, since the hue would jump by 30 each time.&nbsp; Play with this until you get a satisfying array of colors.

https://youtu.be/Jh0vgneC3jQ


## Guide Products

### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
### NeoPixel Ring - 12 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 12 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1643)
Round and round and round they go! 12 ultra bright smart LED NeoPixels are arranged in a circle with 1.5" (37mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1643)
[Related Guides to the Product](https://learn.adafruit.com/products/1643/guides)
### NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1463)
Round and round and round they go! 16 ultra bright smart LED NeoPixels are arranged in a circle with 1.75" (44.5mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1463)
[Related Guides to the Product](https://learn.adafruit.com/products/1463/guides)
### Lithium Ion Polymer Battery - 3.7v 150mAh

[Lithium Ion Polymer Battery - 3.7v 150mAh](https://www.adafruit.com/product/1317)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 150mAh for a total of about 0.6 Wh. If you need a larger battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1317)
[Related Guides to the Product](https://learn.adafruit.com/products/1317/guides)
### Adafruit Micro Lipo - USB LiIon/LiPoly charger

[Adafruit Micro Lipo - USB LiIon/LiPoly charger](https://www.adafruit.com/product/1304)
Oh so adorable, this is the tiniest little lipo charger, so handy you can keep it any project box! Its also easy to use. Simply plug in the gold plated contacts into any USB port and a 3.7V/4.2V lithium polymer or lithium ion rechargeable battery into the JST plug on the other end. There are...

In Stock
[Buy Now](https://www.adafruit.com/product/1304)
[Related Guides to the Product](https://learn.adafruit.com/products/1304/guides)
### Silicone Cover Stranded-Core Wire - 2m 30AWG Red

[Silicone Cover Stranded-Core Wire - 2m 30AWG Red](https://www.adafruit.com/product/2001)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

In Stock
[Buy Now](https://www.adafruit.com/product/2001)
[Related Guides to the Product](https://learn.adafruit.com/products/2001/guides)

## Related Guides

- [Sewable NeoPixels](https://learn.adafruit.com/flora-rgb-smart-pixels.md)
- [Light Up your Costume with Noods](https://learn.adafruit.com/light-up-your-costume-with-noods.md)
- [Adafruit Feather RP2040 RFM69](https://learn.adafruit.com/feather-rp2040-rfm69.md)
- [Adafruit Feather RP2040 with DVI Output Port](https://learn.adafruit.com/adafruit-feather-rp2040-dvi.md)
- [Getting Started with FLORA](https://learn.adafruit.com/getting-started-with-flora.md)
- [Glowing Scale Armor](https://learn.adafruit.com/glowing-scale-armor.md)
- [Annoy-O-Matic Sound Prank Device](https://learn.adafruit.com/annoy-o-matic-sound-prank-device.md)
- [NeoPixel Novelty Cufflinks with Scrolling Text](https://learn.adafruit.com/neopixel-novelty-cufflinks-with-scrolling-text.md)
- [Cartoon Network and Make Code - Rose Quartz Shield Umbrella](https://learn.adafruit.com/cartoon-network-and-make-code-rose-quartz-shield-umbrella.md)
- [Frozen-Inspired Animated Pendant with Temperature Sensing](https://learn.adafruit.com/frozen-gizmo-pendant-with-temperature-sensing.md)
- [MakeCode Maker](https://learn.adafruit.com/makecode-maker.md)
- [ANO Directional Navigation and Scroll Wheel Rotary Encoder and Breakout](https://learn.adafruit.com/ano-rotary-encoder.md)
- [Watchmen's Sister Night NeoPixel Goggles](https://learn.adafruit.com/watchmen-sister-night-circuitpython-neopixel-goggles.md)
- [AM Radio Morse Code Paddle](https://learn.adafruit.com/am-radio-morse-code-paddle.md)
- [Cosplay Floating LED Fireball with Motion Sensing](https://learn.adafruit.com/cosplay-fireball-prop-with-motion-sensing.md)
- [NeoPixel Ring Lamp](https://learn.adafruit.com/neopixel-ring-lamp.md)
