Although it is great controlling the robot arm with computer or mobile phone, I think using joystick is also cool, so I’ve bought a joystick shield and make a new project. This joystick shield is compatible with Arduino. It also support Nokia 5110 LCD module, nRF24L01 wireless module and Bluetooth module. It should be fun and convenient for various projects. : )
Step 1: Parts
7.4V Li-Po Battery
Charger
JST female connector
Standoff
Step 2: Assembly
For assembling Robot Arm Set you can follow the manual downloaded from the link. You can also refer to my seventh project. For Joystick Shield it is very simple: There are pin headers that are compatible with Arduino, just plug this shield to the pins on Arduino UNO / MEGA and that’s it.
Step 3: Wiring
This is a continuation of the seventh project and the wiring between robot arm and servo controller is just the same.
For servo cable:
Brown = GND
Red = +
Orange = Signal
From servos to servo controller:
Servo at the base > S1
……
Servo at the claw > S6
Use extension wires if the servo cable is not long enough. Make sure all the cables are in correct direction.
For Battery:
Red wire of 7.4V Li-Po Battery > IN + of buck regulator
Black wire of 7.4V Li-Po Battery > IN – of buck regulator
For Buck Regulator
OUT + > VS of the blue terminal block on servo controller
OUT – > GND of the blue terminal block on servo controller
From servo controller to Joystick Shield
Pin GND > – on Joystick Shield
Pin 5V > + on Joystick Shield
RXD > Pin 0 on Joystick Shield
TXD > Pin 1 on Joystick Shield
Step 4: Testing Code
Next, I select A button to control the servo on the claw. When I press A button, the digital signal changes to 0 and the claw closes; when I release A button, the digital signal becomes 1 and the claw opens. I’ve referred to the table of PWM in the seventh project as follow:
Servo Lowest PWM Movement Highest PWM Movement
S1 500 right 2500 left
S2 500 up 2500 down
S3 500 down 2500 up
S4 500 down 2500 up
S5 500 anticlockwise 2500 clockwise
S6 900 open claw 1700 close claw
To control the servos with servo controller, we have to know the command and this is in the structure as follow:
#P ………..T
I want the claw closes in 1.5 second and we can sketch the code as follow:
#6P1700T1500
Servo controlling the claw is S6 and PWM of closing claw is 1700.
When I press A button, Arduino sends this command to servo controller via serial communication. Servo controller reads it and it instructs the claw to close.
Read more: My Ninth Project: Robot Arm with Joystick Shield using Arduino