Introduction: Chrome T-rex Game Hack Using Arduino
In this tutorial we will hack chrome t-rex game with arduino
We need following components for this project
Arduino UNO -X1
Servo motor -X1
Resistor 10K ohm -X1
jumper cables and wires -X1
Step 1: Determine the LDR Value
• 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'
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.
Step 2: Adding Servo
• Now stick servo motor on keyboard
• Make the connection shown in above circuit diagram.
• Now upload the ' chrome dino game.ino ' in arduino board
Step 3: Finding the Right Position for LDR
• 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
Step 4: Stick Ldr on Screen
• After finding the correct position for LDR stick the ldr on the screen
• Now run this.
Step 5: 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.