A touchless, Arduino-based system for controlling your computer using hand gestures—ideal for games, media, and accessibility.
- Overview
- Features
- Demo
- Hardware Requirements
- Circuit & Connections
- Installation
- Usage
- Gesture Reference
- Troubleshooting
- License
This project presents a hand gesture-controlled computer system using an Arduino Uno, two HC-SR04 ultrasonic sensors, and one PIR motion sensor. The system enables touch-free interactions by interpreting specific hand movements and motions as control commands.
- Ultrasonic sensors measure hand distances to trigger gestures for scrolling and media navigation (forward/backward).
- PIR sensor detects motion for play/pause functionality.
- The Arduino processes sensor data and communicates with a Python script via serial communication.
- The Python script (using PyAutoGUI) simulates keystrokes to control system functions.
This cost-effective solution enables intuitive human-computer interaction with applications in accessibility, smart environments, and touchless computing.
- 🎮 Control games (e.g., Subway Surfers) with arrow key gestures
- 🎵 Play/pause, next, and previous media tracks
- 📜 Scroll through web pages and documents
- 👋 Activate play/pause with motion detection
- 💻 Works on Windows, Mac, and Linux
WhatsApp.Video.2025-05-26.at.20.54.57_99b9ef75.mp4
WhatsApp.Video.2025-05-26.at.20.55.18_14b5ec57.mp4
- Arduino Uno ×1
- HC-SR04 Ultrasonic Sensor ×2
- PIR Motion Sensor ×1
- Breadboard & jumper wires
- USB cable for Arduino
Ultrasonic Sensor 1 (Left):
- VCC → 5V (Arduino)
- GND → GND
- Trig → Pin 6
- Echo → Pin 7
Ultrasonic Sensor 2 (Right):
- VCC → 5V
- GND → GND
- Trig → Pin 8
- Echo → Pin 9
PIR Motion Sensor:
- VCC → 5V
- GND → GND
- OUT → Pin 10
- Assemble the sensors and connect them to the Arduino as shown above.
- Upload the provided Arduino code to your Uno using the Arduino IDE.
- Install Python 3.7 or later.
- Install required packages:
pip install pyserial pyautogui
- Edit
gesture_controller.pyto set the correct COM port for your Arduino. - Run the script:
python gesture_controller.py
- Place your hands in front of the sensors as per the gesture table below.
- The system will detect gestures and trigger the corresponding computer actions.
| Gesture | Action | Distance Range |
|---|---|---|
| Both hands close | Scroll Down | ≤ 20cm both sensors |
| Both hands medium | Scroll Up | 20–50cm both sensors |
| Left hand close | Previous/Back | Left ≤ 10cm, Right ≥ 30cm |
| Right hand close | Next/Forward | Right ≤ 10cm, Left ≥ 30cm |
| Motion detection | Play/Pause | PIR sensor activation |
- No response?
Check your COM port and wiring. - Gestures not detected?
Ensure sensors are powered and unobstructed. - Python errors?
Confirm all dependencies are installed and permissions are set. To help users find the correct port for their Arduino, add a clear instruction section in your README. Here’s a concise statement you can include:
Finding Your Arduino Port
Before running the Python script, make sure to check and update the serial port (COM port on Windows or /dev/tty* on Mac/Linux) in your script.
-
Windows:
- Open the Arduino IDE.
- Go to Tools > Port.
- Note the port labeled with your Arduino board, e.g.,
COM3 (Arduino Uno)[2][4][6]. - Alternatively, open Device Manager and look under Ports (COM & LPT) for the Arduino port[4][6].
-
Mac/Linux:
- Open the Arduino IDE and check Tools > Port for a port like
/dev/cu.usbmodemXXXX[2][4]. - Or, open Terminal and run:
Look for a device such as
ls /dev/tty*/dev/ttyACM0or/dev/ttyUSB0[4].
- Open the Arduino IDE and check Tools > Port for a port like
Update this port in your Python script:
ArduinoSerial = serial.Serial('COM3', 9600) # Replace 'COM3' with your actual portMIT License
