Skip to content

A humanoid dancing robot built with Arduino, featuring motion capture powered by MediaPipe.

Notifications You must be signed in to change notification settings

brunobpinto/dancing-robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Dancing-Robot-Banner

Dancing Robot

This project was developed as the final activity for the Microcontrollers Project class at PUC-Rio, Brazil. It showcases the integration of Arduino and MediaPipe to create a humanoid dancing robot that mimics human movements. The project was conceived as an idea aligned with this year's class theme, Interactive Art.

Video

Watch the robot in action in the video below:

DemonstrationVideo.mp4

Features

  • Humanoid robot capable of imitating human movements.
  • Motion capture powered by MediaPipe for precise tracking.
  • Controlled via Arduino, ensuring smooth and responsive movements.
  • Fully 3D-printed components for a customizable and modular design.
  • Themed around Interactive Art, blending technology and creativity.


Getting Started

Hardware Requirements

  • Arduino microcontroller (e.g., Arduino Mega or Uno).
  • 12 Servo motors (SG90 and MG90S models).
  • 16-Channel 12-bit PWM and Servo Shield for Arduino
  • Power supply for the servos and Arduino.
  • Camera for motion capture (any standard webcam, including built-in laptop cameras).
  • Structure and pole to securely hold the robot in the air during operation.
  • Structural components: 3D-printed parts (see below).

Warning

While the Arduino Uno may work, it is recommended to use an Arduino Mega due to its larger SRAM (8 KB vs. 2 KB on the Uno), which provides better performance and stability for memory-intensive tasks.

Software Requirements

  • Arduino IDE for microcontroller programming.
  • Python 3.8 or later.

3D Printed Files

All 3D-printed files can be found in the /3D_Files directory.

Tip

Since the 3D files of the robot are symmetrical, you can simply open the SLDPRT files and mirror them to create both sides of the robot. Afterward, save the mirrored parts as STL files and you're ready to print!

Installation

Setup Arduino:

Install Dependencies:

  • To install the Python dependencies, run the following command:
    pip install -r requirements.txt

Arduino COM Settings:

Before running the project, make sure to correctly configure the Arduino's serial port. The serial port may vary depending on the operating system and the connection to the Arduino.

  1. Open the main Python code file, main.py.
  2. Locate the following code snippet:
    try:
    arduino = serial.Serial("COM5", baudrate=9600)  # Change port according to your device
  3. Replace 'COM5' with the serial port of your Arduino.

3D Printing and Assembly Components:

  • Ensure that the robot is fully printed and assembled correctly, and that each servo is connected to the correct pwm port.
  • And make sure the camera is connected and communicating with the code.

Run the Project:

  • Execute the main.py file to start motion capture and servo control.


Usage

Interface 1 Interface 2

How It Works

Motion Capture and Pose Detection

  • MediaPipe captures keypoints of human movements in real time via a camera.
  • By analyzing the angles of the joints, it detects pre-programmed poses and synchronizes them with the music's rhythm.

Beat Detection and Rhythm Syncing

  • The Python code running on the computer detects the beat of the music and establishes the rhythm.
  • This timing determines when each pose should be sent to the Arduino for execution.

Servo Control and Synchronization

  • The Arduino receives pose data via serial communication.
  • It moves the robot’s servos in sync with the rhythm to perform the correct movements.

3D Printing and Assembly

  • The robot's frame is constructed using 3D-printed parts.
  • This provides a lightweight and modular structure for easy customization and assembly.

Schematic

Mr.Adam's Schematic

Contributors

We would like to extend our heartfelt thanks to everyone who contributed to the development of this project. Your support, ideas, and dedication were essential in bringing this robot to life.

Thank you all for your hard work and collaboration!

About

A humanoid dancing robot built with Arduino, featuring motion capture powered by MediaPipe.

Topics

Resources

Stars

Watchers

Forks