articles

How to Use A PS3 Controller As A Wireless Servo and I/O Controller!

Wednesday, February 10, 2016

Wondering how to integrate a game controller into your electronics projects? You can use a PS3 controller to control servos, motors, and digital I/O by using a module circuit such as the ServoShock module circuit, which is the size of a stick of gum!

The ServoShock is pre-loaded with drivers for the Bluetooth dongle and the DualShock3 controller that allows you to control several RC circuits and motors with the Sony Dualshock3 controller via USB or wireless (Bluetooth). With this solution, you can control four servos with the analog sticks, two servos with the triggers, three servos with the XYZ accelerometers, and one servo with the gyroscope. The digital outputs are controlled by button presses and trigger pulses.

One feature that I really like about the ServoShock controller is that you can make a number of adjustments to the outputs. For example, you can choose whether you want the servo to operate in absolute input mode, or the analog sticks directly control the position of the servo.

You can also choose a relative mode where the analog sticks control the velocity of the servo. You can also change the trim, range of motion, direction of travel and sensitivity. You can implement a center deadband and re-calibrate the null position of the analog sticks and accelerometers to correct for any signal drift. The RC servo outputs can also be changed to a regular PMW signal for controlling DC motors.
Each of the digital outputs can be configured as momentary, toggle or autofire, though they can also be inverted if you prefer to have an active low output. The controller updates 100 times a second, so it's very smooth. You don't need any programming experience, or even a computer, to configure the ServoShock.

What you do is hold the PS and select buttons down for 3 seconds to enter in a special configuration mode. You can then cycle through each of the 27 outputs and make adjustments. For example, let's say you want to adjust the center position of the servo control by the right joysticks X axis, which is on channel 2. You tap the right shoulder bumper twice to cycle the channel to configurations and press the left or right direction pad to adjust positions.

When you are done, hold the start button for 3 seconds to save the changes.

PS3 Controller controlling this four wheeled mecanum robot

You can also pull the RAW data from the dualshock controller by using a serial peripheral interface (SPI) bus interface to read the RAW packets. The LEDs and the rumble motors on the dualshock can also be controlled with either the I/O pins or SPI bus.

There is also a demo board available with the ServoShock solution that can function as an Arduino shield. RC servos can be plugged into this demo board and an Arduino can read the controller packets via the SPI bus. The demo board also has a USB to serial bridge that allows you to upload new firmware and read the controller console output for making adjustments.

Similar Gadget Explained Reviews

0 comments

Connect With Gadget Explained