0

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.


Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, or even use Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for MakeCode, CircuitPython, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Join 8,700+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – Python on Microcontrollers is here!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/


Maker Business — Wearable Myo ends production, soon to release smart glasses

Wearables — Resist warmth

Electronics — Hi-res mode for the (detailed) win!

Biohacking — Biohacking : The Wobbler Solution

Python for Microcontrollers — The Python powered synth is here @circuitpython @micropython @ThePSF #Python

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



7 Comments

  1. adafruit_support

    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?

  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.

  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.

  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”.

  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!

  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

  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!

Sorry, the comment form is closed at this time.