Flappy Bird on the Raspberry Pi

by 734937 in Circuits > Raspberry Pi

29 Views, 0 Favorites, 0 Comments

Flappy Bird on the Raspberry Pi

flapp.png
Schematic_Final_2025-01-27.png

This project guides you in creating Flappy Bird using a Raspberry Pi, Touch Sensor, LEDs, 4017 Chip (Decade Counter) and a 555 Timer. The Raspberry Pi uses code to control the bird in the game so you flap whenever you tap the Touch Sensor. It’s a fun and practical way to explore robotics, electronics, and programming. Follow the steps to assemble and test your game with ease.

Supplies

IMG_0313.jpeg
  1. Raspberry Pi(1) and SD Card(1) Pi SD Card
  2. HDMI Cord Amazon
  3. 4017 Chip (Decade Counter)(1) Link
  4. 555 Timer(1) Amazon
  5. 0.01uF Capacitor(1) Amazon
  6. 10uF Capacitor(1) Amazon
  7. Potentiometer(1) Amazon
  8. LEDs of any Colour(10) Amazon
  9. 560 Ohm Resistor(1) Amazon
  10. 10k Ohm Resistor(1) Amazon
  11. Breadboard(1) Amazon
  12. Touch Sensor(1) Amazon
  13. Female to Female Jumper Wires(3) and Male to Female Jumper Wires(2) Amazon
  14. Coiled Wire Amazon
  15. GPIO Extension Board(1) Link

Setting Up the Raspberry Pi

IMG_0284.jpeg

Set up your Raspberry Pi:

Locate the ports for the HDMI, Micro USB and USB ports.

For each port make sure you:

  1. Connect HDMI so your Raspberry Pi can connect to any Monitor
  2. Connect the Micro USB cable to the Raspberry Pi so it has power to work
  3. Connect a Keyboard and Mouse to the Raspberry Pi so you are able to interact with it
  4. After your Raspberry Pi is connected, connect the pins to your Breadboard with the Raspberry Pi Extension Board

Connect the Touch Sensor

GPIO_diagram.jpg
IMG_0286.jpeg

Connect the touch sensor as follows:

1) Connect the VCC pin on your Touch Sensor to the 3.3V pin on the Raspberry Pi

2) Connect the GND pin on your Touch Sensor to a ground pin on the Raspberry Pi

3) Connect the Sig pin on your Touch Sensor to the GPIO 17 pin on the Raspberry Pi

The Lights Component: Initial Steps

Lights1.png
IMG_0296.jpg

In order to have the light functionality, you will need to create the circuit which can be found on this TinkerCad on a Breadboard. First, place your Potentiometer, 4017 Chip (Decade Counter) and 555 Timer as shown in the image above. Then connect power and ground to the chips through the bottom rails as follows; giving the 4017 Chip (Decade Counter) direct power and ground. Then proceed to give the 555 Timer power through a 10K Ohm resistor with direct ground into the Discharge Pin. Make sure to also connect the bottom ground rail to the upper ground rail directly while connecting it to the upper power rail with a 560 Ohm resistor. Finally connect the Reset Pin to the power rail.

The Lights: Connections

Lights2.png
IMG_0301.jpeg

To create the connections necessary in order for the LED chaser portion of this project to function, make the following connections:

  1. Connect the Wiper Pin on the Potentiometer to the Trigger Pin on the 555 Timer and to one of the Terminal Pins to the Discharge Pin
  2. Connect the other Terminal Pin to the Discharge Pin on the 555 Timer
  3. Connect the Control Voltage Pin on the 555 Timer to the upper ground rail with the 0.01uF Capacitor
  4. Connect the 10uF Capacitor to the Trigger Pin and the power rail
  5. Connect the Trigger and Threshold Pins on the 555 Timer
  6. Connect the Reset and power pins on the 555 Timer
  7. Connect the Output Pin on the 555 Timer to the Clock Pin on the 4017 chip
  8. Connect the ground pin and the Clock Enable Pin on the 4017 chip
  9. Connect the Clock Enable Pin and the Reset Pin on the 4017 chip

The Lights: Final Steps and Putting It All Together

Lights4.png
IMG_0308.jpeg

To finish off the lights, connect the output pins to the LEDs, respectively with Output Pin 1 to the right most LED and so on so forth. After you connect your LEDs, connect your LED chaser circuit to the Raspberry Pi by connecting the power rail to the GPIO 27 pin, and the ground rail to a ground pin from the Raspberry Pi.

Final Steps

Instructable Flappy Bird

After you have assembled the circuit correctly, upload the code attached to your Raspberry Pi in order to make everything function together as intended. Feel free to mess aroudn with the variable valued to customize this game to your liking!

Downloads