2026ElectronicsControls
Dinosaur Game Bot
An Arduino-based bot that watches Chrome's offline dino game through a photoresistor and taps the spacebar in real time to jump obstacles.
Arduino IDEC++Circuit Design
Role
Solo build, circuit design, wiring, and firmware
Goal
Build an Arduino-based device that automatically plays Chrome's offline dinosaur game by detecting obstacles optically and triggering a spacebar press in real time, inspired by a similar build seen on Instagram Reels.
Challenge
A fixed-timing photoresistor trigger reacted correctly at the game's max speed but jumped too early during the first roughly 2 minutes of a run, since the dino game accelerates continuously from 360 px/s to 780 px/s and a static reaction time doesn't account for that.
Solution
The device uses an Arduino Mega 2560 reading a photoresistor and 10k ohm resistor wired as a voltage divider on analog pin A0, taped to the screen roughly 20 to 30mm ahead of the dino, with an SG90 servo on digital pin 9 pressing the spacebar whenever the voltage drops below a 3.5V threshold. To fix the early-game timing issue, Chromium's actual game constants (SPEED: 6, ACCELERATION: 0.001, MAX_SPEED: 13 px/frame at 60fps) were pulled from source and used to build a speed-scaled delay function that estimates current game speed from elapsed time since reset, then adds proportionally more reaction delay when the game is running slower.
Results
- Reacts correctly across the full 360 to 780 px/s game speed range using one continuous delay formula instead of a fixed reaction time.
- Only two constants need physical calibration: a 3.5V detection threshold and a delay coefficient tuned at low game speed.
- Reinforced how timing-critical automation needs to model real system dynamics, in this case pulling actual acceleration constants from the game's own source code, instead of relying on a single fixed reaction time.

