Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

English | Português

Position Control with IMU

Position Control With IMU

Hand IMU Example

This example demonstrates how to use an IMU sensor to detect hand position (UP, DOWN, SIDE) and display it in real-time using a Python GUI.

Firmware (Arduino)

The firmware.ino file contains the Arduino firmware for the IMU sensor (LSM6DS3). It uses an ESP32-C3 microcontroller to read the Z-axis acceleration from the LSM6DS3 Gyroscope Accelerometer Module (SPI/I2C) and sends the hand position via serial:

  • UP: Z acceleration > 0.5
  • DOWN: Z acceleration < -0.5
  • SIDE: Default position

Python GUI Application

The hand-imu/ directory contains a Python application that visualizes the hand position in real-time.

Installation

  1. Navigate to the hand-imu directory:
cd hand-imu
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

  1. Update the serial port in app.py (line 8) to match your device:
PORT = "/dev/cu.usbmodem1101"  # Change to your port
  1. Run the application:
python app.py

The application will display images corresponding to the detected hand position:

Hand Position Examples

UP Position:

DOWN Position:

SIDE Position:

Dependencies

  • pyserial - Serial communication with Arduino
  • Pillow - Image processing for the GUI

About

Position Control With IMU

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages