USB Crank-Stick

Joy-wheel, joy-crank or crank-stick? Just a crank that can be used like joystick

Similar projects worth following
I want to build a peculiar game controller, one with a crank!
I want to make a "physical" controller, something that requires a bit of strength and ample moves. This is how the idea of a joystick based on a crank was born.The goal is to read the position of a crank and send appropriate USB joystick or keyboard commands.

The Idea

Why build such a controller?

When I was younger, I was very fond of an Apple2 game called Sabotage, this is a very basic game. I still enjoy playing it from times to times, but to make this game funnier, I want to do what Nintendo did with the Wii : make an average game funnier by using a special controller. I want to make a "physical" controller, something that requires a bit of strength and ample moves.

This controller should also work for games like Tetris and Puzzle Bobble, FrozenBubble, etc.

I looked at similar projects that would involve "spinning a device" or more generally moving and I found one involving a unicycle! Too challenging for me ;-) Also, after developing my prototype, I found a project with a similar idea : Exercise machine as a usb controller 

The goal

Build at least 2 of those controllers so I can play versus games with friends. This project is also an excuse to learn new things such has designing a my own pcb board(not done yet) and use laser cutting(not done yet).

The technical details

The original game is played with keys D and F for left and right and any other key for fire. It means my device must be able to act as a keyboard, or more generally a HID device, so I will be able to use it for other games.
How to act as a HID device? Some Arduino board can act as HID devices, but it is not always easy. For example if you want to use the Arduino Uno you need to reflash the Atmega8u2 to be detected as a HID device. Teensy boards are more appropriate for this task, and as a matter of fact I had a Teensy 3.1 lying around, so I used it for this project. It could also probably be done with a Teensy 2 or a STM32 blue Pill board which are much cheaper.
Then the other major part of the project is being able to read the position of a crank and feed it to the Teensy board.

  • 1 × Teensy3.1
  • 1 × PS/2 mouse
  • 1 × 3.3v-5v level shifter
  • 1 × crank
  • 3 × arcade buttons with led

View all 6 components

  • First Prototype

    PixJuan5 days ago 0 comments

    I used wood, a crank and shelf braces. The size of the main board is 70cm x 40 cm, probably a bit too big. I used 20mm thick pine wood  and also a bit of plywood for the thinner parts.
    I won't give the complete build instructions, the pictures are self explanatory, and also this is just the prototype, the final project will be laser cut and I will publish the files here.

    The only tricky part was to get the mouse wheel to touch the crank with just the right pressure. At first the contact was orthogonal, which was a bad idea, because if the wheel is not exactly placed there is too much pressure on it and it falls. So instead,

    I just positioned the wheel like I would have for a regular gear. I still use the plastic base of the mouse, I just saw off as much as I could of it.

  • Good old PS/2 mouse

    PixJuan12/14/2019 at 02:32 0 comments

    As I don't have a good oscilloscope, debugging the misbehaviour of my quadratic encoder code is quite a pain.   So I thought about using a PS/2 mouse because it is a serial-like protocol which is easy to implement, there are examples on the Arduino playground.
     First, even if I keep a lot of stuff, I struggled a bit to find a PS/2 wheel-mouse in my attic but I finally found one!
    It was quite fast to get something working on my Arduino UNO. The basic script doesn't support the wheel, but I found another one which does.

      So I just plugged the PS/2 mouse on my Teensy 3.1 and... it failed!
      The Teensy is 5V tolerant, but my PS/2 mouse isn't, so I fixed the problem by adding a 3.3v<->5.5v level shifter between the PS/2 mouse and my Teensy.
      It is working great so far, it's not missing pulses anymore.
      Later on, I had my "facepalm moment" when I realised the Teensy3.1 support can act as a usb host  if you plug a USB OTG converter into it, so I could have used a USB mouse instead of a vintage PS/2 one! But then I realised that in this configuration I would have needed another board to act as a USB HID, so my struggle to find a PS/2 mouse was not vain.

    This PS/2 mouse solution is working really well, but I ordered a Teensy4 to be able to use a USB mouse in a future version.

  • Quadratic encoder

    PixJuan12/04/2019 at 21:03 0 comments

    How to measure the rotation of the crank? In a computer mouse, the wheel can measure rotation. I had a broken mouse with a wheel that used a quadratic encoder.

    It was a USB mouse and the Teensy3.1 doesn't have a USB host port, so I decided to only take the quadratic encoder and read it with the Teensy.
    I kept the wheel itself as it was well adapted to the task.

      The mouse wheel was working correctly when I was using it from the mouse but when I was reading it from the Teensy, it was very erratic. So I added capacitors and resistors to filter bounces and glitches:

    It is working under normal conditions but when the wheel turns too fast, it misses some pulses. I was using code from the Arduino playground to read the encoder. Then I found out that there was examples for reading quadratic on a Teensy using hardware interruptions. So I tried this code but it failed even more! It's not skipping pulses any more but it was only going forward. I suppose the problem lies in the filtering I did. I am too lazy to unsolder everything and as this part is more or less working, I'll work on other parts of the projects and come back to this later.

View all 3 project logs

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates