Close
0%
0%

AutoSort-ESP32 Automatic Color Sorting Robotic Arm

Wirelessly Controlled Color Sorting Robotic Arm Power by ESP32

Similar projects worth following
0 followers
An autonomous web-controlled color sorting robotic arm featuring a complete mechanical redesign, embedded ESP32 firmware, custom motion planning, color recognition, and a fully self-hosted web interface.

Originally built from an educational robotic arm kit and extensively re-engineered to achieve higher payload capacity, improved reliability, and industrial-style operation.

Designed, programmed, mechanically redesigned, assembled, and tested by a Computer Science student.
Repository:
https://github.com/itspdp/AutoSort-ESP32-Robotic-Arm

The CS Guy vs. The Laws of Physics (A Story about the project)

So here's the deal: I’m a Computer Science student who spends way too much time obsessing over robotics hardware. I bought an educational "Acebott" robotic arm kit online just to practice writing IoT code on an ESP32. I figured I'd write a few lines of C++, make it pick up a block, and call it a day.

Physics had other plans.

When I actually tried to make the arm lift a decent industrial payload, the tiny MG90S micro-servos in the lower joint completely gave up. They just didn't have the torque. Instead of doing some quick jugaad (a makeshift hack) with tape or rubber bands, I decided to engineer a proper, industrial-grade solution.

The plan? Rip out the weak motors and swap them for heavy-duty, metal-geared MG996R servos.

The problem? The new servos were way too big for the factory plastic chassis. Also, I didn't know how to use traditional CAD software like AutoCAD. But I do know how to code. So, I grabbed my calipers, took some physical measurements, and wrote OpenSCAD scripts (which is literally just 3D modeling using code) to generate brand-new, heavy-duty custom mounting plates and a 3D-printed rotating base.

Once the hardware was rock-solid, I went all-in on the software. I built a custom kinematic physics engine so the heavy arm smoothly accelerates and brakes without tipping over. Then, I hosted a complete, mobile-responsive HTML/JS Web Dashboard straight onto the ESP32's internal memory. Add in a TCS34725 sensor, a Euclidean-distance color matching algorithm, and an 11-step collision-free routing system, and my little educational kit accidentally evolved into a full-blown autonomous industrial sorting cell.

Proof that sometimes, a hardware failure is just an excuse to write better software!

[SOURCE]AutoSort-ESP32-Automatic-Color-Sorting-Robotic-Arm.zip

Everything About the Project Is Here.

Zip Archive - 39.85 MB - 10/01/2026 at 19:13

Download

  • 1 × ESP32 A Microcontroller
  • 2 × MG996R Servo For Base & Lower Arm
  • 2 × MG90S Servo For Upper Arm & Gripper
  • 1 × Relay Power Supplies / Uninterruptible Power Supplies (UPS)
  • 1 × TCS34725 sensor Color Sensor

View all 6 components

  • The CS Guy vs. The Laws of Physics: Building the AutoSort-ESP32

    Pranay Deep • 19 minutes ago • 0 comments

    This project started as a fun experiment to dive into robotics using an Acebott educational arm kit. But when I tried making it lift real payloads, the tiny factory MG90S micro-servos completely failed the torque test. Upgrading to heavy-duty MG996R metal-gear servos was the obvious fix, but they couldn't fit the factory plastic chassis. As a Computer Science student with no traditional CAD experience, I turned to OpenSCAD—using code-driven 3D modeling to engineer custom mounting plates, reinforcement brackets, and a heavy-duty base.  

    Upgrading the motors brought a serious electrical challenge. Powering heavy servos directly from an ESP32 will instantly fry the board. During testing, I cobbled together a temporary setup using phone chargers and power banks just to get everything moving. For a permanent, reliable build, a dedicated 5V 10A SMPS is mandatory. The most critical lesson? Always share a Common Ground between the external power supply and the ESP32 to stop the servos from twitching uncontrollably.  

    After assembling the hardware and wiring up the TCS34725 RGB color sensor, I built out the full control stack. Instead of relying on generic Bluetooth apps, I created a complete mobile-responsive HTML/CSS/JS web dashboard hosted directly on the ESP32’s LittleFS memory.  

    To handle the aggressive momentum of the heavy servos, I engineered a custom C++ kinematic motion engine with smooth acceleration/deceleration curves and an 11-step collision-safe routing sequence. Finally, I implemented a Euclidean Distance color-matching algorithm so the robot could autonomously identify and sort up to 60 saved color profiles. What began as a flimsy toy kit evolved into a fully functional, autonomous industrial sorting cell! 

View project log

  • 1
    Bill of Materials & Prerequisites
    • Microcontroller: ESP32 Development Board
    • Actuators: 2× MG996R High-Torque Servos (Base Pan & Lower Lift), 2× MG90S Servos (Mid Elbow & Gripper), 1× DC Conveyor Motor
    • Sensors & Modules: TCS34725 RGB Color Sensor, JQC3F 5V Relay Module
    • Power Supply: Dedicated 5V, 10A SMPS (External DC power supplies/chargers with common ground for testing)
    • Hardware & Structure: Custom OpenSCAD 3D-printed plates and base mounts (3D_Models/ directory), mechanical hardware (M3/M4 bolts, nuts, ball bearings)  
    • Software Tools: Arduino IDE with LittleFS upload plugin, OpenSCAD (for custom tweaking)
  • 2
    Step 1: 3D Printing and Chassis Fabrication

    [Always Use Latest Version from the Uploaded Source Zip] (Version Name Mentioned here can be Older)

    1. Download 3D Assets: Open the 3D_Models/ folder from the repository.  
    2. Print Structural Base Parts: Slice and 3D print ROBOBase.stl, Base Ball Bearing Ring 4.0.stl, and Bottom plate with servo 5.0.stl. Use an infill density of at least 30–40% to withstand the mechanical torque of the lower joints.  
    3. Print Side Plates & Gripper: Print New SIde Plate 6.5.stl, Middle Support Arm-Column.stl, and GRipper Base Plate 2.0.stl.  
    4. Inspect Measurements: Use digital calipers to verify servo cutout dimensions before mounting. Adjust parametric .scad scripts if using alternate servo chassis brands. 
  • 3
    Step 2: Mechanical Assembly & Servo Retrofit
    1. Assemble Lower Base: Mount the main base ball bearing ring into ROBOBase. Install the first MG996R servo into the base pan mount to handle horizontal rotation.  
    2. Mount Lift Mechanism: Secure the second heavy-duty MG996R servo into Bottom plate with servo 5.0 to drive the lower arm lift joint.  
    3. Attach Mid-Arm and Gripper: Mount the two MG90S servos into the elbow joint bracket and the two-finger rigid pick-and-place gripper mechanism.
    4. Assemble Conveyor Mount: Secure the DC conveyor motor using motor socket for conveyor 3.stl and align the belt next to the arm's pick-and-place radius.  
    5. Mount Color Sensor: Position the TCS34725 sensor over the conveyor belt path, encasing it with a custom shroud/bridge to minimize ambient room light interference.

View all 6 instructions

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates