PyBadge & TensorFlow Lite

3D print a case with a flip out mic! This case is designed for the TensorFlow Lite Kit. Use the Adafruit PyBadge, battery and microphone to build a machine learning project!

Prerequisite Guides

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

Parts

The TensorFlow Lite for microcontroller kit includes the following

Additional Parts

Female holding an a assembled TensorFlow Lite for Microcontrollers Kit.
Machine learning has come to the 'edge' - small microcontrollers that can run a very miniature version of TensorFlow Lite to do ML computations. But you don't...
Out of Stock
Mini Oval Speaker with Short Wires
Hear the good news! This wee speaker is a great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like...
$1.95
In Stock
Filament for 3D printers in various colors and types stacked together.
Having a 3D printer without filament is sort of like having a regular printer without paper or ink.  And while a lot of printers come with some filament there's a good chance...
Out of Stock
Stickvise PCB Vise on table
Are you still looking for that perfect PCB holder? The low profile PCB Stickvise might be just the thing you need!In performing the simple task...
Out of Stock
Large blue silicone mat
This silicone mat is made of 4mm 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...
$9.95
In Stock

Other Materials Used

1 x Starbond Super Glue
EM-150 Medium
1 x Hot Glue
For strain relief on wired connections

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.

Settings

Use these settings as reference. Values listed were used in Ultimaker's CURA 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

Bezel Cover

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

Starbond Super Glue

We suggest using Starbond Super Glue, EM-150 Medium. The starbond super glue includes a very fine tipped nozzle, perfect for applying a very thin line of adhesive.

Apply Glue

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

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.

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.

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.

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.

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

JST Cable

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

Do not solder the strip of headers to the microphone (included with the kit) – It won't fit inside the 3D printed case. If it is already soldered, you may trim them short.

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.

Wire Stripping

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

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. 

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.

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.

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

Wired Microphone

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

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. 

Take caution when handling hot glue guns. Watch your fingers!

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.

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.

Hinged Door

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

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.

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

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.

The 5V trace MUST be cut in order for the microphone to work properly. DO NOT skip this step, very important!

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.

Reset Actuator

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

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.

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.

Install PyBadge

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

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.

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.

Excessive use of the flip out mic could result in damaging the microphone. The mic is able to pick up audio when it is closed. We suggest keeping the mic in the closed position.

This guide was first published on Jul 24, 2019. It was last updated on Jul 24, 2019.