arcade Basketball game
An arcade influenced basketball game, developed using Microcontrollers and IOTs.
Demonstration
Overview
Introduction
Objectives
Components (hardware)
Arduino UNO
Digital pins
Eg:- Controlling and LED
Analog pins

Eg:- Converting the readings of a light sensor
Components (hardware)
Infrared (IR) sensors

Transmitter (TX)
Receiver (RX)
Components (Software)
Arduino IDE

Void setup()
Eg: Setting up digital pins
Void loop()
Eg: Main logic, like listening to IR sensor readings etc...
Components (Software)
Communication protocols
Used to bridge the communication gap between the Arduino and the web Interface in real time with efficacy
Web Sockets
Serial port
Project design (hardware implementation)
Arduino UNO
For the purposes of this project, the Arduino is connected through the USB and is powered by the computer itself.

USB connection
Project design (hardware implementation)
Infrared (IR) sensor

The infrared sensor has 3 terminals, used in detecting
the ball
IR sensor
Powers the IR sensor with a max voltage of 5v
This terminal sends either a HIGH(5v) or LOW (0v) signal to the Arduino, and is connected to one of the digital pins.
This terminal is connected to the ground pin in the Arduino for safety purposes
Project design (hardware implementation)
2 pin Switch

The 2 pin switch has two terminals, and is used to start the game upon pressing it.
As usual, it connected to the ground pin for safety reasons
This terminal is connected to one of the digital pins in the Arduino
Project design (Software architecture)
Developing a game Interface on the web (client 1)
Initial steps for the project’s software architecture entails designing a web interface to display the scores, highscores, change timers, etc..
Program the Arduino to detect IR sensor readings and switch presses (client 2)
Since all the hardware components are connected (IR sensor , switch), we program the Arduino to detect the IR sensor readings and also the switch presses.
Create a backend server with Node js using Webscokets and serial port
Here, we create a backend server with Websockets using Node.js that sits in between the web Interface (Client 1) and the Arduino (Client 2) to facilitate full-duplex communication between the two.
Project design (Software architecture)
Frontend (client 1)
Arduino connection to the backend using serial port
USB Conn
Game interface connection to the backend using Websockets
Server running on the laptop
(HOST)
Arduino (client 2)

Project design (Software architecture)
Abstract game logic
An abstracted Macro level implementation of the core game logics
**This is explained under the presumption that every component is working as expected
IF switch is pressed, send “S” to the computer ELSE do nothing
Arduino (switch)
Arduino (IR sensor )
IF Object is detected send “1” to the computer ELSE IF no object is detected send “0”
Backend server (HOST)
IF Client 1 is connected, read data from Client 2 and send it to Client 1
ELSE wait for client 1 to connect
Frontend (Game Client)
IF data received from HOST contains “S”, start the game ELSE do Nothing
IF data received from HOST contains “1” & gameHasStarted, then increment the score by +2 Else do Nothing
Features
Game features
UI design
Future potentials
Project upscaling
Commercial use