| Author | Topic: Wireless 3D-motion game controller (Read 915 times) |
gmoon Wizard's Apprentice
     member is offline
![[avatar]](http://home.earthlink.net/~dgdtv/images/jaw.jpg)
Joined: Mar 2006 Gender: Male  Posts: 876 Location: Ohio, USA
|  | Wireless 3D-motion game controller « Thread Started on Sept 25, 2006, 9:52pm » | |
Adding a transmitter/receiver pair with a couple microcontrollers and an accelerometer, and you've got a homemade wireless game controller:
http://video.google.com/videoplay?docid=-34351659775337089 (thanks to Stefano Tognon for source code to Markanoids, so it could be modified for the userport.)
The prototype really looks ghetto, I know. But it's gonna be a week or two until I have time to make a PCB, etc. So this is just a preview (but a fully functional one.)
Transmitter/receiver: TLP434A & RLP434A matched pair ($15 USD for both)
The transmitter uses an ATmega8 (Using a micro with a real USART really simplified the wireless part, probably change this to an ATmega48) and a LE33 LDO regulator (3.3v) for the AVR and the accelerometer. The transmitter module itself is powered directly off the 9V battery.
Receiver uses an ATmega16 running @ 5V.
I'll add some photos, description, code, etc. tomorrow.
| |
|
David Murray Moderator
     member is offline
![[avatar]](http://galaxy22.dyndns.org/david-avatar.jpg)
Joined: Dec 2004 Gender: Male  Posts: 1,561 Location: Kennedale, TX
|  | Re: Wireless 3D-motion game controller « Reply #1 on Sept 25, 2006, 10:00pm » | |
You're room is messy.
| |
|
Golan Klinger Moderator
     member is offline
![[avatar]](http://www.vex.net/~falco/chococat.jpg)
64K is enough for me.
Joined: Mar 2005 Gender: Male  Posts: 1,031 Location: Toronto, CANADA
|  | Re: Wireless 3D-motion game controller « Reply #2 on Sept 25, 2006, 10:04pm » | |
You just couldn't wait for Nintendo to release the Wii, could you? 
Seriously, that's an amzing hack.
| Call me Golan; my parents did. |
|
gmoon Wizard's Apprentice
     member is offline
![[avatar]](http://home.earthlink.net/~dgdtv/images/jaw.jpg)
Joined: Mar 2006 Gender: Male  Posts: 876 Location: Ohio, USA
|  | Re: Wireless 3D-motion game controller « Reply #3 on Sept 25, 2006, 10:14pm » | |
Quote:You're room is messy.  |
|
Oh, you have no idea. Be glad I didn't pan around....
And thanks, Golan.
| |
|
diroga Full Member
   member is offline
![[avatar]](http://img296.imageshack.us/img296/4161/readywf0.gif)
Joined: Jun 2006 Gender: Male  Posts: 105 Location: WA
|  | Re: Wireless 3D-motion game controller « Reply #4 on Sept 26, 2006, 4:08am » | |
very nice. can it work with any other software?
| |
|
gmoon Wizard's Apprentice
     member is offline
![[avatar]](http://home.earthlink.net/~dgdtv/images/jaw.jpg)
Joined: Mar 2006 Gender: Male  Posts: 876 Location: Ohio, USA
|  | Re: Wireless 3D-motion game controller « Reply #5 on Sept 26, 2006, 8:04am » | |
Quote:| very nice. can it work with any other software? |
|
Yes.
The receiver works like a joystick, and sets the direction and firebutton lines. ANY software that uses a joystick should work--there is no driver needed. This mod would work without changes on a DTV with a joystick port. The outputs are open collector compliant.
In fact, I plan to test it on my C128 very soon.
The custom game is for the Hummer, which doesn't have a JS port.
The receiver uses a (relatively expensive) ATmega16 only because: 1) I have a couple, and wanted to see how it worked running at 5V on the Hummer.
2) When I finally encase the Hummer mod, I figure the more IO lines the better.
3) A standard C= JS port has a 5V power tap. Might as well see if it can run without a regulator on the DTV (the transmitter NEEDs a regulator, since the accelerometer is 3.3v, and the transmitter module works much better at a higher voltage. A 9V battery is a nice size for a handheld thingy.)
Any AVR with a USART could work for the receiver--the code is very small.
| |
|
pyrofer Senior Member
    member is offline
Joined: Jul 2005 Gender: Male  Posts: 263 Location: London
|  | Re: Wireless 3D-motion game controller « Reply #6 on Sept 26, 2006, 8:14am » | |
How about you have it PWM the output. But pulsing the joystick at a rate depending on how far you tilt it you would get sort-of-proportional control. Holding it 45' or more would be fully on, but less would pulse the output. Maybe 20' would have a 45% duty cycle if you get what I mean.
| Please visit my Project site at, www.pyrofersprojects.com |
|
gmoon Wizard's Apprentice
     member is offline
![[avatar]](http://home.earthlink.net/~dgdtv/images/jaw.jpg)
Joined: Mar 2006 Gender: Male  Posts: 876 Location: Ohio, USA
|  | Re: Wireless 3D-motion game controller « Reply #7 on Sept 26, 2006, 8:33am » | |
Quote:How about you have it PWM the output. But pulsing the joystick at a rate depending on how far you tilt it you would get sort-of-proportional control. Holding it 45' or more would be fully on, but less would pulse the output. Maybe 20' would have a 45% duty cycle if you get what I mean. |
|
Right. It can definitely be more sophisticated, software-wise.
I was also thinking of having different modes, one with the firebutton PWM for rapid fire, and as you mentioned a 'proportional JS' mode, etc. One mode would be to receive high res tilt info, but that would be for custom software.
The plan is to mount a PSP analog joystick on top. They are cheap and easy to find, and you might get sick of playing games 'tilt style' after awhile. A mode for receiving all five dimensions is possible, too (3x accel, 2x js.)
| |
|
gmoon Wizard's Apprentice
     member is offline
![[avatar]](http://home.earthlink.net/~dgdtv/images/jaw.jpg)
Joined: Mar 2006 Gender: Male  Posts: 876 Location: Ohio, USA
|  | Re: Wireless 3D-motion game controller « Reply #8 on Sept 26, 2006, 9:34pm » | |
The prototype's not much to look at:
![[image]](http://home.earthlink.net/~dgdtv/images/rf/rf_proto1.jpg) If you look closely, you'll find a firebutton and the ISP port. The TO92 (transistor-like) package is the LE33 regulator, and the transmitter module is the small vertical PCB w/the metal cap.
The transmitter/receiver pair are pretty amazing--$15, with a range up to 500 ft (line-of-sight, probably.) 4800 bps, and a 40000 bps version is available--expect this stuff to get better and less expensive....
The yellow alligator clip is the power switch . With the regulator, the input voltage for the transmitter board is anything from 4V to 12V.
Here's the schematic for the transmitter. It includes a few things not on the prototype: LED indicator, option button, and a connector for an analog joystick: http://home.earthlink.net/~dgdtv/images/rf/transmitter1.pdf
Accelerometer is on the bottom: http://home.earthlink.net/~dgdtv/images/rf/rf_proto2.jpg
The receiver: http://home.earthlink.net/~dgdtv/images/rf/rf_proto3.jpg (the blue wire is the receiver module digital data output, connected to the RXD pin (USART) on AVR)
I didn't make a schematic for the receiver, it's so simple. Still to come....
| |
|
pyrofer Senior Member
    member is offline
Joined: Jul 2005 Gender: Male  Posts: 263 Location: London
|  | Re: Wireless 3D-motion game controller « Reply #9 on Sept 27, 2006, 3:29am » | |
I can see your not using the Z axis, or youd notice that the accelerometer is upside down when your holding the unit. Not a biggie, but will add a 1g offset to Z later on if you use it
| Please visit my Project site at, www.pyrofersprojects.com |
|
gmoon Wizard's Apprentice
     member is offline
![[avatar]](http://home.earthlink.net/~dgdtv/images/jaw.jpg)
Joined: Mar 2006 Gender: Male  Posts: 876 Location: Ohio, USA
|  | Re: Wireless 3D-motion game controller « Reply #10 on Sept 27, 2006, 7:03am » | |
Quote:I can see your not using the Z axis, or youd notice that the accelerometer is upside down when your holding the unit. Not a biggie, but will add a 1g offset to Z later on if you use it  |
|
As a matter of fact, yes, I don't use the Z axis since the first goal is to emulate a joystick. But interpreting the all the dimensions depends on how it's mounted, anyway (X & Y might be switched on the PCB--and if it's mounted at right angle to the PCB, then Z might become X or Y.)
Anyway, I'm glad I got a 3-axis accelerometer, but for playing existing c64 games a 2D accel would work fine.
[Edit] The Z axis might be used to control the sensitivity of the device, i.e., the speed of the PWM....
| |
| |
|