This project presents the development of a payload mechanism for a UAV, implemented using object-oriented programming (OOP) principles on the ESP32 microcontroller. The mechanism integrates a stepper motor, servo motor, and ultrasonic sensor to deliver a modular, scalable, and efficient system. The ESP32's multi-core architecture is utilized to manage real-time tasks effectively. The mechanism ensures precise payload handling and safety, critical for applications such as medical deliveries.