# PyBadge Case with Flip Out Mic

## Overview

## PyBadge & TensorFlow Lite

3D print a case with a flip out mic! This case is designed for the [TensorFlow Lite Kit](https://www.adafruit.com/product/4317). Use the Adafruit PyBadge, battery and microphone to build a machine learning project!

![3d_printing_hero-holding.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/544/medium640/3d_printing_hero-holding.jpg?1563913279)

https://www.youtube.com/watch?v=mwYYNM0bQVI

## Prerequisite Guides

This guide covers the wiring and assembly. Walk through the following learn guide to get the software setup on your PyBadge.

- [TensorFlow Lite for Microcontrollers Kit – Quick Start](https://learn.adafruit.com/tensorflow-lite-for-microcontrollers-kit-quickstart)

## Parts
The TensorFlow Lite for microcontroller kit includes the following

- [Adafruit PyBadge](https://www.adafruit.com/product/4200)
- [Electret Microphone](https://www.adafruit.com/product/1063)
- [JST 3-Pin Cable](https://www.adafruit.com/product/3894)
- [350mAh Battery](https://www.adafruit.com/product/4237)

**Additional Parts**

- [Mini oval speaker](https://www.adafruit.com/product/4227)

![3d_printing_parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/436/medium640/3d_printing_parts.jpg?1563723340)

Featured
### TensorFlow Lite for Microcontrollers Kit

[TensorFlow Lite for Microcontrollers Kit](https://www.adafruit.com/product/4317)
Machine learning has come to the 'edge' - small microcontrollers that can run a very miniature version of TensorFlow Lite to do ML computations.&nbsp;

But you don't need super complex hardware to start developing your own TensorFlow models! We've curated a simple kit to...

In Stock
[Buy Now](https://www.adafruit.com/product/4317)
[Related Guides to the Product](https://learn.adafruit.com/products/4317/guides)
![Female holding an a assembled TensorFlow Lite for Microcontrollers Kit.](https://cdn-shop.adafruit.com/640x480/4317-02.jpg)

Featured
### Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt

[Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt](https://www.adafruit.com/product/4227)
Hear the good news! This wee speaker&nbsp;is&nbsp;a&nbsp;great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like this&nbsp;speaker&nbsp;as it is&nbsp;small and comes with nice skinny wires with a connector on the end. It has a handy...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4227)
[Related Guides to the Product](https://learn.adafruit.com/products/4227/guides)
![Mini Oval Speaker with Short Wires ](https://cdn-shop.adafruit.com/640x480/4227-06.jpg)

Featured
### Filament for 3D Printers in Various Colors and Types

[Filament for 3D Printers in Various Colors and Types](https://www.adafruit.com/product/2080)
Having a 3D printer without filament is sort of like having a regular printer without paper or ink. &nbsp;And while a lot of printers come with some filament there's a good chance you've been printing up a storm and need something new. &nbsp;That's why we've started carrying a...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2080)
[Related Guides to the Product](https://learn.adafruit.com/products/2080/guides)
![Filament for 3D printers in various colors and types stacked together.](https://cdn-shop.adafruit.com/640x480/2080-07.jpg)

Featured
### Stickvise PCB Vise

[Stickvise PCB Vise](https://www.adafruit.com/product/3197)
Are you still looking for that perfect PCB holder?&nbsp;The low profile **PCB Stickvise&nbsp;** might be just the thing you need!

In&nbsp;performing the simple task of holding a PCB near table level, the Stickvise is&nbsp;great because your hands can rest directly on the...

In Stock
[Buy Now](https://www.adafruit.com/product/3197)
[Related Guides to the Product](https://learn.adafruit.com/products/3197/guides)
![Stickvise PCB Vise on table](https://cdn-shop.adafruit.com/640x480/3197-00.jpg)

Featured
### Insulated Silicone Rework Mat - 34cm x 23cm Work Surface

[Insulated Silicone Rework Mat - 34cm x 23cm Work Surface](https://www.adafruit.com/product/3536)
This silicone mat is made of&nbsp;thick rubber and can take just about anything you throw at it. It's stable, strong, non-slip, non-conductive and heat-resistant surface for your workstation. We love it here at Adafruit because you can hot air boards right on top and there won't be any...

In Stock
[Buy Now](https://www.adafruit.com/product/3536)
[Related Guides to the Product](https://learn.adafruit.com/products/3536/guides)
![Large blue silicone mat](https://cdn-shop.adafruit.com/640x480/3536-04.jpg)

## Other Materials Used
### Part: Starbond Super Glue
quantity: 1
EM-150 Medium
[Starbond Super Glue](https://www.amazon.com/Starbond-EM-150-Medium-Premium-Cyanoacrylate/dp/B00C32MHJU/)

### Part: Hot Glue
quantity: 1
For strain relief on wired connections
[Hot Glue](https://www.amazon.com/s?k=hot+glue)

# PyBadge Case with Flip Out Mic

## 3D Printing

## 3D Printed Parts

Parts are designed to be 3D printed with FDM based machines. STL files are oriented to print "as is". Machines with dual extrusion or single extrusion setups are listed below with parts name and description. Parts require tight tolerances that might need adjusting slice setting. Reference the suggested settings below.

![3d_printing_parts-angle.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/431/medium640/3d_printing_parts-angle.jpg?1563634984)

## Settings

Use these settings as reference. Values listed were used in&nbsp;[Ultimaker's CURA](https://ultimaker.com/en/products/ultimaker-cura-software)&nbsp;slicing software.

- 0.2mm Layer Height / 0.4mm nozzle
- 0.38mm Line Width (inner & outer widths)
- 40mm/s printing speed
- 20% infill
- Supports: No

## Parts list

- **pymic-bottom.stl** – Bottom half of the case
- **pymic-cover.stl** – Top half of the case
- **pymic-hinge.stl** – Print in place hinge for microphone
- **pymic-reset.stl** – Button for actuating the reset button

[Download CAD files](https://www.thingiverse.com/thing:3766424)
## Bezel Cover

You'll need to attach the bezel to the cover using adhesive.

![3d_printing_cover-hinge.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/455/medium640/3d_printing_cover-hinge.jpg?1563813811)

## Starbond Super Glue

We suggest using [Starbond Super Glue,&nbsp;EM-150 Medium](https://www.amazon.com/Starbond-EM-150-Medium-Premium-Cyanoacrylate/dp/B00C32MHJU/). The starbond super glue includes a very fine tipped nozzle, perfect for applying a very thin line of adhesive.

![3d_printing_bezel-superglue.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/454/medium640/3d_printing_bezel-superglue.jpg?1563814092)

## Apply Glue

Apply super glue along the rim of the bezel. Be cautious not to apply too much or too little super glue.

![3d_printing_bezel-gluing.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/453/medium640/3d_printing_bezel-gluing.jpg?1563814255)

## Attach Top Cover

With the bezel flat on your work surface, orient the top cover so it's line up with the bezel. Slowly lower the cover and place it on top of the bezel. Press the cover down onto the bezel. Use finger and carefully press the parts together. Lightly blow air onto the two parts, this will help prevent the glue from hazing.

![3d_printing_bezel-cover-glued.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/452/medium640/3d_printing_bezel-cover-glued.jpg?1563813801)

## Bottom and Hinge

The hinge will need to super glued to the bottom half of the case. The bottom cover features a cutout that matches exactly with the hinged door. Orient the parts so they're lined up and matching.

![3d_printing_bottom-hinge.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/451/medium640/3d_printing_bottom-hinge.jpg?1563813797)

## Apply Glue

Super glue will need to be applied to the bottom side of the hinge – this is the surface which was printed on the bed of the 3D printer. Apply a small amount of adhesive across the surface of the hinge. Be very careful not to get any glue on the hinge.

![3d_printing_hinge-gluing.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/450/medium640/3d_printing_hinge-gluing.jpg?1563813793)

## Attach Hinge

Carefully place the hinge over the bottom half of the case. Orient the parts so the cutouts are lined up. Slowly press the parts together.

![3d_printing_bottom-hinge-glued.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/457/medium640/3d_printing_bottom-hinge-glued.jpg?1563813889)

Allow the glue a few minutes to cure before handling. Test the door hinge by pulling it opening and closing it shut.

![](https://cdn-learn.adafruit.com/assets/assets/000/078/463/medium800/3d_printing_bottom-hinge-inside.jpg?1563814289)

# PyBadge Case with Flip Out Mic

## Microphone Wiring

## JST Cable

Get the microphone and 3-pin JST cable. We'll solder the three wires directly into the pins on the microphone PCB.

![3d_printing_mic-jst-cable.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/444/medium640/3d_printing_mic-jst-cable.jpg?1563813244)

Danger: 

## JST Wire Length

The JST cable is too long to fit inside the case, so we'll need to shorten the three wires. Measure the wire so its 47mm(1.85in) in length. Using wire cutter, snip the three wires short.

![3d_printing_jst-wire-length.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/443/medium640/3d_printing_jst-wire-length.jpg?1563813240)

## Wire Stripping

You'll need to expose the strands of wire in order to solder them into the pins on the microphone.&nbsp;Use wire stripper to remove a bit of insulation from the tips of the wires.

![3d_printing_jst-wire-strip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/442/medium640/3d_printing_jst-wire-strip.jpg?1563813235)

## Wire Tinning

To prevent the strands of wire from fraying, we'll need to tin the wires with a bit of solder. I suggest using a pair of third helping hands to secure the wires while soldering.&nbsp;

![3d_printing_jst-wire-tinning.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/441/medium640/3d_printing_jst-wire-tinning.jpg?1563813232)

## Wire Microphone

Remove the JST cable from the helping hands and inspect the wires – They should be evenly tinned with solder. Get the microphone and JST cable ready for soldering.

![3d_printing_mic-jst-prewire.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/449/medium640/3d_printing_mic-jst-prewire.jpg?1563813355)

## PCB Stickvise

We'll need to solder the three wires from the JST cable to the pins on the microphone. I suggest using a stickvise to secure the microphone PCB in place while soldering. You may tin the pins by adding a bit of solder.

![3d_printing_mic-stickvise-tinned.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/447/medium640/3d_printing_mic-stickvise-tinned.jpg?1563813291)

## Solder Wires to PCB

Carefully solder the wires into the pins. Follow the connections below for reference.

- **RED** wire to **VCC** pin
- **BLACK** wire to **GND** pin
- **WHITE** wire to **OUT**

![3d_printing_mic-jst-solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/446/medium640/3d_printing_mic-jst-solder.jpg?1563813287)

## Wired Microphone

After soldering, you may remove the PCB from the stickvise. Thoroughly inspect the solder joints and ensure ensure they're solid.

![3d_printing_mic-wired.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/445/medium640/3d_printing_mic-wired.jpg?1563813283)

## Strain Relief

The wired connections will under go a lot of stress when the hinged door is opened and closed. Without any strain relief, the wires will eventually break. A bit of hot glue around these wired connections will prevent the wires from excessive flex. Apply hot glue around the wired connections.&nbsp;

![3d_printing_mic-hotglue-back.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/504/medium640/3d_printing_mic-hotglue-back.jpg?1563893427)

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/078/503/medium800/3d_printing_mic-hotglue-front.jpg?1563893423)

# PyBadge Case with Flip Out Mic

## Assembly

## Install Mic

Grab the microphone and bottom half of the case. The hinge should be securely attached. Gently press the capsule through the circular cutout on the door. Use the photo to reference placement.

![3d_printing_mic-installed-back.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/468/medium640/3d_printing_mic-installed-back.jpg?1563819231)

## Mic Placement

The PCB doesn't need to be flush with the door, it can go about half way through. The cutout should have a snug fit.

![3d_printing_mic-fit-test.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/469/medium640/3d_printing_mic-fit-test.jpg?1563819235)

## Hinged Door

Test out the hinged door by opening and closing it shut.&nbsp;

![3d_printing_mic-installed-flip.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/467/medium640/3d_printing_mic-installed-flip.jpg?1563819227)

## Secured Mic

If the cutout is too lose and you find the mic coming out, you can optionally adhere the mic to the door. Hot glue is a nice option since it can be removed without damaging the parts.

![3d_printing_mic-installed-closed.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/466/medium640/3d_printing_mic-installed-closed.jpg?1563819222)

Here's a shot from the inside of the bottom half of the case.&nbsp;

![3d_printing_mic-installed-inside.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/465/medium640/3d_printing_mic-installed-inside.jpg?1563819416)

## Voltage Setup

Locate the voltage pads on the back of the PyBadge. There's labels that denote two pads, **5V** and **3.3V**. In order for the microphone to work, the PyBadge needs to setup for **3.3V** logic. Use a hobby knife to cut the small trace in between the **5V** and **VCC** pads. Apply solder to the **3.3V** and **VCC** pad. Sufficient amount of solder will jump the two connections.

![3d_printing_pybadge-5V-cut-trace.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/512/medium640/3d_printing_pybadge-5V-cut-trace.jpg?1563894083)

Danger: 

## Battery & Speaker

For a portable setup, connect a 350mah 3.7v lipo battery to the power port on the back of the PyBadge.

If you'd like to increase the sound output from the PyBadge, connect a mini oval speaker to the speaker port on the back of the PyBadge.

![3d_printing_pybadge-speaker-battery.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/505/medium640/3d_printing_pybadge-speaker-battery.jpg?1563893810)

## Reset Actuator

Use the 3D printed button to actuate the reset button. This is used for resetting the PyBadge and flashing new firmware.

![3d_printing_bottom-reset-button.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/506/medium640/3d_printing_bottom-reset-button.jpg?1563893826)

## Install Reset Button

Place the 3D printed button into the hole from inside the bottom half of the case. It should have a loose fitting. A small flange on the button will prevent it from falling out.

![3d_printing_install-reset-button.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/507/medium640/3d_printing_install-reset-button.jpg?1563893847)

## Connect Mic

Plug in the 3-pin JST cable from the microphone into the JST connector on the back of the PyBadge with the **D2** labeling.

![3d_printing_preinstall-pybadge-bottom.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/508/medium640/3d_printing_preinstall-pybadge-bottom.jpg?1563893869)

## Install PyBadge

Place the PyBadge PCB over the standoffs on the bottom half of the case.

![3d_printing_installed-pybadge-bottom.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/509/medium640/3d_printing_installed-pybadge-bottom.jpg?1563893880)

## Install Top Cover

Place the top half of the case over the PyBadge and line up the cutouts with the components. Gently, and carefully, press the cover down onto the bottom half of the case.

![3d_printing_install-top-cover.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/510/medium640/3d_printing_install-top-cover.jpg?1563893997)

## Snap Fits

The case features snap fit features. Firmly press the two parts together to snap them shut. Rotate the case and press all the edges to fully secure the case.

![3d_printing_cover-top-snaps.jpg](https://cdn-learn.adafruit.com/assets/assets/000/078/511/medium640/3d_printing_cover-top-snaps.jpg?1563894007)

Danger: 


## Guide Products

### TensorFlow Lite for Microcontrollers Kit

[TensorFlow Lite for Microcontrollers Kit](https://www.adafruit.com/product/4317)
Machine learning has come to the 'edge' - small microcontrollers that can run a very miniature version of TensorFlow Lite to do ML computations.&nbsp;

But you don't need super complex hardware to start developing your own TensorFlow models! We've curated a simple kit to...

In Stock
[Buy Now](https://www.adafruit.com/product/4317)
[Related Guides to the Product](https://learn.adafruit.com/products/4317/guides)
### Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt

[Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt](https://www.adafruit.com/product/4227)
Hear the good news! This wee speaker&nbsp;is&nbsp;a&nbsp;great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like this&nbsp;speaker&nbsp;as it is&nbsp;small and comes with nice skinny wires with a connector on the end. It has a handy...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4227)
[Related Guides to the Product](https://learn.adafruit.com/products/4227/guides)
### Monoprice Inventor II 3D Printer with Touchscreen and WiFi

[Monoprice Inventor II 3D Printer with Touchscreen and WiFi](https://www.adafruit.com/product/3897)
The **Monoprice Inventor II 3D Printer Touchscreen with WiFi** is a perfect entry-level 3D printer with small footprint and reliable performance. It comes equipped with WiFi so you don't need a cable tether and a lovely 3.5" color touchscreen for settings & feedback....

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3897)
[Related Guides to the Product](https://learn.adafruit.com/products/3897/guides)
### Filament for 3D Printers in Various Colors and Types

[Filament for 3D Printers in Various Colors and Types](https://www.adafruit.com/product/2080)
Having a 3D printer without filament is sort of like having a regular printer without paper or ink. &nbsp;And while a lot of printers come with some filament there's a good chance you've been printing up a storm and need something new. &nbsp;That's why we've started carrying a...

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

[Stickvise PCB Vise](https://www.adafruit.com/product/3197)
Are you still looking for that perfect PCB holder?&nbsp;The low profile **PCB Stickvise&nbsp;** might be just the thing you need!

In&nbsp;performing the simple task of holding a PCB near table level, the Stickvise is&nbsp;great because your hands can rest directly on the...

In Stock
[Buy Now](https://www.adafruit.com/product/3197)
[Related Guides to the Product](https://learn.adafruit.com/products/3197/guides)
### Insulated Silicone Rework Mat - 34cm x 23cm Work Surface

[Insulated Silicone Rework Mat - 34cm x 23cm Work Surface](https://www.adafruit.com/product/3536)
This silicone mat is made of&nbsp;thick rubber and can take just about anything you throw at it. It's stable, strong, non-slip, non-conductive and heat-resistant surface for your workstation. We love it here at Adafruit because you can hot air boards right on top and there won't be any...

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

## Related Guides

- [ TensorFlow Lite for EdgeBadge Quickstart](https://learn.adafruit.com/tensorflow-lite-for-edgebadge-kit-quickstart.md)
- [Two Player Game System for PyGamer and RFM69HCW Radio Wing](https://learn.adafruit.com/two-player-game-system-for-pygamer-and-rfm69hcw-radio-wing.md)
- [Animatronic Glowing Medusa Headdress](https://learn.adafruit.com/animatronic-glowing-medusa-headdress.md)
- [PyPortal WFH Busy Sounds Simulator](https://learn.adafruit.com/pyportal-wfh-busy-sounds-simulator.md)
- [Princess Peach LED Crown](https://learn.adafruit.com/bowsette.md)
- [Epoxy Resin Torch Lamp with Touch Control & 3D Printed Base](https://learn.adafruit.com/epoxy-resin-torch-lamp-with-touch-control-3d-printed-base.md)
- [NeoTrellis M4 Bumper](https://learn.adafruit.com/neotrellis-m4-bumper.md)
- [Portable Qi Charger](https://learn.adafruit.com/portable-qi-charger.md)
- [Garmin Lidar Lite Range Finder](https://learn.adafruit.com/garmin-lidar-lite-range-finder.md)
- [3D Printing on Diffraction Grating Sheets](https://learn.adafruit.com/3d-printing-on-diffraction-grating-sheets.md)
- [Bluetooth Controlled NeoPixel Lightbox](https://learn.adafruit.com/bluetooth-neopixel-lightbox.md)
- [PyGamer - Gaming Handheld Crank](https://learn.adafruit.com/gaming-handheld-crank.md)
- [GEMMA M0 Case](https://learn.adafruit.com/gemma-m0-case.md)
- [Monster Mask Case](https://learn.adafruit.com/monster-mask-case.md)
- [PyGamer Thermal Camera with AMG8833](https://learn.adafruit.com/pygamer-thermal-camera-amg8833.md)
- [Easter Egg Light Stand](https://learn.adafruit.com/easter-egg-light-stand.md)
