Introduction: How to Control Servo With Play Station 2 Controller
I wanted an easy way to control my robots servo so i googled for a suitable solution but couldn't find one. so i decided to use my old ps2 controller for this purpose and it worked perfectly.
So here is a step by step guide for you to do the same..Hope you'll like it.. :)
Step 1: Thing You'll Need
1. Arduino UNO or any other arduino with pwm output x1
2. Breadboard x1
3. Hookup wires
4. Servo motors x1-4 (you can control upto four servo with this code)
5. Power source for Servos(arduino can't supply enough current,i used a variable voltage battery eliminator)
6. Play station 2 controller(I used wireless controller).
7. Soldering iron (For making a connector for ps2 controller,Skip this if you already have connector)
8. PC with Arduino IDE installed
9. Bill Porter's ps2x lib installed (Download it from here).
Step 2: Making the Connector
i'm not gonna explain this one in detail. Well i made my one with a broken ps2 multitap (luckily i found one laying around).So basically what i did here is that,i de-soldered the female connector from multitap and soldered some hookup wires and male headers with it
Step 3: The Circuit
Circuit here is pretty simple.just the connect the servo in the following manner :-
servo 1------------------> Arduino digital pin 9
servo 2------------------> Arduino digital pin 6
servo 3------------------> Arduino digital pin 5
servo 4------------------> Arduino digital pin 3
Now connect ps2 controller to arduino
Data-------------> Arduino digital pin 12
Clock------------> Arduino digital pin 13
Attention--------> Arduino digital pin 10
Command------> Arduino digital pin 11
Note- If you use external power source for the servos then don't forget to join GND of both arduino and power source.
Step 4: Arduino Code !!!
Now just upload this code to your arduino and you're ready to roll
Step 5: Troubleshooting
1. No controller Found -
check your wiring again or check this LINK for possible solutions
2. Servo jittering -
Try to feed servo with external power source.
Still have some issue???Feel free to comment and I'll try my best to solve it.
---------------->VOTE for my instructable in MIND FOR DESIGN contest if you like it<---------------------