Gyroscope as Human Interface Device

For a small electronics contest (Dutch)  i’ve made a gyroscope based device that can interface with a PC as an USB HID keyboard. The intention is to use this device with your feets as extra input device for First Person Shooter games.



I’ve used the Sure Electronics XV-3500CB gyroscope module. This module has both an analog output and an onboard ADC which has an I2C interface. I have only used the analog output but using the onboard ADC converter might be better (less noise).

I hooked this module up to an Atmel AVR ATmega8 microcontroller running at 12MHz.
The analog output of the gyroscope module is connected to one of the ADC converter channels of the ATmega8. The ATmega8 has no USB interface. Instead of using a hardware USB interface i used a bit bang software USB stack. The PHY of this interface is just a few resistors and two zener diodes to keep the potential of the USB data lines under 3.6V (the microcontroller is USB powered and runs at 5V).

Schematics can be found here.

Gyroscope module and microcontroller

Gyroscope module and microcontroller

Gyroscope module and microcontroller

The firmware that runs on V-USB a software USB stack for Atmel AVR microcontrollers. This software stack is only able to do USB 1.1 low speed (1.5mbit/s). This is not very fast but more than enough for sending some key strokes to the PC.

More specific my device is based on the HIDKeys example project. This examples project takes input from 17 buttons and sends key strokes to the PC when the buttons are pressed. I modified this project to use results from the ADC (and thus the gyroscope) as input instead of buttons. If the gyroscope is moved to the left, a particular key stroke is send to the PC and the same happens for moving to the right. Due to the fact that the device emulates a keyboard it is very easy to use it in games. Just bind the two different keys that the device can send (left/right) to the functions in the game configuration!


The device shows up as USB HID device:

Leaning in Medal of Honor: Allied Assault:

Turning in Medal of Honor: Allied Assault:

Look mom, without hands!

Status LED’s:

My project can be downloaded here and used under the GPLv2 license.

The ZIP file contains the following:

  • Schematic
  • Source code firmware
  • Hex file firmware
  • Altium Designer work files for schematic, PCB (not finished) and lib
  • Used datasheets

2 Responses to “Gyroscope as Human Interface Device”

  1. Mohammed Abdelghany says:

    I think this project is the beginning of intelligent war

    Mohammed Abdelghany, lecturer at The Rotterdam University for applies science. At the moment I am developing an idee expert system to include innovative idees of all humans. Please send me if you have any other innovative idees. I`ll ask mij graduate students to carry out these idees in co-operation with others.

  2. Moses says:


    Thanks for sharing this wonderful project… surely try this cool stuff in next week. Gr8!


Leave a Reply