This gamepad is designed for any robotics projects. It is powered up by a 3.7V 18650 lithium battery and the board we use has sufficient 5V output pins for each component. Using lithium battery, it provides reliable and strong power to components. Lithium battery is chargeable, it is more economy and cost effective for long run. Battery recharging is easy, simply by plugging-in the 5V power source to the USB port of the board. Moreover, robot locomotion are controlled by a joystick switch. 16 buttons of matrix switch allows you to bind declaration of robot function.
To demo the general purpose of it, we developed Arduino sketches using it to control the robots we designed.
These codes are open and freely to distribute. They are good references for you to implement the gamepad control code for your projects.
Arduino sketches on github - uploads
Test.ino to check wiring correctness of matrix switch and joystick switch first; open the Serial Monitor to see the button and joystick switch responds; You can modification this program to fit your robotic application.
- open and upload
Ez-GoBLE-Gamepad.ino for controlling Ez MiniKame Mk2 and Ez Spidey; set bluetooth module baud rate to 115200
- open and upload
Ez-OpenCat-Gamepad.ino for controlling Ez OpenCat; set bluetooth module baud rate to 38400
To build the gamepad you need following components:
- HuaDuino and Game Switches Combo kit - HuaDuino is Arduino Nano compatible with enhanced features. It integrates everything on a single PCB. It's a lot easier for people to make a bot with it. Embedded battery charging circuit, battery charging is more convenient. It is inexpensive so it is our favor board to do project.
- 2 of HC-05 Bluetooth modules; some modules has a little switch on the left upper corner you have to press it to enter AT command mode;
- one is set to master mode for gamepad - see step 1 to 6 of this tutorial, use HuaDuino to do same steps;
- the other one remains in slave mode and plugin the robot
- set baud rate parameter of Serial.begin() to match the baud rate setting of both HC-05.
- a buzzer
- a 18650 lithium battery, use this battery clip to hold it; practically you can use any 3.7V lithium batteries as long as the size can fit the base model.
- 8 of M2x6 tapping screws
- 4 of M3x14 screws
- 13 of dupoint wires
The connection of components to the board as followings
VRX_PIN -> A0
VRY_PIN -> A1
SW_PIN -> A2
VCC -> 5V
GND -> GND
4x4 matrix switch
C1 -> D2
C2 -> D3
C3 -> D4
C4 -> D5
R1 -> D6
R2 -> D7
R3 -> D8
R4 -> D9
positive polar -> A3
negative polar -> GND