|
|
myCobot 280 M5Stack |
x 1 | |
|
|
Camera Flange 2.0 Version for myCobot |
x 1 |
|
Soldering Iron Kit |
|
|
arduino IDEArduino
|
|
|
Python |
myCobot 280 Face Tracking Robot – Python, MediaPipe & Arduino
In one of my previous videos , I presented an interactive Rock-Paper-Scissors project in which we compete against the myCobot 280 M5Stack, a 6-DOF robotic arm from Elephant Robotics. In that video, I also explained some of the basic features of the robot and the installation of the required software support.
For this project, we will again use the M5Stack and MyCobotBasic libraries, which are listed at the end of the text, together with Python 3.11.
Face detection is performed using the MediaPipe Face Detection machine-learning model, while OpenCV handles the camera stream, graphical visualization, and calculation of the face position inside the image. PySerial is used for communication between the Python application and the M5Stack controller.
These Python packages can be installed on Windows 11 by running the following command in Command Prompt or Windows PowerShell:
pip install mediapipe opencv-python pyserial.

This time, the goal is quite different. The myCobot 280 robotic arm will first detect a human face using the Camera Flange 2.0 module, also manufactured by Elephant Robotics, and then automatically move the camera so that the detected face remains near the center of the image.
This project is sponsored by PCBWay . From September 1, 2026, to January 24, 2027, PCBWay is hosting its 9th Project Design Contest. You can enter in five different categories: Edge AI & IoT, Robotics, Power, Open Theme, and Mechanical. Valuable prizes—including cash, coupons, and single-board computers—await the winners, while every participant will receive a Raspberry Pi Pico. Don't miss this opportunity to share your work and win great prizes. Make PCBWay your first choice!

The project is divided into two main software parts: a Python program running on the PC and an Arduino C++ program running on the M5Stack controller of the robot. The Python program is responsible for computer vision, and depending on the position of the face it sends simple commands to the M5Stack through the USB serial connection: Now the M5 Stack controls the servos and moves the arm along with the camera. For smooth movement, the Arduino program uses small incremental joint movements rather than continuously sending large absolute position changes.
During development, I tested two different methods of moving the camera horizontally.
- In the first version: J5 controls LEFT and RIGHT movement , J4 controls UP and DOWN movement. This gives a compact tracking movement.
- In the second version: J1 controls LEFT and RIGHT movement, J4 controls UP and DOWN movement. In this case, the complete upper part of the robotic arm rotates around the base. Visually, this movement looks more like a robot turning its “head” toward the person, and it gives the project a very different character.
Both versions use exactly the same Python face-tracking program.

The small M5Stack display is used as a local status monitor for the complete system: Under the Title the current operating state is displayed, then horizontal and vertical positions numerically in degrees. In addition to the numerical values, two graphical position bars are displayed, for horisontal and vertical movements.

The three buttons on the M5Stack also have dedicated functions. Button A is used for Center, Button B activates the complete Home position at start and Button C switches the sound indication ON or OFF.
The OpenCV camera window provides additional visual information that is very useful during testing and calibration.
The built-in 5×5 LED panel on the myCobot is used as another simple but very effective status indicator. Different colors represent different operating conditions. Blue means that the robot is in a neutral or waiting condition. Green means that a face has been detected and the robot is actively following its movement. Red, the detected face is inside the central stop zone and no further movement is currently required. Yellow means that a previously tracked face has genuinely disappeared from the camera view for approximately one second.

Several short sound signals are also used to make the operating states easier to recognize without looking at the display. HOME uses the same short sound that I used in my previous Rock-Paper-Scissors project. CENTER and LOCKED use a short 1800 Hz beep and a longer low-frequency tone indicates that the tracked face has been lost. The complete sound system can be enabled or disabled at any time using button C.
Now let's see how the device works in real conditions. By pressing the Home button, the entire arm is placed in a position ready for tracking. Center returns only the two tracking joints to their center positions. For a clearer presentation I am using a printed face from the "this person does not exist" website.
And finallu a short conclusion. This project transforms the myCobot 280 into a smooth real-time 2D face-tracking robot using Python, MediaPipe, OpenCV, and Arduino. Two different joint-control methods demonstrate how the same vision system can produce very different and natural-looking robotic movements.
myCobot 280 Face Tracking Robot – Python, MediaPipe & Arduino
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Mirko Pavleski
-
Arduino 3D Printed self Balancing Cube
Self-balancing devices are electronic devices that use sensors and motors to keep themselves balanc...
-
myCobot 280 Face Tracking Robot – Python, MediaPipe & Arduino
In one of my previous videos , I presented an interactive Rock-Paper-Scissors project in which we co...
-
Ultimate Off-Grid Communication Setup- Raspberry Pi + MeshStick & ThinkNode M9
I recently ordered two products from Elecrow - ThinkNode M9 Meshtastic Terminal and compact Meshsti...
-
DIY ESP32 Universal Timer with Touchscreen & Rotary Encoder
In several of my previous videos, I presented different projects based on the CrowPanel 2.1-inch HM...
-
Build a Real 5-Band Parametric EQ with ESP32 + WM8960 - Stereo DSP Audio Processor
Audio equalizer (EQ) is an electronic device that allows control over the strength of different fre...
-
Bass Reflex vs Sealed vs Horn – Same 2 inch Speaker Test
In one of the previous videos I presented the making of a miniature Horn type speaker box with a 2 ...
-
Building a Mini Fostex Horn Speaker with a 2-Inch Full-Range Driver
A back-loaded horn speaker is a loudspeaker design that channels the rear sound wave of a driver th...
-
ESP32 Moon Lamp That Shows the Real Moon Phase on Crowpanel Round Dispaly
Recently on the Hackaday portal I came across a very interesting project called Moon Display by aut...
-
40-Year-Old DIY Power Amplifiers – Do They Still Work - 500W MOSFET & Transistor Amps
This time I want to describe my two DIY super powerful audio amplifiers that I made about 40 years ...
-
Wi-Fi HaLow Explained! Long-Range Camera Test up to 300m (ESP32 + ThinkNode G4 from ELECROW)
I recently needed to install a security camera at a relatively large distance from my home, more pre...
-
Simple Object Recognition with the UNIHIKER K10 – No TensorFlow, No Internet, No Cloud AI
Object recognition has become one of the most popular applications of artificial intelligence and em...
-
DIY PCL82 Tube Amplifier, Single-Ended Amp with Amazing Sound
The idea for this project came from a local electronics magazine called EMITER, issue 12/13 from 20...
-
Simple MCP2036 SDR Radio - The Most Unusual Software Defined Radio
SDR (Software Defined Radio) is a radio communication system where many of the key electronic compo...
-
Elecrow All-in-One Arduino Starter Kit Review - 20 Projects & 16 Modules
This time I will describe a simple and practical way to enter the world of microcontrollers, specif...
-
ESP32-C3 Color Detector with TCS34725, Real-Time RGB Detection & Web Interface
Color detection is a fundamental task in many embedded systems – from industrial sorting machines t...
-
DIY ESP32 Telegram Flood Protection System - Smart Home Automation
Recently I had an unpleasant experience in my home, specifically my ground floor was flooded as a r...
-
Real-Time Air Traffic Radar using ESP32 + ADS-B Data
ADS-B, which stands for Automatic Dependent Surveillance-Broadcast, is the modern standard for trac...
-
DIY Green Laser Night Sky Object Finder - Find Stars & Galaxies Instantly with great accuracy
As an amateur astronomer, especially at the beginning, the most difficult part of observing the nig...
-
-
-
AudioLink – USB & Bluetooth LE Audio / Auracast Receiver with Balanced Line Outputs (nRF5340)
278 0 1 -
-
-
-
Émetteur Récepteur Optique Expérimental (communication UART ATtiny + fibre optique)
357 0 1 -
-
SmallOLED - Live PC Stats, Animated Clocks & Audio Visualizer
1427 0 3 -
"Talking Multimeter": Arduino-Based Speech Add-on for Multimeters with SCPI Protocol
797 0 1







