Flappy Bird
Building and coding an electromechanical version of Flappy Bird
Building and coding an electromechanical version of Flappy Bird
TIMELINE
November 2023 (3 weeks)
ROLE
A solo project for Electronics & Controls course.
SKILLS & TOOLS
H-bridge Motor Control
Electronics & Microcontrollers
Python
Woodworking
Laser Cutting
CAD Modeling & 3D Printing
DELIVERABLE
+ An electromechanical game that requires user input, use of a KB2040 microcontroller, and a motor-driven part
Final Project Design
Flappy Bird Inspiration Mobile Game
OVERVIEW
The goal of this project was to design an electromechanical game that requires user input, use of a KB2040 microcontroller, and a motor-driven part. I chose to make an electromechanical version of flappy bird, which is originally a mobile game.
STAGE 1: IDEATION & PLANNING
I began by drawing out and considering how each component would be built and engage with the other components.
6 major components were identified:
Conveyor belt of pipes
Moving bird mechanism
User interaction buttons
Hall Effect Sensor to detect game over
Breadboard Circuit with H-Bridge
Python Code for the KB2040
STAGE 2: CONSTRUCTION
First, I built a test mock-up of the conveyor belt powered by a DC gearmotor and tested that a paper belt could be rotated around PVC pipes wrapped with rubber bands.
Then, I laser cut a rack and pinion gear set and cut a 3.5 mm groove using the table saw as a track for the rack to slide in. The pinion was mounted on the shaft of a DC gearmotor controlled by an H-bridge so that it could move the rack in two directions. I also wired two buttons, start and jump, to the KB2040.
Breadboard with H-Bridge and KB2040
Python Code
I constructed a wood frame for the conveyor belt to be mounted vertically in and then attached the rack and pinion component and user interaction buttons to the front. The breadboard was mounted on the back side of the frame, behind the conveyor belt.
Finally, I added the game over detection system. I wired a Hall Effect Sensor, which detects magnetic fields, and mounted it behind the bird. On the conveyor belt, I placed magnetic pipes that would serve as obstacles for the player.
Low-Fidelity Prototype
CHALLENGES
Friction
The amount of friction on the conveyor belt would sometimes be too much for the driving motor to overcome. The conveyor belt moves pretty fast, and so pulse width modulation is used to slow it down to speed that users can keep up with. I give a few seconds of high power initially to get the motor going. However, the friction was so high that even at full power the motor couldn't overcome it and would stall. In the future, I would develop a lower friction method for mounting the PVC pipes, so that they can spin easily and the motor has little friction working against it.
Magnetic Sensing
It was challenging to get the Hall Effect Sensor to sense the magnets on the conveyor belt and stop the game. The original magnets I used emitted too weak of a magnetic field for the sensor to pick up. So, I attached stronger neodymium magnets, which the sensor easily picked up.
FINAL PROTOTYPE
User Playing Flappy Bird at Project Showcase
Arcadia Ohnemus arcadia.ohnemus@gmail.com LinkedIn