Overview

Gaming Cranks are the hot rage in handheld input devices right now. Its a great input for games and applications! 

The Adafruit PyGamer is a perfect gaming device to attach a crank as an input device for games and more!

We have a great example in the Cranky Gif player!

In the Cranky Gif player demo, rotating the crank makes a gif image step through each frame of its animation. It brings back the experience of those old school Mutoscope viewers! 

For this project, we designed and 3d printed an articulating hinge crank add-on for rotary encoders.

We designed a case to house the PyGamer with geometry to hold the rotary encoder in place.

You can also add custom NinjaFlex buttons and d-pads to make the buttons feel more grippy and squishy! 

We'll then cover how to modify headers to make connecting to the PyGamer easier! 

You can also use existing Knob parts like our Circuit Python Media Dial!

Parts List

Rotary Encoder + Extras

PRODUCT ID: 377
This rotary encoder is the best of the best, its a high quality 24-pulse encoder, with detents and a nice feel. It is panel mountable for placement in a box, or you can plug it into a...
$4.50
IN STOCK

Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino

PRODUCT ID: 4242
What fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right, it's the Adafruit...
OUT OF STOCK

Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt

PRODUCT ID: 4227
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

Lithium Ion Polymer Battery with Short Cable - 3.7V 350mAh

PRODUCT ID: 4237
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...
$5.95
IN STOCK

Break-away 0.1" 36-pin strip right-angle male header (10 pack)

PRODUCT ID: 1540
Breakaway header is like the duct tape of electronics. Its great for connecting things together, soldering to perf-boards, fits into any breadboard, etc. We go through these guys real...
$5.95
IN STOCK

Circuit Diagram

This provides a visual reference for wiring of the components. They aren't true to scale, just meant to be used as reference. This diagrams was created using the Fritzing software package.

Take a moment to review the components in the circuit diagram. This illustration is meant for referencing wired connections - The length of wire, position and size of components are not exact.

We measured and cut all wires to 120mm long. This will allow the wires to reach from the female headers to the rotary encoder on the opposite side of the board.

Use silicone wire to make them easier to coil and manage. 

We can use right angled headers to solder to the wires or DIY your own by bending headers  90 degrees.  

  • Pin 9 connects to the B pin (Green wire)
  • Pin 6 connects to the A pin (Blue wire)
  • Pin 5 connects to the Switch pin (Yellow wire)

Ground

We used a short wire to connect one Ground to the other (Grey wires) and then added another Ground connection to the GND female header on the PyGamer. 

For a complete guide on converting your GIFs, and setting up the Arcada Libraries, follow the full Arcada Animated GIF Display tutorial below! 

3D Printing

3D Printed Parts

The parts in this kit are designed to be 3D printed with FDM based machines. STL files are oriented to print "as is". Parts require tight tolerances that might need adjustment of slice settings. Reference the suggested settings below.

 

CAD Files

The fusion 360 source file is included and features original sketches and feature timeline along with easily editable user parameters. The parts can further be separated into small pieces for fitting on printers with smaller build volumes. Note: STEP file is included for other 3D surface modeling programs such as Onshape, Solidworks and Rhino.

Settings

Use these settings as reference. Values listed were used in Prusa Slicer slicing software.

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

NinjaFlex buttons

The buttons are print in flexible material. We used NinjaFlex 85A (elastic) for a more rubbery, squishy feel. Below are some of the setting we modified in the default flexible materials profile in Prusa Slicer.

  • no retraction (off)
  • 30mm/s print speed
  • 230c nozzle
  • 55c Bed
  • first layer height .25mm (avoids bonding to pei bed)

Assembly

Headers 

To simplify the rotary connections, we used right-angle male headers to plug into the female headers on the PyGamer. 

We can can also just bend spare headers. Use two Precision Flat Pliers to carefully bend the longer ends of the pins at an angle.

Solder Wires

Refer to the Circuit Diagram page to solder the wires to each terminal on the Rotary Encoder.

We measure the wires 120mm long to reach the headers on the back of the PyGamer to the right side of the enclosure.

We used two helping hands to secure the header pins and rotary while soldering each wire.

Speaker

We used the oval speaker with the short wires to mounting to allow the case to mount easier.  

If you have speakers with longer wires, make sure to coil them around the speaker to avoid blocking the standoffs on the enclosure. 

Remove the sticker cover on the front of the speaker (opposite side of the shiny magnet) and press in the center of the speaker outline on the back of the board.

Tac for Battery

Next we'll use a small amount of sticky tack to attach the 350mAh lipo battery to the back of the board. Gently press the battery to adhere the tac to the board.

The 350 mAh battery fits the PyGamer standard case. With this case, you can instead use a 400 mAh battery for more battery life.

Plug in Rotary Header

Align the headers to pins 5,6 and 9. Press to secure the male header into the female sockets.

Install the the single Ground header into the GND connection on the opposite header socket row. 

 

3D Case 

Tuck the wires behind the board, around the STEMMA ports and around the speaker. Align the PyGamer board to the standoffs on bottom case first.

Insert the board at an angle with the headphone jack first and then position the rotary encoder into the port on the right side of the case.

Align the top part of the case to the screen and align with the screw holes and button cutouts.   

 

Screws 

Next we'll secure the two halves of the enclosure with four M3x6mm long screws. The screw mounts are counter sunk. Carefully  fasten each screw until they are below the height of the case.

 

Screws Covers

To add a bit of a polished look to the case, we'll print a set of matching screw caps.

Align each cap at an angle to the counter sunk holes and press fit to attach. 

 

Rotary Nut

Before we forget, let's add the included screw nut to the threads on Rotary encoder. 

 

Add Buttons

Finally we can start to add the buttons and even switch out the d-pad for a more squishy NinjaFlex version. Align the square connectors to the the posts on the buttons.

Test alignment by making sure each button press makes a solid click.

Attach Crank or Dial 

The last step is to pick your favorite crank style or dial! We can easily swap between each version depending on the input situation.

You can even take the shape of the rotary knob to design a custom knob shape! 

This guide was first published on Jun 11, 2019. It was last updated on Jun 11, 2019.