|
Arduino Nano R3 |
x 1 | |
|
6 DOF Sensor - MPU6050 |
x 1 | |
|
8x32 Led Matrix Module MAX7219 |
x 1 | |
![]() |
SD1209T3-A1TDK Corporation
|
x 1 | |
![]() |
G3B25AB-S-YANKK Switches
|
x 1 | |
|
Resistor, 56 ohm |
x 1 |
![]() |
Soldering Iron Wire Welding Lead Roll |
|
![]() |
Soldering iron |
Arduino MPU6050 Interactive scrolling game on 32x8 Led Matrix
This time I will show you how to make an interesting interactive game, on a 32 by 8 LED matrix, which is controlled by moving the device. During a certain movement of the device, the MPU6050 sensor sends a signal to the microcontroller, and based on that information, the microcontroller performs a given action on the screen.
In fact, the sensor represents a so-called air controller that we can find as part of remote controls for modern TVs. The project is featured on Benjamin Balogh's GiHub page (https://github.com/benibalogh/LEDMatrix-Games), where you can find the original code. The source code is made in Visual Studio with support for Arduino, known as Visual Micro.
Unfortunately, after compiling and uploading the original code to the Arduino, the device did not process data from MPU6050, and only scrolled the text "Wall Scroller". I tried to contact the author several times, but without success. After certain time of studying the code, with one small modification, I managed to adapt it. Also, instead of Visual Micro, I compiled it into a standard Arduino IDE.
To compile the code without errors, you should open the code from the given folder that contains all the required libraries. Let me emphasize that if you have previously installed any of these libraries in the Arduino IDE, you should delete them. I also added some simple tones to the code that don't interfere with gameplay and make the game much more interesting.
The device is extremely simple to build and consists of only few components:
- Arduino nano microcontroller
- MPU6050 Gyroscope + Accelerometer sensor module
- Buzzer
- 32x8 Led matrix module with MAX7219 drivers
- Battery, optionally like in my case one 3.7 Volts Lithium battery with charger, and boost module. Of cource you can use ordinary 9V battery, or external Power Supply.
- and two switches
if you want to make a PCB for this project, or for any other electronic project, PCBway is a great choice for you. PCBway is one of the most experienced PCB manufacturing company in China in field of PCB prototype and fabrication. They have a large online community where you can find a Open Source projects, and you can also share your project there. From my personal experience I can tell you that on this community you can find many useful projects with alredy designed PCBs, from where you can place an order directly.
After uploading the code, we need to make some settings. Depending on the mounting position of the sensor, we need to perform a calibration by changing the values in the following lines of code
constexpr float INIT_PITCH = radians(175.0f);
constexpr float MENU_BACK_ROLL = radians(-90.0f);
constexpr float MENU_ENTER_ROLL = radians(-155.0f)
constexpr auto TILT_ANGLE = 145;
constexpr float MENU_NAVIGATION_PITCH = radians(TILT_ANGLE + 30);
Angles can have positive and negative values
Immediately after switching on, a scrolling text with the name of the game appears. By tilting to the left we move through the menu. To activate an option, we tilt the device down. We return to the menu by tilting the device upwards. To start playing the game, when we are in the PLAY menu, we tilt the device down and then to the left. Now we play the game by moving left and right, trying not to hit the wall. With each passed segment, a certain number of points are obtained. After a certain time, the movement speed increases. When we collide into the wall, the end of the game is signaled and the result appears. By tilting up, we return to the main menu again.
Let me mention that the power supply is made with a 3.7V Lithium battery, a charger board for charging the battery, and a boost module that raises the voltage from 3.7V to 5V. The schematic diagram for the power supply is given in the figure below.
Finally, the device is installed in a suitable case made of PVC board and covered with colored wallpaper.

Arduino MPU6050 Interactive scrolling game on 32x8 Led Matrix
- Comments(0)
- Likes(0)

- 0 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
More by Mirko Pavleski
-
DIY simple HUNTER Led Game with Arduino Some time ago I presented you a simple to make, but interesting game, a 1D version simulation of "P...
-
XHDATA D-109WB Radio Short Review with complete disassembly Recently I received a shipment of a radio from the brand XHDATA model: D-109WB, so I immediately de...
-
Arduino Rotary encoder combination lock (Arduino door lock system with Rotary Encoder) Rotary dial safes typically use a mechanical combination lock. They are valued for their simplicity...
-
DIY DRSSTC Music Tesla coil with Interrupter using cheap Driver Module DRSSTC (Dual resonant solid state tesla coil) is a type of Tesla coil that uses solid-state compone...
-
Arduino HPDL1414 Retro Clock with Set and Alarm Functions The HPDL-1414 is a 16-segment LED display with four printable fields that is over twenty years old....
-
How to turn a 7 inch Elecrow pi terminal into a standalone SDR Radio Today I received the Pi Terminal-7” IPS HMI CM4 Panel All-In-One Module Raspberry Pi Computer from E...
-
Arduino 3D Printed self Balancing Cube Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
Simple GU50 VTTC Tesla Coil with MOT (25+cm Spark) Vacuum Tube Tesla Coils are a common choice for homebuilders for several practical reasons. At Soli...
-
Hourglass ESP8266 Code A hourglass, also known as an sand clock, is a device used to measure the passage of time. It consi...
-
Tug of War Arduino Game on WS2812 Led strip A Tug of War is a classic team-based game where two opposing teams compete to pull a rope in opposi...
-
DIY ESP32 Bioresonance Rife Machine with ZAPPER function Rife machine therapy is an alternative treatment developed by Dr. Royal Raymond Rife in the 1930s. H...
-
Arduino VFO Project with a Large LCD Display A Variable Frequency Oscillator (VFO) is an electronic oscillator whose output frequency can be adj...
-
Exploring the Tesla Coil Driver Board, Full Review & Test Results Some time ago I presented you a video in which I analyzed a super cheap Tesla Coil driver that cost...
-
Arduino Eatrthquake alarm and protection system with D7S seismic Sensor Earthquakes are extremely common events around the world. On average, there are fifty earthquakes a...
-
Review and Comparison of Three Inexpensive Metal Detector Kits A metal detector is a device used to detect the presence of metal objects in the ground or other ma...
-
How to make simple Arduino RGB Led strip VU Meter VU meter or volume unit meter is a device intended for visual presentation of the audio signal. It ...
-
DIY Simple Antistress and Relaxation PEMF Device based on Schumannn resonance frequency 7.83 Hz Schumann resonances are global electromagnetic resonances, generated by lightning discharges in the...
-
DIY Si4825 A10 multiband Radio (MW,SW,FM) Thanks to the production of specialized radio chips, nowadays it is possible to make a quality mult...
-
DIY simple HUNTER Led Game with Arduino Some time ago I presented you a simple to make, but interesting game, a 1D version simulation of "P...
-
XHDATA D-109WB Radio Short Review with complete disassembly Recently I received a shipment of a radio from the brand XHDATA model: D-109WB, so I immediately de...
-
Arduino Rotary encoder combination lock (Arduino door lock system with Rotary Encoder) Rotary dial safes typically use a mechanical combination lock. They are valued for their simplicity...
-
DIY DRSSTC Music Tesla coil with Interrupter using cheap Driver Module DRSSTC (Dual resonant solid state tesla coil) is a type of Tesla coil that uses solid-state compone...
-
Arduino HPDL1414 Retro Clock with Set and Alarm Functions The HPDL-1414 is a 16-segment LED display with four printable fields that is over twenty years old....
-
How to turn a 7 inch Elecrow pi terminal into a standalone SDR Radio Today I received the Pi Terminal-7” IPS HMI CM4 Panel All-In-One Module Raspberry Pi Computer from E...
-
Arduino 3D Printed self Balancing Cube Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
Simple GU50 VTTC Tesla Coil with MOT (25+cm Spark) Vacuum Tube Tesla Coils are a common choice for homebuilders for several practical reasons. At Soli...
-
Hourglass ESP8266 Code A hourglass, also known as an sand clock, is a device used to measure the passage of time. It consi...
-
Tug of War Arduino Game on WS2812 Led strip A Tug of War is a classic team-based game where two opposing teams compete to pull a rope in opposi...
-
DIY ESP32 Bioresonance Rife Machine with ZAPPER function Rife machine therapy is an alternative treatment developed by Dr. Royal Raymond Rife in the 1930s. H...
-
Arduino VFO Project with a Large LCD Display A Variable Frequency Oscillator (VFO) is an electronic oscillator whose output frequency can be adj...
-
-
Instrumentation Input, high impedance with 16 bit 1MSPS ADC for SPI
269 0 0 -
RGB LED Matrix input module for the Framework Laptop 16
453 0 2 -
-
📦 StackBox: Modular MDF Storage Solution 📦
282 0 2 -
-