Introduction: Automatic Google T Rex Game Controller Using Arduino
lets build it
Step 1: Some Intro
all off you know about the t rex aka dino game of google and it famous as no internet game.
the game is very simple just avoid the obstacles by jumping and its like super Mario run.usually to jump we use space bar manually.that's very old school for me...
so in this tutorial, I am going to show you how to make that in automatic that is an automatic controller.
please watch the making video for more details
Step 2: Working Priciple
the senor
here we want to detect the obstacle and jump to detect the obstacle I am using an LDR
so how an LDR detect that kind of obstacle?
the resistance of LDR changes according to light that is when the dark time the LDR resistance is very high and vice-versa. so our obstacle is dark in colour so we can get different analog values . with that value with the help of a controller we trigger a servo.
servo is used to press the space bar. so that's the working principle
Step 3: Components Needed
Step 4: Circuit Diagram and Connections
please watch the video
first, connect VCC of the servo to 5v and ground to ground
then I connected PWM pin to Arduino pin 9
connect LDR to pin a0
Step 5: Code
I am using the analog read function of Arduino and I give conditions for servo triggers
Step 6: Happy Making
please watch the video .if you have any doubt please comment it below
Step 7: Limitations &updations
As i said in video it has limitations
1.arduino fails to trigger down the dino when that bird comes.
Solution
Adding a ldr in the top side will detect the bird with that trigger we can control another servo(back button)
2.fails when speed increases
3.fails when colour changes (colour Inversion)
Solution
We can solve this by adding more sensors and some complex coding

Participated in the
Arduino Contest 2020
5 Comments
2 years ago
awsem project!
but can it jump over birds? I think the sensor is too low to detect both low and high things. maby you can use 2 sensors? I think this solution is very easy to implement.
again, very good project. Maybe the second version will be able to get to the end of the game...
2 years ago
nice.....
2 years ago
this is interesting idea
2 years ago
Nice. What is the highest score it score
Reply 2 years ago
Did you watch my video.it has limitations like when hat bird come arduino fails to control the dino but we can solve that problem. I said everything in that please watch and subscribe