An Arduino game controller system using Arduino and the p5.js library.
This project creates an easily replicated and expandable Arduino controller system for building custom game controllers. The controller connections are designed to utilize various sensors and inputs that can be interchanged depending on each controller's purpose.
Key Features:
- Modular controller design supporting 2 controllers with up to 3 analog and 5 digital inputs each
- Compatible with Arduino Uno, Leonardo, and SparkFun RedBoard
- Uses p5.js and p5.play libraries for easy game development
- 3D printable enclosures included
- Perfect for learning hardware and software development
arduinocontrollers/
├── 3D/ # 3D printable enclosure files (.stl, .3dm)
├── Arduino/ # Arduino sketches for controllers
│ ├── _3ana5digi/ # 3 analog, 5 digital input sketch
│ └── _5ana10digi/ # Full 5 analog, 10 digital input sketch
├── p5workspace/ # p5.js game examples and libraries
│ ├── libraries/ # p5.js, p5.play, p5.serialport
│ ├── shootinggame/ # Tank shooter game example
│ └── ... # Various game demos
├── processing/ # Processing sketches for prototyping
└── Web/ # Web deployment files
- Hardware Setup: Build your controller using the shield and perf board design
- Upload Arduino Code: Flash the
_5ana10digi.inosketch to your Arduino - Install Dependencies: Download p5.serialcontrol and Node.js
- Run a Game: Open one of the HTML files in a browser with a local server
For detailed instructions, see GETTING_STARTED.md.
Tools:
- Soldering Iron & Solder
- Wire Strippers
- Side cutters & Pliers
Components:
- Arduino compatible board (Uno, Leonardo, or RedBoard)
- Perf Board (8cm x 6cm green perf boards or Arduino Uno shield)
- Sensors: Joysticks, Buttons (with 10k ohm resistors), Potentiometers, etc.
- Wire: 26 AWG Solid, Ribbon cable with crimps
- Break Away Headers (20+)
Optional:
- 3D printed enclosures (files in
/3Dfolder) - M2.5 screws for mounting
- Arduino IDE
- p5.serialcontrol
- Node.js
- A modern web browser
| Controller | Analog Inputs | Digital Inputs |
|---|---|---|
| Controller 1 | A0, A1, A2 | D2, D3, D4, D5, D6 |
| Controller 2 | A3, A4, A5 | D7, D8, D9, D10, D11 |
Ribbon Cable Color Code:
- Red: 5V Power
- Brown: Ground
- Orange: Analog 0/3 (Horizontal)
- Yellow: Analog 1/4 (Vertical)
- Green: Analog 2/5
- Blue: Digital 2/7
- Purple: Digital 3/8 (Menu button)
- Grey: Digital 4/9
- White: Digital 5/10
- Black: Digital 6/11
- Pong Demo (
pongdemo.js) - Classic pong using potentiometers - Tank Shooter (
shootinggame/) - 1v1 tank battle game - Pipe Game (
pipes.js) - Flappy bird style game - Running Game (
running.js) - Side-scrolling runner
This project is open source. Feel free to modify and share!
Created by andychuong


