Arduino gamepad control via USB host shield- no PC required-

Anything to do with programing the Arduino Platform.
a_shorething
Posts: 289
Joined: Sep 10th, 2013, 5:26 pm
Location: New Jersey Shore

Arduino gamepad control via USB host shield- no PC required-

Post by a_shorething »

Hey everyone,

I just wanted to let you know in case you're interested, there are lots of options for controlling something using an Arduino hooked directly to a gamepad controller by using the USB host shield.

Here's some information and links to some example projects and code:

http://arduino.cc/en/Main/ArduinoUSBHostShield

There is support for PS3, XBOX, joystick and a lot of other USB devices. You can use a USB bluetooth dongle to make it a wireless connection (Arduino topside in a sealed plastic container, using Xbox controller wirelessly...).

You still need to get the information down the tether (serial/Ethernet, whatever) and you still need some way to display your video and any telemetry, but this will remove a lot of the higher level coding that most of us have to do (or in my case, have largely done) and will enable us to use an intuitive UI device and send signals directly down the wire. I had been trying to find way to do this for a while so that I didn't have to rely on my laptop for this part (and could potentially set up a separate display option like a hood or video goggles or something so I could see even on a bright sunny day). This opens up a lot of possibilities.

Sorry if this is so painfully obvious to some of you that you are bored already. :)

I just learned about this option so I just wanted to share it.
User avatar
TigerShark
Posts: 108
Joined: Jan 7th, 2014, 2:43 pm
Location: Washington State

Re: Arduino gamepad control via USB host shield- no PC requi

Post by TigerShark »

We tried this option but had issues with it. Perhaps it was the version of the board. I am now using a PS2 controller which plays nice with Arduino. If you get it to work let me know.
a_shorething
Posts: 289
Joined: Sep 10th, 2013, 5:26 pm
Location: New Jersey Shore

Re: Arduino gamepad control via USB host shield- no PC requi

Post by a_shorething »

TigerShark wrote:We tried this option but had issues with it. Perhaps it was the version of the board. I am now using a PS2 controller which plays nice with Arduino. If you get it to work let me know.
Will do. And thanks for the tip on PS2, I'd prefer to get the Xbox controller working but PS2 would be cool too.
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Arduino gamepad control via USB host shield- no PC requi

Post by perfo »

Interesting. I suppose a lot of folk use a pc or laptop due to the fact they already have them and they've got good big displays. However maybe using your method you could use a wifi device on the arduino and stream the video and telemetry data. That way any pc can see all the goodies but wouldn't be controlling anything. If the joystick was blue
toothed then it may appear to the user that the pc was doing the controlling.
rossrov
Posts: 383
Joined: Feb 28th, 2013, 5:01 pm
Location: Australia

Re: Arduino gamepad control via USB host shield- no PC requi

Post by rossrov »

Yes, interesting. Good post a_shorething. On it's own it would be a software-heavier version of RC TX/RX/PPM encoder wireless link, with the possible bonus of having two-way data.

Off-topic regarding Arduino topside, I see BT handset talking to smartphone in goggles talking with WiFi router then down to the ROV over Ethernet. Some measures may be need to be taken with WiFi that close to the eyes though.
a_shorething
Posts: 289
Joined: Sep 10th, 2013, 5:26 pm
Location: New Jersey Shore

Re: Arduino gamepad control via USB host shield- no PC requi

Post by a_shorething »

perfo wrote:Interesting. I suppose a lot of folk use a pc or laptop due to the fact they already have them and they've got good big displays. However maybe using your method you could use a wifi device on the arduino and stream the video and telemetry data. That way any pc can see all the goodies but wouldn't be controlling anything. If the joystick was blue
toothed then it may appear to the user that the pc was doing the controlling.
Exactly what I was thinking. Break things down to the actual requirements and deal with each one separately in the most efficient way. I was approaching things from the standpoint of 'I have a laptop I can use, so...' but the more I think about it, the more I think it logically isn't required. All I need is a way to control the ROV and a way to see the display coming back up. The PC screen is a very bad display in broad daylight that I would have to work around. If the display was something else and the control system was something else (cheaper and possibly more water-resistant) then I don't have to add workarounds to the laptop configuration...
rossrov wrote:Yes, interesting. Good post a_shorething. On it's own it would be a software-heavier version of RC TX/RX/PPM encoder wireless link, with the possible bonus of having two-way data.

Off-topic regarding Arduino topside, I see BT handset talking to smartphone in goggles talking with WiFi router then down to the ROV over Ethernet. Some measures may be need to be taken with WiFi that close to the eyes though.
True, topside becomes much more flexible and adaptable. The display is an issue for me because I have an open boat. There really is no place to be out of the sun except in the head. :)
I'm thinking some kind of goggles or hood would be better and that means the laptop is just extra baggage and in fact a weak link in the system.
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Arduino gamepad control via USB host shield- no PC requi

Post by perfo »

If you find an easy way to do a HUD with a PI I'd be very interested. I know google glass and the like aim a laser at the retina. But wouldn't a small screen with the right lens on it be see able ? Maybe even a fiber optic with a lens on. I couldn't find anything about the technology on Google. I wanted ski maps to be visible in my goggles whilst skiing even if I have to look down to see them.. Since I thought of it there are commercial ones available but for meg £'s.
User avatar
TigerShark
Posts: 108
Joined: Jan 7th, 2014, 2:43 pm
Location: Washington State

Re: Arduino gamepad control via USB host shield- no PC requi

Post by TigerShark »

I used a laptop before and found it added too much complexity to the system reducing reliability and increasing setup time. Now everything is in two boxes and I only have one thing to plug into power and have lower power requirements.

Look into augmented reality for HUD options. You could have the camera pan and tilt with your head.
perfo
Posts: 151
Joined: Jan 27th, 2015, 12:05 am

Re: Arduino gamepad control via USB host shield- no PC requi

Post by perfo »

Yep I did and couldn't find any details about anyone having DIY'd / hacked it. Only big expensive stuff.
My thoughts were to use eye movement to select stuff on a menu system or indeed in this case move the camera. Eye following with a small camera and infrared has been done by the home DIYer..
a_shorething
Posts: 289
Joined: Sep 10th, 2013, 5:26 pm
Location: New Jersey Shore

Re: Arduino gamepad control via USB host shield- no PC requi

Post by a_shorething »

Perfo read that link. The thing from Adafruit includes a 9DOF board that can send input to the system like an Oculus Rift kind of thing.

You can set it up to connect to a pan/tilt control of the camera.

It wouldn't give complete control but it would be pretty cool to move the camera with that and control the ROV movement via gamepad.
Post Reply