Play invisible guitar strings in mid-air using motion sensors and real-time audio synthesis.
Air Guitar is an IoT + audio signal processing project that lets you play a virtual guitar using hand movements. It uses an MPU6050 accelerometer/gyroscope connected to an Arduino, which sends motion data to a Python audio engine. The Python program synthesizes realistic guitar sounds using the Karplus-Strong algorithm.
Move your wrist left or right to change notes and strum by shaking your hand to produce sound — just like playing a real guitar in the air.
- 🎸 Six virtual guitar strings (Open E tuning)
- 🖐️ Gesture-based note selection
- 💥 Strum detection using accelerometer force
- 🔊 Real-time sound synthesis
- ⚡ Low latency audio playback
- 🧠 Physics-based sound generation (Karplus-Strong)
- 🛠️ Easy hardware setup
- 📈 Calibration routine for accuracy
- Arduino Uno
- MPU6050 Accelerometer + Gyroscope
- Python
- Arduino C++
- NumPy
- SoundDevice
- PySerial
| Component | Quantity |
|---|---|
| Arduino Uno | 1 |
| MPU6050 Sensor | 1 |
| Jumper wires | 4 |
| USB cable | 1 |
| Computer/Laptop | 1 |
| MPU6050 Pin | Arduino Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| SCL | A5 |
| SDA | A4 |
Air_Guitar/
│
├── Air_Guitar.py # Main Python audio engine
├── Ardunio_Code.ino # Arduino sensor code
├── README.md
└── requirements.txt
1️⃣ MPU6050 detects wrist movement and acceleration 2️⃣ Arduino reads sensor data via I2C 3️⃣ Arduino sends motion data to computer via Serial 4️⃣ Python script reads serial data 5️⃣ Motion mapped to notes and strum force 6️⃣ Karplus-Strong algorithm generates sound 7️⃣ Audio played in real time
- Python ≥ 3.8
- Arduino IDE installed
- USB drivers for Arduino
- Speakers/headphones
git clone https://github.com/Gaurav77Kumar/Air_Guitar.git
cd Air_Guitarpip install numpy sounddevice pyserial- Open Arduino IDE
- Open
Ardunio_Code.ino - Select board → Arduino Uno
- Select correct COM port
- Click Upload
python Air_Guitar.py1️⃣ Keep wrist steady during calibration 2️⃣ Rotate wrist left → lower notes 3️⃣ Rotate wrist right → higher notes 4️⃣ Shake wrist to strum 5️⃣ Adjust sensitivity in code if needed
| Angle Range | Note |
|---|---|
| -45° | Low E |
| -20° | A |
| 0° | D |
| 20° | G |
| 40° | B |
| 60° | High E |
You can adjust:
- Sensitivity threshold
- Strum detection force
- Sampling rate
- Volume
- String frequencies
Inside Air_Guitar.py.
Sensor → Arduino → Serial → Python → Audio Engine → Speaker
- Bluetooth sensor support
- GUI interface
- Multiple instrument modes
- Recording feature
- Machine learning gesture recognition
- Wireless version using ESP32
Contributions are welcome!
- Fork repo
- Create feature branch
- Commit changes
- Open pull request
Gaurav Kumar GitHub → https://github.com/Gaurav77Kumar
If you like this project, consider giving it a ⭐ on GitHub!
🎶 Build, experiment, and play music in the air — no strings attached!