Chrome T-rex Game Hack Using Arduino

by Shoeb ALI in Circuits > Arduino

2974 Views, 2 Favorites, 0 Comments

Chrome T-rex Game Hack Using Arduino

PicsArt_12-27-06.33.21.jpg
In this tutorial we will hack chrome t-rex game with arduino

Supplies

We need following components for this project
Arduino UNO -X1
Breadboard X1
Servo motor -X1
LDR -X1
Resistor 10K ohm -X1
jumper cables and wires -X1

Determine the LDR Value

LDR serial monitor test.png
Screenshot_2020-12-28-10-44-04-40.png
IMG_20201228_095051.jpg
• First of all you have to find the LDR value in which you want to jump your t-rex
• for that make connection according to circuit diagram.
Arduino (5V) - LDR(terminal 1)
Arduino (A0) - LDR(terminal 2)
Arduino (GND) - Resistor- LDR(terminal 2)

• Now download ' ldr test .ino ' file given below
• open this code in arduino IDE and upload it in your arduino board.
• now open chrome browser
• and also open arduino serial monitor
• Now place the LDR on the obstacle area on the screen ( see image above)
• note down the reading when you place the LDR on 'obstacle area '
• And also note down the reading when you place the LDR on 'no obstacle area'
• now you have to find the maximum value when you place the LDR on 'obstacle area'

Example :

Suppose when I place LDR on 'obstacle' then serial monitor show it's value below than 500 .
And similarly when I place it on no obstacle area then it show value above 600.
So my Threshold value ( below this I want to to jump t Rex) is 500
But here I assume threshold value 510 ( i have add +10 in my Threshold value for more accuracy)
So whenever the ldr detect obstacle then ,the value of ldr is always lower than threshold value (510) so it will jump our t-rex.

Downloads

Adding Servo

LDR serial monitor with servo_bb.png
Screenshot_2020-12-28-09-44-15-90_4aed3257f278fcf7bfa3abd644e23333.png
Screenshot_2020-12-28-09-44-34-97_4aed3257f278fcf7bfa3abd644e23333.png
Screenshot_2020-12-28-09-44-57-86_4aed3257f278fcf7bfa3abd644e23333.png
• Now stick servo motor on keyboard
• Make the connection shown in above circuit diagram.
• Now upload the ' chrome dino game.ino ' in arduino board

Finding the Right Position for LDR

IMG_20201228_095051.jpg
• Now before stick the LDR on screen you have to find it's correct position to stick.
• For that you have to hold in front of screen (see the image above) and see that your servo motor should push the button on right time when obstacle comes
• If T-rex jump too much early when obstacle comes then hold ldr forward
• and if T-rex jump too much late when obstacle comes then hold ldr backword

Stick Ldr on Screen

IMG_20201228_095032.jpg
• After finding the correct position for LDR stick the ldr on the screen
• Now run this.

Troubleshoot

• If your project run successfully on first time butd oesn't work after sometime then you need to check the threshold value , for that i also write serial functions in ' chrome dino game.ino ' , so find that what your serial monitor gives you the Ldr value when you put the ldr on obstacle ,
Now i suggest you to instead of changing the threshold value from the program you have to change your display brightness and set it to that point at which your serial monitor gives you values lower than threshold value when you place the LDR on obstacle.