I have received some feedback from my readers regarding my first usb gamepad project , so for the past few weeks I was working on a new imrpoved design. There are plenty of new improvements that I hope will address many of your requests.

Release Notes / Change Log:

——————————————
2009-09-25
Config Utility Version 1.0.0
Device Firmware Version 1.5
——————————————

- device supports a wide range of accelerometers and gyroscopes
– implements smoothing filtering algorithm
– implements algorithm for combining gyroscope and accelerometer data
– HID USB interface makes the device compatible virtually with all modern operating systems (Mac,Windows,Linux)
– configuration utility (for Windows only for now)
– adjustable smoothing and scale factor for outputs
– configurable sensibility for accelerometer and gyroscope (can be set per axis)
– configurable midpoint (0g voltage) for accelerometer (can be set per axis)
– auto-find gyroscope midpoint (0 deg/s voltage)
– you can use separate accelerometer/gyroscopes for different axis
– Z axis not implemented in this release
– configurable analog input ports AN0-AN5 for each axis (please note 18F2550 does not have AN5 input , but 18F4550 does)
– ability to invert axis
– capture output and raw adc data into a comma separated values file (.csv)
– charting feature of all inputs/outputs
– graphical display of output and buttons
– supports up to 8 buttons
– configuration is stored in device EEPROM
– it is possible to use accelerometer alone on any axis (1, 2 or 3-axis) in this case set Smoothing to 0-10 value
– it is possible to gyro alone on any axis (1,2 or 3 axis) in this case set Smoothing to 100-255 , please note that the output will snap to middle after a while since gyro only provides rate information
– it is possible to use to use gyro and accelerometer on any axis (RECOMMENDED) in this case set smoothing to 20-100 value
– you can use multiple accelerometers or gyroscopes
– you can orient gyro or accelerometer as you like (but aligned to 90 degrees increments)
– you can connect your gyro and accelerometer outputs to any of the AN0-AN4 ports (for PIC18F2550).

Suggested Circuit Schematic

Below is a new suggested schematic , using a 2-axis Gyroscope and an a 2-axis Accelerometer. As mentioned above the new firmware and configuration utility is very flexible regarding the way the gyro and accelerometer are connected (this is one of the features requested , to be able to use device with various MEMS sensors).

Schematic  for USB Gamepad with Accelerometer and Gyroscope

Configuration Utility

Here is a screen shot of the configuration utility, please note that I am using the gyro just for one output axis (X), thus I set smoothing to 50 as recommended in release notes above. The other axis (Y) uses just accelerometer data so Smoothing is set to 5. Device automatically detected the Gyro midpoint to be 1.35V , you must hold device still for at least 1s to let it calibrate when you plug it in. The Gyro axis is also inverted due to the way it is mounted in the case.

usb motion gamepad configuration utility

Hardware Setup

My old accelerometer-only device , got modified to make space for a gyro. Here is how it all fit inside the case:

usb tilt / pan gamepad in Wii steering wheel, uses accelerometer, gyro and pic18f2550

Demo

Finally here is a new demo with another game I found to work well with this device PURE. In this game you can actually use the FORWARD/BACK tilt (Y axis of the device), besides the usual LEFT/RIGHT (X axis) I demonstrated in the TMNations demos (see my first usb gamepad article).

Downloads

Configuration Utility Setup (Windows XP/Vista) StarlinoGamepadConfigSetup_100.exe

PIC18F2550 Firmware 18Fx550_USB_GAMEPAD_GYRO_15.hex (right click on the link and choose Save Link/Target As if HEX file opens in browser).

I will continue to edit this article , please let me know what questions/suggestions you have in the comments area below. I will try to update this page and design based on your feedback.

//starlino//