Weekend Project: Arduino + Xbee + PS2 controller = 20 channel universal project controller!

Last weekend I threw together my 20 channel wireless controller using the SMDuino, an XBee 2.5 and a PS2 controller and wanted to share the details.

The purpose of this project was to eliminate the need to use a wired interface to the Playstation controller in order to control your projects. Due to its size, the SMDuino fits neatly into one of the “arms” of the controller replacing the existing motor. With Bill Porter’s awesome PS2 library, an added battery, charging jack, reset button and Xbee, the Playstation controller can now be used as a universal 20 channel controller for a variety of projects.

Filed under: arduino — by akemp, posted April 23, 2012 at 10:51 am


Try Adafruit's new iPhone & iPad app for makers! Circuit Playground! "Incredibly handy for anyone working in electronics. Perfect for engineers and non-engineers alike."
Looking for engineers, makers and the builders of dreams? Try our Adafruit job boards.
Join our weekly Adafruit SHOW-AND-TELL at 9:30pm ET every Saturday night! Then at 10pm, ASK-AN-ENGINEER with Ladyada and the Adafruit team!

7 Comments

  1. Nice work! I’ve used wireless PS2 controllers with Bill Porter’s library for a number of remote-control projects. But the range is limited – especially through walls. What kind of range do you get with the XBee 2.5′s?

    Comment by adafruit_support — April 23, 2012 @ 12:18 pm

  2. Thanks! I haven’t done a specific range test using the high-gain antenna, but the spec sheet says I sound expect 400ft outside and 133 indoor. I took it outside yesterday to drive the tank, and hit at least 300ft.

    Comment by Adam — April 23, 2012 @ 8:09 pm

  3. Can you post a schematic with the ps2 headers labeled? I’m just plugging the four wires randomly into pins 3 through 6 and have not found the correct combination.

    Comment by Will — April 24, 2012 @ 4:50 pm

  4. woops I found the pin labels in the code but it still will not work. I have the correct baud rate and even put in level shifting resistors but all i get from the terminal is “yy yy yy yy yy”.

    Comment by Will — April 24, 2012 @ 5:45 pm

  5. Make sure that you are using the “Debug” code as it transmits data as ASCII characters rather then as a byte stream. A byte stream would appear as random characters, or no characters at all when view in the terminal. Alternatively you can use a program like RealTerm (WIN) or CoolTerm(MAC) to look at the raw HEX coming in.

    Also, make sure you are powering the PS2 controller at 3.3v. I have heard that they can run at 5V, but I wouldn’t try it.

    Good luck!

    Comment by akemp — April 24, 2012 @ 7:51 pm

  6. Thanks for the tips! Your Debug code is not compiling for me:

    SMDuino_PS2_Control_Debug.cpp: In function ‘void loop()’:
    SMDuino_PS2_Control_Debug.cpp:69:52: error: no matching function for call to ‘HardwareSerial::print(int, int&, int, int, int)’
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:44:10: note: candidates are: void Print::print(const String&)
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:45:10: note: void Print::print(const char*)
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:46:10: note: void Print::print(char, int)
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:47:10: note: void Print::print(unsigned char, int)
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:48:10: note: void Print::print(int, int)
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:49:10: note: void Print::print(unsigned int, int)
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:50:10: note: void Print::print(long int, int)
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:51:10: note: void Print::print(long unsigned int, int)
    /usr/share/arduino/hardware/arduino/cores/arduino/Print.h:52:10: note: void Print::print(double, int)
    SMDuino_PS2_Control_Debug.cpp:69:53: error: expected ‘;’ before ‘)’ token

    Comment by Will — April 25, 2012 @ 4:31 pm

  7. Fixed! Thanks for the heads up. I had left out “map(” in the battery % conversion line at the bottom of loop(). Let me know if you get it running!

    Comment by akemp — April 25, 2012 @ 7:49 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

www.flickr.com
adafruit's items Go to adafruit's photostream
www.flickr.com
items in Adafruits More in Adafruits pool