# Trinket “Question Block” Sound Jewelry

## Overview

http://youtu.be/4AxgEO3YlZE

“Ba-DING!” The classic 8-bit chime from our favorite retro video game finally makes a triumphant come back as a Mario question block necklace.

It’s so tiny and adorable you're probably wondering, “How much?” This is&nbsp;_custom_…you can only _make_ it, not buy it!

In this DIY&nbsp;project, we'll show you how to build the Mario coin sound jewelry so you can wear it and learn about electronics and 3d printing.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/134/medium800/components_hero-holda.jpg?1415758944)

Info: 

## Prerequisite Guides

- [Adafruit Trinket M0](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino/overview)
- [Adafruit GEMMA M0](https://learn.adafruit.com/adafruit-gemma-m0/circuitpython-setup-1)
- [Introducing Trinket](../../../introducing-trinket "Link: https://learn.adafruit.com/introducing-trinket")
- [Introducing GEMMA](../../../introducing-gemma/)

![](https://cdn-learn.adafruit.com/assets/assets/000/021/116/medium800/components_parts.jpg?1415754053)

## Parts

- Adafruit&nbsp;**[Gemma M0](https://www.adafruit.com/product/3501),&nbsp;[Trinket M0](https://www.adafruit.com/product/3500),&nbsp;**[**Trinket Mini**](http://www.adafruit.com/category/261)&nbsp;or&nbsp;[**Gemma v2**](http://www.adafruit.com/products/1222)&nbsp;microcontroller board (if Trinket, either the&nbsp;[3.3V](http://www.adafruit.com/products/1500)&nbsp;or&nbsp;[5V](http://www.adafruit.com/products/1501) type works). We recommend using the&nbsp;[Gemma M0](https://www.adafruit.com/product/3500).&nbsp;
- [LED Sequins](https://www.adafruit.com/products/1758)&nbsp;(warm white, or any color if you prefer) (photo shows a single LED sequin, was later decided&nbsp;that two looks better)
- [Slide Switch](https://www.adafruit.com/products/805 "Link: https://www.adafruit.com/products/805")
- [100mAh LiPoly battery](https://www.adafruit.com/product/1570)
- [LiPoly backpack](https://www.adafruit.com/product/2124)-&nbsp;for recharging the batteries

## Tools & Supplies

- [Solder Iron](https://www.adafruit.com/products/1204 "Link: https://www.adafruit.com/products/1204") + [Solder](https://www.adafruit.com/products/734 "Link: https://www.adafruit.com/products/734")
- [Silicone&nbsp;Wire](https://www.adafruit.com/products/1877 "Silicone Wire")
- [PLA&nbsp;Filament](https://www.adafruit.com/search?q=ninjaflex "Link: https://www.adafruit.com/search?q=ninjaflex")
- [3D Printer](https://www.adafruit.com/search?q=3d+printer "Link: https://www.adafruit.com/search?q=3d+printer")
- [Heat shrink tubing](https://www.adafruit.com/product/344)
- #2-56 machine screws

![](https://cdn-learn.adafruit.com/assets/assets/000/021/117/medium800/components_parts-2.jpg?1415754715)

# Trinket “Question Block” Sound Jewelry

## 3D Printing

## FDM 3D Printing

These parts are optimized to print with desktop 3D Printers capable of printing in ABS or PLA material with a minium build area of 100mm x 100mm x 90mm.&nbsp;&nbsp;The two&nbsp;parts are&nbsp;designed to print **without** any support material.&nbsp;

## Light Diffusion

The **coinDiff.stl** part should be printed in either transparent or a light colored material. This is the part that will diffuse the LED so that the question mark&nbsp;logo in the cover illumates.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/118/medium800/components_3d-parts.jpg?1415756547)

The standard case design fits a tiny 100 mAh LiPoly battery for maximum portability.

[Download STLs](http://www.thingiverse.com/thing:541816)
## Slicing Software

The recommend settings above should work with most slicing software. However, you are encouraged to use your own settings since 3D printers and slicing software will vary from printer to printer.

## PLA or ABS Material

We recommend using PLA material for an easier print with high quality. The tolerance has been tested with PLA filament but should also work with ABS. The parts do not require any support material or a raft.

# Trinket “Question Block” Sound Jewelry

## Assembly

Info: 

## Trinket Mini 5v Circuit Diagram
![](https://cdn-learn.adafruit.com/assets/assets/000/024/685/medium800/components_diagram-new.png?1429761292)

# Trinket M0 Circuit Diagram
![](https://cdn-learn.adafruit.com/assets/assets/000/061/238/medium800/3d_printing_Trinket_Question_Block_Sound_Jewelry.png?1536328694)

Info: 

Two connections will be made on the **back** of the Trinket, using one of the pads for the optional JST connector.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/120/medium800/components_wires.jpg?1415756652)

# Measure Wires

Lay the LiPoly backpack on top of the Trinket and cut each wire so that they are&nbsp;just long enough reach the through-holes on the Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/119/medium800/components_lipo-back-filed.jpg?1415756615)

## Prepare LiPoly backpack

Use a filing tool to&nbsp;remove the trace&nbsp;to the battery output line to enable&nbsp;use with a slide switch.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/124/medium800/components_lipo-wires.jpg?1415756823)

## Solder&nbsp;LiPoly wires

Add a slide switch to each pin of the battery output line.&nbsp;Tin the pins&nbsp;for the LiPoly backpack and add the wires that will connect it to the Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/121/medium800/components_vibration-bent.jpg?1415756700)

## Prepare Vibration sensor

Bend the thicker pin&nbsp;of&nbsp;the&nbsp;vibration sensor so that it curves&nbsp;level to the&nbsp;outer cylinder.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/122/medium800/components_vibration-ground-bent.jpg?1415756732)

## Align Vibration sensor to Trinket

Use a small amount of tac to hold the vibration sensor in place while aligning the pins to the pads on the back of the Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/123/medium800/components_vibration-soldered1.jpg?1415756786)

## Vibration sensor thinner&nbsp;pin

Bend back the thinner pin so that it reaches into&nbsp;pin #2.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/125/medium800/components_lipo-wires-soldered.jpg?1415756899)

## LiPoly backpack wires

Use tweezers to help align each wire into the Trinket through-holes.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/126/medium800/components_lipo-gnd.jpg?1415756959)

## LiPoly&nbsp;ground

Share the ground with the vibration sensor on the back pad of the Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/128/medium800/components_backpack_vibration-soldered.jpg?1415757135)

This makes it easier to solder the LED wires on top of the Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/127/medium800/components_led-soldered.jpg?1415757099)

(Photo shows a single LED…later it was decided that two LEDs in parallel&nbsp;worked better. See&nbsp;diagram at the top of this&nbsp;page for wiring. Later photos show placement of two LEDs.)

## Solder&nbsp;LEDs

Measure the length&nbsp;needed to fully diffuse the insde of the case. LEDs&nbsp;have a specific polarity…+ should go to pin #4, – should go to GND. Two should be used in parallel&nbsp;(see diagram at the top of this page)…it should be possible to fit two wires into each hole on the Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/131/medium800/components_tape-tac-piezo.jpg?1415757330)

## Trinket tac

Use a small amount of tac to help secure the LiPoly backpack to the&nbsp;top of the Trinket.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/129/medium800/components_tape-leds1.jpg?1415757215)

## Light pollution

Use strips of black tape to help clear the enclosure of any red or green lights from the LiPoly and Trinket LEDs.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/135/medium800/components_piezo-wire-thread.jpg?1415760056)

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/021/136/medium800/components_piezo-mounting.jpg?1415760076)

# Mount Piezo&nbsp;

Use two #2 56 phillip screws to mount the piezo to the back of the enclosure.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/130/medium800/components_piezo_solder_in_case.jpg?1415757271)

![](https://cdn-learn.adafruit.com/assets/assets/000/021/137/medium800/components_pizeo-wire-coil.jpg?1415760110)

## Coil piezo wires

To fit the circuit inside the tight space, coil the the piezo wires inside of the standoffs for the Trinket.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/021/138/medium800/components_trinket-mount-screw.jpg?1415760137)

## Mount Trinket

Use one more #2 56 phillips screw to securly mount the Trinket to inside of the enclosure.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/139/medium800/components_slide-switch-insert.jpg?1415760161)

## Insert slide switch

Use [curved](https://www.adafruit.com/product/422)&nbsp;tipped tweezers to insert the slide switch into the two clips near the top.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/140/medium800/components_diffuser-insert.jpg?1415760206)

## Diffuser

Snap the diffsuer&nbsp;inside of the top cover part to help soften the light from the LEDs.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/132/medium800/components_complete-in-case.jpg?1415757427)

## Position LEDs

Test that the diffustion is even by moving the two LEDs around in the enslosure until the lighting is even.

![](https://cdn-learn.adafruit.com/assets/assets/000/021/133/medium800thumb/components_top-cover-attach.jpg?1448313600)

## Wear it!

Attach a split ring and necklace to rock out with an&nbsp;audible&nbsp;bling to your step!

# Trinket “Question Block” Sound Jewelry

## Arduino Code

Danger: 

If this is your first time using Trinket or Gemma, work through the&nbsp;[Introducing Trinket](http://learn.adafruit.com/introducing-trinket "Link: http://learn.adafruit.com/introducing-trinket")&nbsp;or&nbsp;[Introducing Gemma](http://learn.adafruit.com/introducing-gemma)&nbsp;guide first; you need to customize some settings in the Arduino IDE. Once you have it up and running (test the “blink” sketch), then&nbsp;continue…

In the Arduino IDE, create a new sketch ( **File→New** ), then copy and paste the following code (click the “copy code” link at the top right, switch to the Arduino IDE and select&nbsp; **Edit→Paste** ).  
  
The program is fairly small but uses some advanced techniques, so don’t be alarmed if a lot of it is unfamiliar. The important stuff you’ll actually be editing is on the next page.

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

From the&nbsp; **Tools→Board** &nbsp;menu, select&nbsp; **Adafruit Trinket 8 MHz** &nbsp;or&nbsp; **Adafruit Gemma** &nbsp;as appropriate. Connect the USB cable between the computer and board, press the reset button, then click the upload button (right arrow icon) in the Arduino IDE. In a moment you should get a light show from the LEDs. (If it doesn’t, check your wiring against the schematics. If the code refuses to compile, most likely the TinyWireM library isn’t correctly installed, or the&nbsp;anim.h&nbsp;file is mis-named.)

# Trinket “Question Block” Sound Jewelry

## CircuitPython Code

![](https://cdn-learn.adafruit.com/assets/assets/000/061/240/medium800/3d_printing_ada-trinket-m0-cp.jpg?1536329409)

 **Trinket 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 Trinket 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** &nbsp;](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiK-__azsnXAhWFsVQKHeLhDgcQFgg8MAA&url=https%3A%2F%2Flearn.adafruit.com%2Fadafruit-trinket-m0-circuitpython-arduino%2Foverview&usg=AOvVaw1KR3kAPHYx-DXtGZjUQX60)**[Trinket M0 guide](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiK-__azsnXAhWFsVQKHeLhDgcQFgg8MAA&url=https%3A%2F%2Flearn.adafruit.com%2Fadafruit-trinket-m0-circuitpython-arduino%2Foverview&usg=AOvVaw1KR3kAPHYx-DXtGZjUQX60).**

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 Trinket M0 into USB…it should show up on your computer as a small&nbsp; **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,&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 Trinket M0 doesn’t show up as a&nbsp;drive, follow the Trinket M0 guide link above to prepare the board for CircuitPython.**

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

# Installing Libraries:
The simpleio library must be installed for the above code to run correctly. The latest version of the&nbsp;[Adafruit CircuitPython Library Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases/latest/)&nbsp;contains this library. You want to download the latest stable&nbsp; **mpy** &nbsp;bundle which will have a filename like this:

**adafruit-circuitpython-bundle-x.x.x-mpy-date.zip**

The Trinket M0 has limited space, but so in this case we will be selective about which files are copied over to the CIRCUITPY drive. A detailed explanation for&nbsp;[installing libraries is available](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

Copy the following file from the unzip'd CircuitPython Library Bundle to the CIRCUITPY drive to a new folder called 'lib'.&nbsp;

- simpleio.mpy


## Featured Products

### Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE

[Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE](https://www.adafruit.com/product/3500)
The&nbsp;Adafruit Trinket M0 may be small, but do not be fooled by its size! It's a tiny microcontroller board, built around the Atmel ATSAMD21, a little chip with _a lot_ of power. We wanted to design a microcontroller board that was small enough to fit into any project, and low...

In Stock
[Buy Now](https://www.adafruit.com/product/3500)
[Related Guides to the Product](https://learn.adafruit.com/products/3500/guides)
### 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 Trinket - Mini Microcontroller - 5V Logic

[Adafruit Trinket - Mini Microcontroller - 5V Logic](https://www.adafruit.com/product/1501)
 **Deprecation Warning: The Trinket 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 Trinket so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1501)
[Related Guides to the Product](https://learn.adafruit.com/products/1501/guides)
### Adafruit Trinket - Mini Microcontroller - 3.3V Logic

[Adafruit Trinket - Mini Microcontroller - 3.3V Logic](https://www.adafruit.com/product/1500)
 **Deprecation Warning: The Trinket 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 Trinket so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1500)
[Related Guides to the Product](https://learn.adafruit.com/products/1500/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...>

In Stock
[Buy Now](https://www.adafruit.com/product/1222)
[Related Guides to the Product](https://learn.adafruit.com/products/1222/guides)
### Large Enclosed Piezo Element w/Wires

[Large Enclosed Piezo Element w/Wires](https://www.adafruit.com/product/1739)
This large (30mm diameter) piezo element is nicely enclosed with mounting holes so you can attach easily. Piezo elements convert vibration to voltage or voltage to vibration. That means you can use this as a buzzer for making beeps, tones and alerts AND you can use it as a sensor, to detect...

In Stock
[Buy Now](https://www.adafruit.com/product/1739)
[Related Guides to the Product](https://learn.adafruit.com/products/1739/guides)
### Adafruit LED Sequins - Warm White - Pack of 5

[Adafruit LED Sequins - Warm White - Pack of 5](https://www.adafruit.com/product/1758)
Sew a little sparkle into your wearable project with an Adafruit LED Sequin. These are the kid-sister to our popular [Flora NeoPixel](http://www.adafruit.com/products/1260), they only show a single color and they don't have digital control, but that makes them smaller easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/1758)
[Related Guides to the Product](https://learn.adafruit.com/products/1758/guides)
### Adafruit LiIon/LiPoly Backpack Add-On for Pro Trinket/ItsyBitsy

[Adafruit LiIon/LiPoly Backpack Add-On for Pro Trinket/ItsyBitsy](https://www.adafruit.com/product/2124)
If you have an ItsyBitsy or Pro Trinket you probably know it's the perfect little size for a portable project. This LiPoly backpack makes it really easy to do! Instead of wiring 2 or 3 boards together to make a charging system, this little PCB sits on top of the PCB and allows a...

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

## Related Guides

- [Adafruit Trinket M0](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino.md)
- [Let’s Put LEDs in Things!](https://learn.adafruit.com/lets-put-leds-in-things.md)
- [Animated Scrolling "Mario Clouds" TFT Jewelry](https://learn.adafruit.com/scrolling-mario-clouds-tft-jewelry.md)
- [3D Printed NeoPixel LED Gas Mask](https://learn.adafruit.com/3d-printed-el-wire-laser-neopixel-led-gas-mask.md)
- [Glowing Viking Rune wayFinder](https://learn.adafruit.com/glowing-viking-rune-artifact.md)
- [Tap Tempo Trinket](https://learn.adafruit.com/tap-tempo-trinket.md)
- [Building CircuitPython](https://learn.adafruit.com/building-circuitpython.md)
- [Clockwork Goggles](https://learn.adafruit.com/gemma-m0-clockwork-goggles.md)
- [Simple and Beautiful NeoPixel Holiday Lights](https://learn.adafruit.com/simple-beautiful-color-changing-light-strand.md)
- [Textile Potentiometer Hoodie](https://learn.adafruit.com/textile-potentiometer-hoodie.md)
- [CircuitPython Basics: Analog Inputs & Outputs](https://learn.adafruit.com/circuitpython-basics-analog-inputs-and-outputs.md)
- [Interior Purse Light](https://learn.adafruit.com/interior-purse-light.md)
- [Gemma M0 Sheikah Pendant](https://learn.adafruit.com/gemma-m0-sheikah-pendant.md)
- [Trinket (& Gemma) Servo Control](https://learn.adafruit.com/trinket-gemma-servo-control.md)
- [3D Printed Unicorn Horn](https://learn.adafruit.com/3d-printed-unicorn-horn.md)
- [NeoPixel Basketball Hoop](https://learn.adafruit.com/neopixel-mini-basketball-hoop.md)
