Using a USB host shield and a Bluetooth dongle to get data from a PS3 controller – Success!

As mentioned in a previous post, I’m interested in using a PS3 controller as the remote for future projects/robots. Having received all of the required hardware, I decided to make this video explaining the process of setting up the PS3 controller and Arduino for communication via Bluetooth. See below the video for details. UPDATE: The latest USB host library does not print out any debug information, so you won’t see any of the information that is printed out below “Bluetooth Library Started.” You should still be able to connect your PS3 controller and see it’s data output in the terminal.

UPDATE: I have found another place to purchase new dongles: here.

UPDATE: You can buy new dongles (not factory seconds like mine) here.

Hardware (besides an Arduino):

A Sony-made, PS3 controller (Dualshock 3 or Sixaxis (I was unable to find a strictly Sixaxis controller)).

A USB host shield: Circuits@home and Sparkfun.

A Bluetooth dongle: The wiki page for using a PS3 controller will have a list of compatible dongles (although note that in the video I mention that one of the “supported” dongles doesn’t in fact work). Here are the two I have: The black one (working) and the green one (not working, although listed as compatible). These are also confirmed working (by the developers): Kingston and Zoom.

The Software (besides the Arduino IDE):

UPDATE: Some people have had trouble with the newer versions of the USB host shield library. The new library does not print out the debug information you see in my video and the sketch will become too large to upload to an UNO if you turn the debugging on. If you would like to use the exact same version I use in my video (and am still using), you can get it here. You can get the latest version of the USB host shield library below.

You will need to download the entire USB host shield library from GitHub. This is a direct download link, but if you’d like to take a look around the repository go here.

Install the library as you would any other (if you haven’t done this before see this page), and open the “PS3BT” example as I show in the video (File –> Examples –> (Whatever you named the library) –> Bluetooth –> PS3BT). Remember that the Arduino doesn’t allow for dots (.) or dashes (-) in the library folder name, so when you download the library (which for some reason does have dots and dashes in its folder name) you will have to rename for the Arduino IDE to recognize it.

If there is something I forgot to include here, or if you have a question about something in the video, please ask.

116 thoughts on “Using a USB host shield and a Bluetooth dongle to get data from a PS3 controller – Success!

  1. MooreSauce,

    It’s most likely your dongles. Everyone is having trouble with them, including myself. Of the multiple dongles I have purchased, only one of them works consistently. I’ve even discovered that some dongles work, but they transmit data so slowly that they’re pretty much useless. Given how many people have contacted me about their dongles not having a light, I think you might be correct that new batches don’t have lights. HOWEVER, the light will not turn on until the library has successfully connectes to the dongle, so it is also possible that your light is not coming on because it is not connected (the latest version of the library does not have debugging enabled by default, so you might not get enough information in the terminal to tell). Are you sure that the address on your controller has been set correctly? If not, your dongle could be working (without turning the light on), and it’s you’re controller that’s failing to connect. If it’s not your controller, you could try this dongle: It’s expensive, but it’s probably more likely to work than dongles from other sources.

    Let me know if you figure this out or have any further questions.

  2. Carson,

    Are your baud rates set correctly? That often happens when the baud rate on the Arduino is not the same as the baud rate on the serial monitor. Check them and let me know if that’s not the problem.

  3. sakalmorokot,

    Let me make sure I understand you correctly. You are able to connect your PS3 controller to the USB host shield via Bluetooth, but only some of the buttons work (are showing up in the serial monitor)? That is quite odd, especially since it works with the USB sketch. Are you running the example PS3BT code? Could you have accidentally removed some of the code (perhaps the code that reads L2, R2 and the start button)?

  4. The only software I use is the Arduino IDE. The libraries are written in C++ (which can be written in any text editor, although I would recommend a purpose built code editor such as Sublime Text), but are compiled by the Arduino IDE.

  5. Hi… Thanks your so much for the tutorial… I got some problem with the Bluetooth dongle that I got from eBay which is the same as the one u’ve shown in this tutorial (the black one). The thing is when I connect with it, it worked fine except for the analog button of PS3, L2 R2 and Start button… It didn’t response at all. First, I thought it might be problem from my PS3 controller… But when I use it with PS3USB sketch, everything worked fine… Do you know what is the problem? I really appreciate your help, thanks in advance…

  6. I’m having an issue with my dongle, I ordered the same black one you used, four in fact, and every time I pull up the serial monitor for any dongle i plug in all I see is a few funny looking characters.

    How do I get this to work?

  7. Hello,

    I enjoyed your video and it seems like it will be a great way to control my hexapod project in the future, but as of right now I’m having some problems.

    I am using the Circuits At Home USB Host Shield 2.0 and the Mega 2560 board and I soldered the pins on myself (I am assuming that I didn’t damage it). I have checked the pins and they all seem to be properly attached and not shorted out.

    I am using the dongles that you suggested from Amazon (I bought 4) and none have worked. There was no LED light when I plugged it in so I first thought there was no power, but when I plugged a wired mouse into the usb slot it powered up the mouse (So it is getting power). I am also using an external battery power supply (4 AAs). I think the new version of the Dongles do not have LEDs.

    When I run the PS3BT code I only get “PS3 Bluetooth Library Started” and nothing else. When I run the program with the controller connected, I get nothing as well.

    Do you have any suggestions? Thank you in advance for your help.

  8. hi,
    i have been doing some basic robotics projects for a year so I am new to Arduino
    One question… did you use 2 Arduino UNO for the project because i saw i for the software setup and one for the hardware setup?

  9. Have you enabled debugging in the USB host shield library. This will make the library too large to fit on an UNO or leonardo. Unless you can make your code take up less memory, your only option is to purchase an Arduino with more memory.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s