Showing posts with label GPIO. Show all posts
Showing posts with label GPIO. Show all posts

Tuesday, 13 May 2025

Hand Gesture Controlled LEDs with ESP32 and Python

Hand Gesture Controlled LEDs with ESP32 and Python

This project demonstrates how to control LEDs using hand gestures by integrating an ESP32 microcontroller with Python-based computer vision libraries. Utilizing OpenCV and MediaPipe, the system captures hand gestures via a webcam and translates them into commands sent to the ESP32 over Wi-Fi. The ESP32 then controls LEDs connected to its GPIO pins based on these commands.

Components Required
  • ESP32 Board
  • 5 LEDs (representing Thumb, Index, Middle, Ring, Pinky)
  • 5 Resistors (220Ω each)
  • Breadboard and Jumper Wires
  • Webcam
  • Computer with Python Installed
Circuit Setup for ESP32 Hand Gesture Project
Circuit Diagram of Hand Gesture Controlled LEDs with ESP32 and Python


Each LED is connected to a specific GPIO pin on the ESP32 (e.g., GPIO14, GPIO27, GPIO26, GPIO25, GPIO33). A 220Ω resistor is placed in series with each LED to limit current. The anode of each LED connects to the GPIO pin, and the cathode connects to the ground.


Python Script for Gesture Detection

On the computer, a Python script uses OpenCV to capture video from the webcam and MediaPipe to detect hand landmarks. It determines which fingers are raised and sends corresponding HTTP requests to the ESP32 to control the LEDs. For instance, raising the index finger sends a request to /led/index/on. If all fingers are lowered, a special command can be sent to perform a predefined action, such as turning off all LEDs.

In practice, this system allows for intuitive control of LEDs through simple hand gestures. Raising a specific finger turns on the corresponding LED, while lowering it turns the LED off. This real-time interaction demonstrates the seamless integration of computer vision and microcontroller-based hardware control. The project serves as a foundational example for more complex gesture-controlled applications, such as home automation or robotic control systems.

ESP32 Hand Gesture Project - Working Demo

ESP32 Hand Gesture Project - Working Demo

Friday, 17 May 2024

Design Tips and Troubleshooting Guide for MCP2200 Protocol Converter

 The MCP2200, developed by Microchip Technology, serves as a USB-to-UART serial converter, facilitating the conversion of USB connections to serial interfaces.


Design Considerations


  • Ensure proper connectivity and voltage levels between the MCP2200 and connected devices.

  • Strategic placement of the USB port close to the IC for efficient data transfer.

  • Direct routing of data lines and minimal use of vias to reduce signal interference.

  • Include filter capacitors and maintain tight component arrangement to optimize performance.


Troubleshooting Tips


  • Verify signal connections and check voltage compatibility to address communication failures.

  • Test functionality by matching serial settings with connected devices and performing a loopback test for data transmission.

  • Use alternative USB cables to rule out potential cable issues.


Microcontroller programming, debugging, industrial control systems, DIY electronics projects, legacy device support, automation, and robotics. Alternatives include CH340, MA112AS16, FT230x, CP2102, PL2303HX, CH9102, CH343, CH341, CP2110, and FT232.


Detailed mechanical drawings and dimensions aid in creating custom footprints for PCB or CAD modeling, ensuring accurate integration of the MCP2200 into electronic designs. For detailed technical specifications and mechanical drawings, refer to the MCP2200 datasheet available here.