Real-Life Dino Jump - Bringing the chrome Dino game to Life

Published Jan 22, 2025
 1 hours to build
 Beginner

Ever wondered what it would be like to control the Chrome Dino game with your own movements?

display image

Components Used

ESP32 WROOM
WiFi Development Tools - 802.11 ESP32 General Development Kit, embeds ESP32-WROOM-32E, 4MB flash.
1
MPU6050 Gyroscope and Accelerometer
MPU6050 (Gyroscope + Accelerometer + Temperature) is a combination of 3-axis Gyroscope, 3-axis Accelerometer and Temperature sensor with on-chip Digital Motion Processor (DMP). It is used in mobile devices, motion enabled games, 3D mice, Gesture (motion command) technology etc
1
Custom PCBs
1
Description

 Ever wondered what it would be like to control the Chrome Dino game with your own movements?

 

Have you ever played the Chrome Dino game and wished you could control the Dino with your own movements? Well, that's exactly what I've done in this project! By using an ESP32 microcontroller and an MPU6050 accelerometer, I've created a setup where jumping in real life makes the Dino jump in the game. Let's dive into the details of how you can recreate this fun and interactive experience.

Screenshot 2024-05-22 23:16:52.png

Setting Up the ESP32 and MPU6050

I have made a breakout board for the esp32 which has a dedicated spot for the mpu6050 for easy connection. Check this out

Screenshot 2024-05-22 23:13:42.png

Screenshot 2024-05-22 23:13:16.png

OR

Wiring the Components:

  • Connect the VCC of the MPU6050 to the 3.3V pin on the ESP32.
  • Connect the GND of the MPU6050 to the GND pin on the ESP32.
  • Connect the SCL of the MPU6050 to the SCL pin on the ESP32.
  • Connect the SDA of the MPU6050 to the SDA pin on the ESP32.

     

headersmpu.png

Installing the Required Libraries:

In your Arduino IDE, install the MPU6050 libraries. This uses Nimble more info - https://github.com/tenderlove/ESP32-NimBLE-Keyboard?tab=readme-ov-file

add features bleblog.png

addinglibrarybleblog.png

Coding the ESP32:

The ESP32 will use BLE to act as a keyboard. When the MPU6050 detects a jump, it will send a spacebar keypress to make the Dino jump.

remember to calibrate the jump detection. You can always use your serial monitor for help

Screenshot 2024-05-22 23:15:06.png

Testing the Setup

Upload the Code: Connect your ESP32 to your computer and upload the code using the Arduino IDE.

Pair with Your Computer: Once the code is uploaded, pair the ESP32 with your computer via Bluetooth. It should show up as a keyboard.

bluetotth connected.png

Open the Chrome Dino Game: Open Chrome and navigate to the Dino game by typing chrome://dino in the address bar.

Screenshot 2024-05-22 23:12:57.png

Jump and Play: Start the game and jump in real life. The MPU6050 will detect your jump and send a spacebar keypress to the game, making the Dino jump.

 

 

 

Wrap-Up and Future Ideas

This project is a fun way to blend physical activity with classic gaming. Not only does it make the Chrome Dino game more interactive, but it also introduces you to the basics of working with sensors and BLE communication using the ESP32.

For future improvements, you could:

Fine-tune the Jump Detection: Adjust the accelerometer threshold for more accurate jump detection.

Add More Movements: Incorporate additional gestures to control other aspects of the game, like ducking.

Codes
Comments
Ad