Robotics – Python / C / OpenCV

This project was a SCARA-style robotic arm I built using two hobby servos, a DC motor with encoder, and a webcam.

The system was controlled by a Cypress PSoC 5LP microcontroller, which ran C code for servo control, DC motor motion, and encoder feedback, in coordination with a Python script on PC that used OpenCV for image processing and UART communication with the PSoC.

A homogeneous transformation matrix was used to convert object coordinates from the camera frame into the robot’s base frame, and inverse kinematics determined the required servo angles to position the end effector.

This project combined embedded control, computer vision, and robotics mathematics to create a functional prototype.


Pre-SCARA Calculations

Handwritten notes deriving the homogeneous transformation matrix and initial inverse kinematics equations for a 2-DOF pan-tilt configuration.

Pre SCARA Calculations


Pan-Tilt Testing

Early motor testing in a pan-tilt configuration, moving to extreme positions.


SCARA Inverse Kinematics Equations

Handwritten derivations for the SCARA linkage inverse kinematics equations.

SCARA IK Equations


SCARA Equation Testing

Testing the SCARA kinematics: the robot moves to multiple positions, lowering and raising the rack-and-pinion end effector each time.


Final Webcam Integration

Final demonstration: the SCARA detects a black plastic nut dropped into the workspace multiple times and moves the end effector to the correct position.


Code

The project included both embedded C code for the PSoC and Python code for computer vision and inverse kinematics.

C Code (servo + DC motor control + UART on PSoC):

Python Code (computer vision + HTM + IK + UART):


← Back to Personal Projects