0

I have a gamepad which I want to treat as a sensor for my Arduino board. I want Arduino to trigger a certain action based on button pushes from the gamepad. Different buttons, different actions.

The gamepad comes with a USB connector. I cut the the USB cable open, solder it with pluggable pins which are then connected to a breadboard. I supply the gamepad with 5V power from Arduino and connect the USB's Data+ to Arduino's analog input pin (A0). Please check the images below.

I thought by observing the voltage coming from the gamepad's Data+ pin, I can probably determine if a button is being pushed. However, the observable input voltage in Arduino's A0 do not produce any meaningful difference between button push and release.

My question: Is it possible to detect Gamepad's button pushes with this arrangement? If it's possible, where do you think I'm doing wrong?

USB Gamepad and Arduino

schematic

simulate this circuit – Schematic created using CircuitLab

  • You arduino doesn't have USB host controller, so you can't. You have broken the gamepad for nothing.. – Eugene Sh. Dec 30 '15 at 16:08
  • 1
    Ok thanks for mentioning USB host controller, that's the lead that I need! – Andree Dec 30 '15 at 16:16
  • 1
    Adding a USB host controller to an Arduino is technically and economically silly. You'd be better off with something like a kl25z which is cheaper, more capable, and has that built in. Or you can gut the gamepad and replace the electronics. – Chris Stratton Dec 30 '15 at 16:37
  • 1
    ... or buy a real SNES gamepad, which just uses a simple shift register if I'm not mistaken. – pipe Dec 30 '15 at 16:38
  • 1
    Yes, the real SNES or Megadrive gamepads are much easier to read. – pjc50 Dec 30 '15 at 18:04
2

As mentioned, the problem is the gamepad you have uses communicates over USB, which requires a USB Host chip to communicate with. However, USB Host shields can be found on eBay (under "arduino USB Host shield") from US$10, and they come with a USB socket, so you could use it easily with another gamepad that hadn't had the connector snipped. This also would allow use with HID devices such as mice and keyboards if you wished, so a worthwhile shield to own.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.