Reasonable DIY Wireless Controller
by SayaNIGHT in Circuits > Remote Control
1266 Views, 14 Favorites, 0 Comments
Reasonable DIY Wireless Controller
I don't think this controller is super cool. But if any of the following conditions apply, this controller might be a reasonable option.
- You need a cheap, wireless controller with a joystick and some push buttons.
- You don't want to worry about wireless compliance like the FCC in the US, the CE in the EU or the technical standards conformity certification in Japan.
- You don't want to use lithium batteries. You prefer to use alkaline batteries.
- You want to customize the software/case of the controller.
- You don't mind if the controller is a bit large.
I used to use a tablet device to control my DIY robots, but I don't want to use an expensive one in a creator's event. I think one solution is to use an official Sony PS controller. But I couldn't get a cheap one. (If you know how to get official PS controllers cheap in the US, please let me know!)
I can buy a non-official cheap remote controller from an online site like Amazon, but these controllers may not connect to any of my devices like DIY robots. Also, I don't think many cheap controllers are compliant with wireless standards. I was worried if I could use a device without any wireless compliance in public events. Then I tried to make my own controller. This time, I chose alkaline battery type. As you know, lithium batteries are rechargeable, powerful and small, but require some care. I think alkaline batteries are easier to use than lithium batteries. I'll share the alkaline battery type controller this time.
Supplies
Parts
- MCU module: Espressif Systems ESP32 DevkitC v4 (x1)
This module has FCC/CE/technical standards conformity certification. But you can also use your favorite MCU module.
- Gamepad: HiLetgo Gamepad Joystick Shield (x1)
- LED: blue Φ5mm LED and resistor (x1)
You can use any color LED. Choose an appropriate resistor.
- battery holder: 3 AA battery holder (x1)
- DC-DC converter module:
step up, output 5V ~480mA→Adafruit MiniBoost 5V @ 1A - TPS61023(x1)
I changed to a converter with a higher output current, because some of the first ones didn't work well.
- Power switch: slide, SPDT (x1)
- Screws: flat head M2.5×10mm screws and nuts (x6)
- wires
- socket connectors
Tools
- 3D printer: Flashforge Adventurer 4
- Screwdrivers
- Soldering iron
- Hot glue gun
Software
- Arduino IDE
- Fusion360
3D Printing
Print two parts (case.stl and lid.stl) on your 3D printer. I used 1.75mm PLA filament. Only the power switch part of case.slt requires supports. The other parts don't require any support.
Wiring
Solder and wire all the components according to the schematic diagram. The pinout of the gamepad module is shown in the photo above. Set the V select switch of the gamepad to 3V. Make sure the LED fits in the position of the LED space on the case and the switch position is correct. If you don't reuse the MCU and gamepad, you can solder directly instead of using sockets. To prevent a short, I recommend to protect the circuit using tape and heat shrink tubing as shown in the attached pictures.
Coding
Code the MCU as you like. As a sample I attached my code. The controller is a BLE central device in this code. I recommend changing the UUIDs.
Downloads
Assembling
- Insert a screw nut into each of the six nut holders. Then close the holders using a hot glue gun to fix the nuts as shown in Fig. 1.
- Set the gamepad using screws as shown in Fig. 2.
- Put the all electronic components as shown in Fig. 3.
- Close the lid using screws. If the lid doesn't close well, try to close by pulling the switch like in Fig. 4. The switch is fixed after closing the lid.
Test and Use!
Test and use your controller as you like! Customize the case if you want.
As a sample, I attached my peripheral device's code. Prepare another ESP32 DevkitC module as a BLE peripheral device and upload "BLEControllerMonitorPeripheral.ino" to it. You can test the controller by connecting to your PC via UART(USB cable) and checking the serial monitor in the Arduino IDE.