We've all been there, stuck with no internet and endlessly hopping over cacti as the Chrome Dino. As someone who loves both retro games and microcontrollers, I thought: Why not bring this game to the real world using an Arduino?
This project is my attempt to recreate the beloved Chrome Dino Game on a tiny screen using an Arduino Pro Mini and a 0.96" SSD1306 OLED display.
It's a simple, fun, and addictive game you can carry in your pocket! You can play it anytime anywhere. I've been playing it on the bus as I commute, when my code is compiling, or when I am bored. It's a fun way to keep you away from doom scrolling on TikTok or through Instagram reels.
This project is inspired by and based on the awesome work from AlexIII's T-Rex Duino repository. A big shoutout to him. I’ve made a few modifications to suit my hardware setup and fix the issues of the game not running on SSD1306 OLED Display
What You'll BuildA tiny, standalone version of the Chrome Dino Game that runs on an Arduino Pro Mini and displays everything on a small OLED screen. The Dino jumps over obstacles with a button press—just like the real one
Hardware Used- Arduino Pro Mini (3.3V, 8MHz)
- SSD1306 128x64 OLED Display (I2C)
- USB to UART Driver (FTDI or any available driver)
- Two Push Buttons (for jumping and ducking)
- Breadboard and jumper wires
- Optional: 3.7V LiPo battery or USB-to-Serial for powering the board
- Scrolling ground and obstacles
- Jumping Dino animation
- Collision detection
- Score counter
- Game over screen
Connecting the FTDI for Programming
- FTDI 3V3 → 3V3
- FTDI GND → GND
- FTDI TX → RX
- FTDI RXX → TX
- FTDI DTR → DTR
You can alternatively Use your Arduino Uno to program the Arduino Pro Mini
Connecting the OLED
- OLED VCC → VCC (Arduino)
- OLED GND → GND
- OLED SCL → A5
- OLED SDA → A4
Connecting the buttons for Control
- Jump Button → D6
- Duck Button → D7
Here’s how to download, set up, and run the game on your Arduino:
1.Download the Base Code
Head over to Chrome Dino Game on Arduino and OLED repository and click the green Code button > Download ZIP.
2. Extract the Code
Unzip the downloaded folder. You’ll find an.ino file along with supporting assets.
Open in Arduino IDE
- Launch the Arduino IDE.
- Go to File > Open and select the.ino file from the extracted folder.
Select Your Board and Port
- In the menu bar, go to Tools > Board and choose Arduino Nano (We are using pro mini but selecting as nano works perfectly)
- Under Processor, select ATmega328P (3V, 8 MHz) (or match your board specs).
- Go to Tools > Port and choose the correct COM port (usually appears after plugging in your board via USB).
Install Required Libraries
Make sure you have the following libraries installed via the Library Manager:
- Adafruit SSD1306
- Adafruit GFX
- Tip: Go toSketch > Include Library > Manage Libraries, then search and install each.
Upload the Code
- Click the Upload button (right arrow icon).
- Wait for it to compile and upload—once complete, the game should start running on your OLED display.
Optional: Customize
This is where you can modify the original code to add:
- Extra lives
- Hearts UI
- Day/night mode
- Ducking mechanic
/* Game Balance Settings */
#define PLAYER_SAFE_ZONE_WIDTH 32 //minimum distance between obstacles (px)
#define CACTI_RESPAWN_RATE 50 //lower -> more frequent, max 255
#define GROUND_CACTI_SCROLL_SPEED 3 //pixels per game cycle
#define PTERODACTY_SPEED 5 //pixels per game cycle
#define PTERODACTY_RESPAWN_RATE 255 //lower -> more frequent, max 255
#define INCREASE_FPS_EVERY_N_SCORE_POINTS 256 //better to be power of 2
#define LIVES_START 3
#define LIVES_MAX 5
#define SPAWN_NEW_LIVE_MIN_CYCLES 800
#define DAY_NIGHT_SWITCH_CYCLES 1024 //better to be power of 2
#define TARGET_FPS_START 23
#define TARGET_FPS_MAX 48 //gradually increase FPS to that value to make the game faster and harder
How It WorksThe game runs in a continuous loop that updates the display frame by frame. When the player presses the button, the Dino jumps by changing its vertical position based on basic physics. Obstacles like cacti appear from the right and move left across the screen. You start with three lives, and colliding with an obstacle costs one. Once all lives are lost, it’s game over. However, you can earn extra lives during gameplay—represented by hearts shown in the top-right corner. Depending on the type of obstacle, the Dino can either jump or duck to avoid it. The game features dynamic transitions between day and night, adding to the challenge as the screen darkens over time. A score counter keeps climbing the longer you survive.
Demo
As you can already see from the demo, I already made a compact portable device which is battery powered and rechargeable. The next step is to design a custom PCB for it and a 3D printed enclosure to make it neat.
I also plan to add several games to the device. Making it a complete gaming console that you can play several games from it at any given time.
Links & ResourcesLike this project?Give it a thumbs up, follow me for more fun projects, and drop a comment if you build your own version, I’d love to see it!
Feel free to reach out if you face any challenges trying to replicate the project :)
Comments