# Sound Reactive NeoPixel Peace Pendant

## Overview

https://youtu.be/0NRY9WaExDg?t=6

This Peace pendant project is a great way to hone your 3D printing + electronics skills.

The circuitry for this wearable project isn't that complex, and the 3D printed enclosure will provide a compact&nbsp;pendant that you can wear to your next party or event.

Info: 

 **Features:**

- Sound reactive
- Rechargeable
- On/Off switch
- Programmable

Before you begin, please&nbsp;read the following prerequisite guides:

- [Adafruit Guide To Excellent Soldering](../../../adafruit-guide-excellent-soldering)
- [Battery Powering your Wearable Electronics](https://www.youtube.com/watch?v=U_Q3djsktQs)
- [Introducing Gemma](../../../introducing-gemma)&nbsp;or&nbsp;[Introducing Gemma M0](../../../../adafruit-gemma-m0/)

**Parts:**

- [Gemma M0](https://www.adafruit.com/product/3501) or [Gemma v2](http://www.adafruit.com/products/1222) (M0 type is recommended!)
- [NeoPixel Ring (12 LEDs).](https://www.adafruit.com/products/1643)
- [Switch.](https://www.adafruit.com/products/805)
- [#4 3/8 inch Screws (x2)](http://www.homedepot.com/p/Everbilt-4-x-3-8-in-Zinc-Plated-Phillips-Flat-Head-Wood-Screw-12-per-Pack-806861/204283336) or similar.
- [Li-Po battery 3.7V 150mAh.](https://www.adafruit.com/product/1317)
- [Lipoly battery charger.](https://www.adafruit.com/products/1904)
- [Mic Amp&nbsp;[MAX4466]](https://www.adafruit.com/products/1063) or [Mic Amp [MAX9814] ](https://www.adafruit.com/product/1713)either will work
- Necklace and ring.
- Micro USB cable for programming/charging.
- [22 AWG hook-up wire](https://www.adafruit.com/products/290)&nbsp;or any other suitable wire.

**Tools and Supplies:**

- Access to a 3D printer with filament.
- Soldering Iron with solder.
- Wire Strippers and pliers.
- Hot glue gun and super glue.

![](https://cdn-learn.adafruit.com/assets/assets/000/029/531/medium800/led_pixels_parts.jpg?1452189127)

# Sound Reactive NeoPixel Peace Pendant

## 3D Printing

Please download the .stl files&nbsp;and print out the enclosure and lid. Some support material is required, but nothing intense.

[Click here to download the .STL files from Thingiverse](http://www.thingiverse.com/thing:1134027)
![](https://cdn-learn.adafruit.com/assets/assets/000/029/611/medium800/led_pixels_peacependant_3dprint.png?1452369375)

# Sound Reactive NeoPixel Peace Pendant

## Assembly

The pendant assembly shouldn't be&nbsp;that complicated. The enclosure was designed to comfortably hold the electronics&nbsp;without much hassle. Please see [the video](https://youtu.be/0NRY9WaExDg) for an&nbsp;assembly summary.

![](https://cdn-learn.adafruit.com/assets/assets/000/029/615/medium800/led_pixels_peace_pendant_final_circuit.png?1452374536)

Info: 

Circuit Summary:

- Gemma D0&nbsp;-\>&nbsp;NeoPixel ring IN
- Gemma D2 -\>&nbsp;Mic OUT
- Gemma GND -\>&nbsp;NeoPixel ring GND
- Gemma 3V -\> Mic VCC
- Gemma Vout&nbsp;-\>&nbsp;NeoPixel ring PWR
- NeoPixel ring GND-\>&nbsp;Mic GND
- LiPoly charger GND-\>&nbsp;Black wire on JST cable
- LiPoly charger BAT-\>&nbsp;Switch corner pin
- Switch middle&nbsp;pin-\>&nbsp;Red&nbsp;wire on JST cable

1) Start by soldering short lengths of hook-up wire to the LED ring. The front face of the enclosure was designed with holes aligned to the LED ring wire solder points. Mount the ring onto the face of the enclosure and slide the wires into the enclosure. You could use some adhesive to anchor the ring, but this isn't required since the fit is tight enough to hold it in place.  
  
2) Solder a short piece of wire to one of the far-end pins on the slide switch, and connect that to the BAT of the LiPo charger.  
  
Solder the RED lead of the JST-PH lead onto the middle pin of the slide switch. Please see the circuit diagram.  
  
3) Push the slide switch into the opening on the side of the enclosure. Secure the switch in place by using some glue.

Warning: 

4) Solder the Black GND lead of the JST-PH lead to the GND on the LiPo charger.  
Please ensure the wires soldered to the LiPo charger are attached to the TOP side of the charger. This ensures the charger would sit flush when inserted into the enclosure.  
  
5) Solder short lengths of hook-up wire to the MIC amp. The connections are shown in the circuit picture above.  
  
6) Solder the LED ring wires to the Gemma according to the circuit diagram.  
  
7) Insert the battery lead into the LiPo charger and seat the charger in the enclosure. Use some hot glue to secure the charger on the enclosure. Ensure that this is properly done because the USB cable will constantly be attached and detached for charging.

![](https://cdn-learn.adafruit.com/assets/assets/000/029/612/medium800/led_pixels_assembly1.jpg?1452369784)

8) At this point, the soldering is complete. Lets program the Gemma&nbsp;before final assembly. You will need the [Adafruit NeoPixel library](https://github.com/adafruit/Adafruit_NeoPixel) for the sketch. Grab the [Arduino sketch](../../../../sound-reactive-neopixel-peace-pendant/code)&nbsp;and load it onto the Gemma. Putting the Gemma into the bootloader mode is [documented here](../../../../introducing-gemma/setting-up-with-arduino-ide).   
  
Once the sketch is loaded, test the flashing of the LEDs by tapping the mic. The LEDs should react to the sound. If it does not work, please check your wiring and ensure your Arduino sketch is loaded correctly.  
  
9) Once the circuit is verified to be working, button-up your project by putting the LiPo battery in the enclosure and pass the JST lead under the charger partition that is built into the enclosure. Please see below.

![](https://cdn-learn.adafruit.com/assets/assets/000/029/613/medium800/led_pixels_assembly2.png?1452369850)

10) If you want to insert a ring to hang the enclosure on a laynard, now would be the time before final assembly.

Please see&nbsp;below.

![](https://cdn-learn.adafruit.com/assets/assets/000/029/614/medium800/led_pixels_assembly3.jpg?1452369887)

11) Lets do the final assembly by inserting the battery first, then the Gemma.

Now insert a small plastic spacer before putting in the MIC to prevent any short circuits. You can use a piece of plastic. I used a scrap piece of 3D printed plastic and placed it on top of the Gemma, then inserted the MIC on top of that.  
  
Close the &nbsp;enclosure using 2 x #4 3/8 inch screws with the 3D printed lid. Ensure that the USB charging port lines up with the opening. Attach a laynard, beaded necklace or whatever you like for a necklace.

# Sound Reactive NeoPixel Peace Pendant

## Arduino Code

Info: 

Installing Arduino libraries is a frequent stumbling block. If this is your first time, or simply needing a refresher, please read the&nbsp;[All About Arduino Libraries](http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use)&nbsp;tutorial.[![](../../../../assets/divider_icon-45a76f14a0234c47f43488c60c9d77a1701a0ff9f3a09498809a26305ce3df23.gif)](../../../../neopixel-punk-collar/3634)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**

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

From the&nbsp; **Tools→Board** &nbsp;menu, select&nbsp;the&nbsp;device you are using: **&nbsp;**

- **Adafruit Gemma M0**
- **Adafruit Gemma 8 MHz** &nbsp;

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.

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&nbsp;[NeoPixel Uberguide](../../../../adafruit-neopixel-uberguide)&nbsp;for more info.

# Sound Reactive NeoPixel Peace Pendant

## CircuitPython Code

![](https://cdn-learn.adafruit.com/assets/assets/000/048/079/medium800/led_pixels_gemma-cp.jpg?1510171225)

 **GEMMA&nbsp;M0** &nbsp;boards can&nbsp;run&nbsp; **CircuitPython** &nbsp;— a different approach to programming compared to Arduino sketches. In fact,&nbsp; **CircuitPython comes&nbsp;factory pre-loaded on GEMMA&nbsp;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&nbsp;[**Adafruit GEMMA&nbsp;M0 guide**](../../../../adafruit-gemma-m0/circuitpython-setup-1).

Info: 

Below is CircuitPython code that works&nbsp;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&nbsp; **flash drive** …then edit the file “ **main.py** ” with your text editor of choice. Select and copy the code below and paste it into that file,&nbsp; **entirely replacing its contents** &nbsp;(don’t mix it in with lingering bits of old code). When you save the file, the code should&nbsp; **start running almost immediately** &nbsp;(if not, see notes at the bottom of this page).

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

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Sound_Reactive_NeoPixel_Peace_Pendant/code.py

This code requires the&nbsp; **neopixel.py** &nbsp;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&nbsp;[download neopixel.py from Github](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel).

# Sound Reactive NeoPixel Peace Pendant

## Wear It

Turn on the pendant by sliding on the switch. Test it by snapping your fingers or clapping. You can adjust the sensitivity of the pendant by playing around with the gain of the MIC (pot on the back of the MIC amp); you can also adjust the sensitivity in the Arduino sketch.  
  
In order to charge the pendant, simply attach a micro USB cable to the LiPo charger.

![](https://cdn-learn.adafruit.com/assets/assets/000/029/606/medium800thumb/led_pixels_peace_pendant_loopGIF.jpg?1452361290)


## Featured 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)
### Adafruit GEMMA v2 - Miniature wearable electronic platform

[Adafruit GEMMA v2 - Miniature wearable electronic platform](https://www.adafruit.com/product/1222)
 **Deprecation Warning: The Gemma bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Gemma so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1222)
[Related Guides to the Product](https://learn.adafruit.com/products/1222/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)
### Adafruit Micro-Lipo Charger for LiPo/LiIon Batt w/MicroUSB Jack

[Adafruit Micro-Lipo Charger for LiPo/LiIon Batt w/MicroUSB Jack](https://www.adafruit.com/product/1904)
Oh so handy, this little lipo charger is so small and easy to use you can keep it on your desk or mount it easily into any project! Simply plug it via any MicroUSB cable into a USB port and a 3.7V/4.2V lithium polymer or lithium ion rechargeable battery into the JST plug on the other end....

In Stock
[Buy Now](https://www.adafruit.com/product/1904)
[Related Guides to the Product](https://learn.adafruit.com/products/1904/guides)
### Electret Microphone Amplifier - MAX4466 with Adjustable Gain

[Electret Microphone Amplifier - MAX4466 with Adjustable Gain](https://www.adafruit.com/product/1063)
Add an ear to your project with this well-designed electret microphone amplifier. This fully assembled and tested board comes with a 20-20KHz electret microphone soldered on. For the amplification, we use the Maxim MAX4466, an op-amp specifically designed for this delicate task! The amplifier...

In Stock
[Buy Now](https://www.adafruit.com/product/1063)
[Related Guides to the Product](https://learn.adafruit.com/products/1063/guides)
### Electret Microphone Amplifier - MAX9814 with Auto Gain Control

[Electret Microphone Amplifier - MAX9814 with Auto Gain Control](https://www.adafruit.com/product/1713)
Add an ear to your project with this well-designed electret microphone amplifier with AGC. This fully assembled and tested board comes with a 20-20KHz electret microphone soldered on. For the amplification, we use the Maxim MAX9814, a specialty chip that is designed for amplifying electret...

In Stock
[Buy Now](https://www.adafruit.com/product/1713)
[Related Guides to the Product](https://learn.adafruit.com/products/1713/guides)
### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

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

## Related Guides

- [LED Masquerade Masks](https://learn.adafruit.com/led-masquerade-masks.md)
- [Build your own Borg (BYOB)](https://learn.adafruit.com/build-your-own-borg-byob.md)
- [3D Printed Unicorn Horn](https://learn.adafruit.com/3d-printed-unicorn-horn.md)
- [Trinket “Question Block” Sound Jewelry](https://learn.adafruit.com/trinket-question-block-sound-jewelry.md)
- [How to Choose a Microcontroller](https://learn.adafruit.com/how-to-choose-a-microcontroller.md)
- [NeoPixels on Raspberry Pi](https://learn.adafruit.com/neopixels-on-raspberry-pi.md)
- [Glowing Fascinator Hat with Gemma M0 and MakeCode](https://learn.adafruit.com/glowing-fascinator-hat-gemma-m0-makecode.md)
- [Bluefruit Playground App](https://learn.adafruit.com/bluefruit-playground-app.md)
- [Playa Festival Bike](https://learn.adafruit.com/playa-festival-bike.md)
- [3D Printed LED-Animation BMO](https://learn.adafruit.com/3d-printed-led-animation-bmo.md)
- [How to Program SAMD Bootloaders](https://learn.adafruit.com/how-to-program-samd-bootloaders.md)
- [Porting an Arduino library to CircuitPython: VL6180X Distance Sensor](https://learn.adafruit.com/porting-an-arduino-library-to-circuitpython-vl6180x-distance-sensor.md)
- [NeoPixel Tiara](https://learn.adafruit.com/neopixel-tiara.md)
- [Using DS18B20 Temperature Sensor with CircuitPython](https://learn.adafruit.com/using-ds18b20-temperature-sensor-with-circuitpython.md)
- [Mystical LED Halloween Hood](https://learn.adafruit.com/mystical-led-halloween-hood.md)
