Making a Tiny Handheld Game With Arduino

by The Wrench in Circuits > Arduino

25737 Views, 184 Favorites, 0 Comments

Making a Tiny Handheld Game With Arduino

IMG_8947.JPEG

Hey, everyone! What's up? Today, I'm excited to take you through the journey of creating this awesome handheld game. But before we dive in, I want to give a shoutout to our sponsor, JLCPCB – more on them in a bit.

Supplies

vlcsnap-2023-11-22-19h00m39s982.png

To kick things off, you'll need an Arduino. I'm using the Arduino Nano from DFRobot, but any Arduino board will work. Also, grab a 240x240-pixel display from Waveshare with the ST8977 driver and a micro switch. We're going to prototype the project on a breadboard, so make sure you have one and some jumper wires


Tool used:

Getting Started

Screenshot 2023-11-22 131731.png

Now we have to follow this circuit diagram to make the connection.


  • SCLK - D13
  • MISO - D12
  • MOSI - D11
  • CS - D10
  • RST - D9
  • DC - D8
  • VCC - 5V
  • GND - GND

(CS, RST, DC) can be updated in code. And other pins are specific to board you are using.

Button is connected to D2 in Arduino NANO. Follow this tutorial

Building the Circuit on Breadboard

vlcsnap-2023-11-23-14h21m30s774.png
vlcsnap-2023-11-23-14h21m40s336.png
vlcsnap-2023-11-23-14h21m45s565.png
vlcsnap-2023-11-23-14h22m05s077.png
vlcsnap-2023-11-23-14h22m00s864.png
vlcsnap-2023-11-23-14h22m13s846.png


Start by putting all the parts on the breadboard. Then, connect everything with jumper wires, following the diagram.

Once the circuit is set up, it's time to upload the codes.

Codes

vlcsnap-2023-11-23-14h22m27s299.png

You can upload the code using either the Arduino IDE or VS Code Studio, whichever program suits you best. The codes are still a work in progress and not the final version. Feel free to contribute to improve them.


Download Codes: Github

Working

vlcsnap-2023-11-23-15h01m59s943.png
vlcsnap-2023-11-23-15h02m03s882.png

Okay, after uploading the code, it starts working. It's a one-button game similar to Flappy Bird. Currently, it has only one game, but we are developing the code for 2-3 more games, so make sure to follow to stay updated.

Project Evolution

Schematic_Flappy Bird_2023-11-23 (1).png

But wait, we're only halfway there! I want this game to fit on a keychain, so let's shrink it down. The solution? A custom PCB board. I designed the schematic, converted it into a PCB, and ordered it from JLCPCB. They're not just a sponsor; they're a trusted and cost-effective PCB manufacturer. Upload your Gerber file, and you can get your PCB for just $2.


Link: https://jlcpcb.com/?from=DST

Download Gerber File - Gerberfile

Custom PCBs

vlcsnap-2023-11-23-15h23m53s541.png
vlcsnap-2023-11-23-15h24m04s587.png

My PCB arrived in just 7 days, and the quality is top-notch. I also order a stencil for easy soldering. 

SMT Soldering Process

vlcsnap-2023-11-23-15h30m20s120.png
vlcsnap-2023-11-23-15h30m53s336.png
vlcsnap-2023-11-23-15h31m02s231.png
vlcsnap-2023-11-23-15h31m11s366.png
vlcsnap-2023-11-23-15h31m19s111.png
vlcsnap-2023-11-23-15h31m27s283.png

Place the PCB, position the stencil, apply solder paste, and spread it evenly. After that lift up the stencil carefully, you'll have a perfectly soldered PCB.


Assembly Process

vlcsnap-2023-11-23-15h34m50s707.png
vlcsnap-2023-11-23-15h35m10s781.png
vlcsnap-2023-11-23-15h35m16s316.png
vlcsnap-2023-11-23-15h35m26s940.png
vlcsnap-2023-11-23-15h35m37s400.png

Now, position the components. Since this board isn't programmable, grab the ATmega chip from a pre-programmed Arduino board. Melt the solder paste using a hot air gun, and voila, the PCB is almost complete.


Next up, the display. We had a hiccup with the solder pads, but creativity strikes! Enamelled copper wire saved the day. Glue the display, solder the micro switch, and our PCB is good to go.

Testing

vlcsnap-2023-11-23-15h40m46s740.png
vlcsnap-2023-11-23-15h40m57s019.png
vlcsnap-2023-11-23-15h41m06s041.png

Now, it's time to test if it works. Attach a tiny 3.7V battery to the battery terminal.


So far, it has worked perfectly. The next step will involve housing it.

Finalizing

vlcsnap-2023-11-23-15h42m53s628.png
vlcsnap-2023-11-23-15h43m00s297.png

Time to house our creation. I designed a case and 3D printed it on my Bamboo Lab 3D printer.

Last Step

vlcsnap-2023-11-23-15h48m11s940.png
vlcsnap-2023-11-23-15h48m17s649.png
vlcsnap-2023-11-23-15h48m24s845.png
vlcsnap-2023-11-23-15h48m35s957.png
vlcsnap-2023-11-23-15h48m44s050.png
vlcsnap-2023-11-23-15h48m58s520.png

Assemble the parts, and finally, the project is complete. It's tiny, measuring 5 cm by 3.5 cm, and fits snugly in my hands.


I'm thrilled with how it turned out, and I'm already thinking about more advanced versions in future videos. Don't forget to subscribe for updates. Also, I've designed a case for using it as a keychain – how cool is that?

Conclusion

Any questions? Drop them in the comments. Like the video if you enjoyed the process, and remember to subscribe for more exciting projects. Thanks for joining in, and I'll catch you in the next one!

Support me to creating more projects like this:

Paypal

Ko-Fi

Buy me a Coffee

Working Video and Tutorial

How i Made this Tiny Handheld Game with Arduino | Arduino Projects

I also made a video on it, check it out.