DIY ESP32 Bluetooth GamePad for Android, PlayStation and PC
In this project, we will first see how to build a breadboard gamepad circuit, and how you can communicate the circuit as a gamepad with an Android device, TV Box, PlayStation, and Computer. Next, you'll see what you can do by assembling a printed circuit board with a Bat-themed design and using both a Bluetooth gamepad and other communication options.
On the circuit side, I preferred the low-cost ESP32 development board, which offers wireless communication options such as WiFi, Bluetooth, and ESP-NOW.
Besides ESP32, a joystick module, button, resistor, capacitor, and some wires are required for the gamepad circuit. Now let's move on to building the circuit.
After building the circuit, let's set up the ESP32 to use it with the Arduino IDE! First, enter the shared link for ESP, then search and install the ESP32 board. Restart the Arduino IDE and open the shared GamePad source code.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
The source code includes a popular library called "BLE GamePad". If you go to the GitHub page of the library, you can find detailed explanations and examples. Go to “Add Library” search for the “BLE GamePad” library and install it. This library also needs the library named “NIM BLE”. If the libraries are installed, let's take a closer look at the source code now.
https://github.com/lemmingDev/ESP32-BLE-Gamepad
The shared GamePad source code contains a total of 13 buttons, the buttons define the key functions of a standard GamePad. Also, the source code offers three GamePad modes.
This description block contains the key names of the mods as well as the button numbers for the different GamePad mods. Each key name has a corresponding pin number.
/* * ANDROID GAMEPAD * {A=1, B=2, C=3, X=4, Y=5, Z=6, L1=7, R1=8, L2=9, R2=10, * Select=11, Start=12, PS=13, L3=14 , R3=15} * * PS GAMEPAD MODE * {SQUARE=1, X=2, CIRCLE=3, TRIANGLE=4, L1=5, R1=6, L2=7, R2=8, * Select=9, Start=10, L3=11, R3=12, PS=13} * */
The array "Buttons Pins" represents the physical button pins used on the development board. The constant "Number Buttons" specifies the number of buttons and contains the value of the pin each button is connected to.
int buttonsPins[NUM_BUTTONS] = {X_BUTTON, CIRCLE_BUTTON, TRIANGLE_BUTTON, SQUARE_BUTTON, R1_BUTTON, R2_BUTTON, L1_BUTTON, L2_BUTTON, START_BUTTON, SELECT_BUTTON, PS_BUTTON, R3_BUTTON, L3_BUTTON};
The "Android GamePad Buttons" array contains an ordered list of buttons used in Android GamePad mode. A number is assigned to each button. For example, button "A" is number 1, and button "B" is number 2.
int androidGamepadButtons[NUM_BUTTONS] = {1, 2, 3, 4, 8, 10, 7, 9, 12, 11, 13, 15, 14};
The "PS GamePad Buttons" array contains the list of buttons used in PlayStation GamePad mode.
int PS1GamepadButtons[NUM_BUTTONS] = {2, 3, 4, 1, 6, 8, 5, 7, 10, 9, 13, 12, 11};
The "PC GamePad Buttons" array contains the list of buttons used in Computer GamePad mode.
int PCGamepadButtons[NUM_BUTTONS] = {1, 2, 4, 3, 6, 8, 5, 7, 10, 9, 0, 12, 11};
The "GamePad Mode" variable contains the current GamePad mode. By default, Android mode is assigned, but this value can be changed later in the code.
GamepadModes gamepadMode = ANDROID;
Let's update the source code according to the components found in the breadboard circuit. There are 4 buttons and a Joystick module in the circuit, I will prefer the "Android Gamepad" mode to test the circuit. Define the pins of the components on the circuit, which the key function on the GamePad should call, and update the pin numbers. Then upload the source code.
I will use the Android application called “GamePad Tester” to view and test the Button and Joystick functions. Install the app, then turn on the Bluetooth connection and connect to the ESP32. Open the app, go to "Android GamePad Tester" and complete the test of the components on the circuit. Then, let's make a real test of the circuit through a game. I installed a car racing app, and now it's time to test the circuit!
I have a Bat-themed printed circuit board that I designed earlier and I will test it as a GamePad, if it works well I will revise it and design a new version for next use. Printed circuit boards are used to design more durable and stable electronic circuits for long-term use. I prefer PCBWay for printed circuit board service, you can easily upload the GERBER file and place an order quickly. Your order will be delivered in a few days, depending on your location. You can choose PCBWay for high-quality and low-price PCB service.
Just like the breadboard circuit, easy-to-assemble solderable components were preferred. Mount the required components on the PCB and solder them in place with the soldering iron and solder wire.
1x Diode SB560
3x Capacitor 100uF 16V
2x Thumb Joystick
1x Regulator 7805CV
2x LED 3mm
2x Resistor 220R
6x Resistor 4.7K
1x Doit ESP32 DevKit V1
2x Female Header 1x15 2.54
2x Female Header 1x4 2.54
1x Connector
4x Momentary Switch 12mm
The design includes 4 buttons and 2 joysticks, as well as one button connected to each joystick. Therefore, I will customize the source code for a total of 6 buttons and two joysticks.
Then I upload the source code. The circuit includes a female header for the voltage regulator. If you want to power the circuit with an external power source and the power voltage is higher than the ESP32's operating range of 6 to 12 volts, you should use a regulator.
You can power the circuit from the USB input of the ESP32 without using the regulator, you can also power it through an external supply in the 6 to 12 volts power range using a jumper.
I used one of the blank PCBs as a cover to avoid hand contact with the circuit.
I plug the ESP32 board into the circuit, then test the buttons and joysticks via the gamepad tester app. Next, I open the car racing game for control testing.
The circuit works well, if you ask what else I can do with this controller, here are a few sample projects… You can use this PCB in your projects with many wireless communication options such as ESP to ESP, Bluetooth, or WiFi.
ESP32 Mecanum Wheels Robot and Bluetooth Gamepad Controller
ESP32 Servo Motor Controller Board (Up to 16 Servo Motors)
ESP32 Joystick Hand Controller ESP-NOW
https://www.pcbway.com/project/shareproject/Bat_Hand_Controller_ESP32_and_Joystick_97e8ad4b.html
DIY ESP32 Bluetooth GamePad for Android, PlayStation and PC
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(7)
- Likes(15)
- Engineer Sep 17,2024
- David Elias Flores Escalante Sep 16,2024
- Engineer Sep 07,2024
- Mariano Apicella Aug 08,2024
- Engineer Jul 22,2024
- Engineer Jun 10,2024
- Engineer Dec 31,2023
- Engineer Nov 17,2023
- Engineer Oct 24,2023
- xaray Oct 19,2023
- thetrungk10 Aug 24,2023
- MERT KILIC Jul 20,2023
- Engineer Jul 18,2023
- (DIY) C64iSTANBUL Jun 28,2023
- NiteLynr Jun 28,2023
- 1 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
-
10design
-
9usability
-
10creativity
-
10content
More by MERT KILIC
- Creative Pogo LED Lighting Design Hi everyone! Welcome to my latest project: a modular, plug-in LED lighting system that is as fun as ...
- Build a simple 3D printed CNC plotter machine Hi friends, do you remember this Mini CNC Plotter machine that uses hobby stepper motors and a few 3...
- Circuit Activity Board - Educational Electronics Circuit Activity Board – A Hands-On Project to Learn Basic ElectronicsIn this project, we're going t...
- Build a Simple 3D Wall Lighting Hi friends, this project shows how to make and control 3D hexagonal LED lighting panels. The project...
- Robot Sumo Board Robot-sumo, or pepe-sumo, is a sport in which two robots attempt to push each other out of a circle ...
- ESP32 Mecanum Wheels Robot and Bluetooth Gamepad Controller In this project we will see how to make an ESP32 Mecanum Wheels Robot which is capable of moving in ...
- DIY Motorized WiFi Roller Blind - ESP8266 & Blynk In this project we will see how to control a roller blind via a smartphone application. The reason w...
- Pet Feeder Controlled Via WiFi - ESP8266 How It Works?As you can see, a 3D design was used for the pet feeder. ESP8266-based Wemos D1 Mini bo...
- ESP8266 Two Wheel Robot (NodeMCU and Stepper Motor) Generally, robot cars are built on a chassis with 2 DC motor wheels and a bovine wheel. While surfin...
- 3D Printed Rotating Table Board with Arduino Nano and 28BYJ-48 Stepper Motor This project shows how to make a 3D printed Rotating Table using Arduino and a hobby stepper motor. ...
- Hand Gesture Controller for Robotic Hand Gesture Controller for RoboticThe hand gesture controller makes it possible to control applicat...
- How To Make DIY Remote Control Hoverboat at Home In this video, I showed you how to make your own hoverboat from materials available at home and chea...
- How to Make DIY Arduino Gesture Control Robot at Home Parts Required for Receiver (Tank):1) Robot Tank Chassis - https://bit.ly/3j8y2Q52) Arduino Nano V3 ...
- DIY Circuit Activty Board with Paperclips | MAKER | STEM You can be creative and design your own circuit and add different sensors (other LEDs...). The idea ...
- ATtiny85 Wearable Activity Tracking Watch How to make the wearable activity tracking watch? This is a wearable gadget designed to vibrate when...
- Face With Animatronic Eyes, Motion Detection and Voice Are you ready to create something both eerie and captivating? This project combines 3D printing, ser...
- Build a simple 3D Arduino Mini CNC Plotter Hi friends, we will see how to make a simple and awesome mini CNC plotter machine in this project. I...
- Build a simple 3D Sphere Drawing Robot (SphereBot - EggBot - EggDuino) Hi friends in this video we will see how to make a simple and awesome sphere drawing robot. Actually...
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
109 0 0 -
DIY Laser Power Meter with Arduino
153 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
152 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
541 0 2