Hey. This is Ben, a developer from Hong Kong. This is my first time to write an article on hackster.io and I just want to share one of my recent project on the internet.Problem:
Broken Gaming Experience
Long story short, I and Chris (my startup partner) have founded a startup called Teleclaw last year. So what the hell is it? Actually, Teleclaw is a mobile application to play claw machines online remotely. So right now you can control the claw machine anytime and anywhere through a real-time streaming camera. Awesome?
But here’s the problem. When I tell my friends about this idea, they always challenge me. This app cannot completely mimic the gaming experience of a real claw machine. After all the investigations and feedbacks from our users, what we're missing here is the handheld sensation of controlling the joystick to play the game. That’s the most important gaming experience.Solution:
IoT Joystick to Play the Claw Machine Online Remotely
My solution is to develop a handheld control that can play claw machines directly. The purpose is to narrow down the gap between a real joystick and a virtual one. Same as the remote control for your air-con at home.
Here’s the bill of materials for this project:
- an ESP32 module
- a 2-axis joystick
- a LiPo battery
- a 2.2 kohms resistor
- a 6mm tactile button switch
Using 18650 LiPo battery to power up ESP32
The reason that I choose the ESP32 module from “WEMOS” is simple. It comes with a battery solution by default that saves you much more time in power management.Step One: Schematic
Try to draft a schematic diagram and test out the circuit on the breadboard. Testing out the circuit before soldering the components together will save you much more time in the prototyping process. Bear in mind that although the label on the joystick is 5v, 3.3v is still an acceptable working voltage according to my experiment. That’s why no boost up board is required.Step Two: Coding
Write and upload the code to the ESP32 module. To keep it simple, I would like to use the Arduino IDE to program the logic.
However, it’s a little bit tricky to setup the development environment. So please follow the documentation on GitHub and download the USB driver from Silicon Labs. For some models of the ESP chips, long pressing the boot button when you upload the code.
After setting up the environment, let’s go through the business logic of our code base. Under this schematic, the microcontroller will have 4 different inputs: the digital reading from the joystick switch and button switch, the analog reading from x-axis and y-axis of the joystick. Base on these four inputs, we can program the microcontroller to trigger different HTTP request. For instance, the analog readings from x-axis and y-axis will be used as a command to control the claw. The HTTP requests will send to our backend server via the IoT service provider in China.
We definitely need a case to house our electronic components. By precise measurement of the components, I use Fusion 360 to design a basic model and print it out with my old 3D printer.
After several failures and prototyping, finally, there is a 3D model that I find really satisfying. The resolution of the printing is obviously not the best, but it is still good to go as a prototype.
So, everything is ready now and let’s put them all together. After a couple hours of working hard, voila!, here’s the first prototype. So now, let’s play the claw machine.
Although it is a little bit laggy, this prototype is still a great attempt to be a proof of concept.
By the way, if you are interested in this project, don’t worry, all the files and source code are on GitHub.Conclusion
There are definitely lots of improvements in the future. For example, I would like to design a custom PCB to tidy up the messy wires. Chris also suggested that cardboard will be a better alternative for those who don’t have a 3D printer.
Finally, I am not an expert in electronics while it’s my first time to handle a project like this. I just want to share my idea and thoughts with you guys.
Anyway, please leave a comment below and feel free to give me any suggestions about the project. Or any venture idea that you want me to prototype. Also, consider subscribing to my YouTube channel for more startup and prototyping video like this. Thumbs up, stay tuned and see you guys soon in the next episode.