Project tutorial
Arduino Gyroscope Game with MPU-6050

Arduino Gyroscope Game with MPU-6050 © GPL3+

An addictive Arduino game on a 128x64 OLED display.

  • 1,992 views
  • 0 comments
  • 11 respects

Components and supplies

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

The following elements are needed to make this project:

  • Arduino Nano
  • GY-521 module with the MPU-6050 sensor
  • 0.96" OLED SPI display module 128x64 with SSD1306 chip
  • Buzzer
  • 3mm LED diode
  • 220 Ohm resistor

The rules of the game are simple: Tilt the sensor to move the ball around and try to catch as many squares as possible within 1 minute, without touch the borders.

Sketch below includes 2 functions: the game, if D7 is connected to GND; and a basic gyro test program that shows the pitch and roll values, shows them in an XY grid, and changes the buzzer pitch according to distance from origin.

For the OLED is used the excellent U8G library which allows many fonts and fast graphics. You will need to include 2 files in your sketch folder I2C and Kalman.h, they come with the MPU-6050 example.

The scheme is presented in the picture below. Detailed instructions can be found on the author's website cassiopeia.hk.

Finally, the whole assembly is placed in a box made of 3mm PVC material.

Code

codeArduino
No preview (download only).

Schematics

schematic
Untitled sketch bb ezhm5etfng

Comments

Similar projects you might like

Arduino Pocket Game Console + A-Maze - Maze Game

Project tutorial by Alojz Jakob

  • 8,179 views
  • 8 comments
  • 23 respects

LED Roulette Game

Project tutorial by Arduino “having11” Guy

  • 10,116 views
  • 4 comments
  • 24 respects

Arduino Pong Game on 24x16 Matrix with MAX7219

Project tutorial by Mirko Pavleski

  • 2,419 views
  • 3 comments
  • 17 respects

Arduino Game

Project tutorial by RoboCircuits

  • 1,726 views
  • 0 comments
  • 9 respects

Breadboard to PCB Part 1 - Making the Simon Says Game

Project tutorial by Katie Kristoff and Monica Houston

  • 7,179 views
  • 11 comments
  • 27 respects

Pixel Chaser Game

Project tutorial by Unexpected Maker

  • 3,519 views
  • 2 comments
  • 24 respects
Add projectSign up / Login