Automated PCB Component Recovery Using Machine Vision and Robotic Manipulation: Machine Learning and 3D-Printed Parts

Hi, I’m Aleksander Watson, a master mechatronics student at the University of Agder. This semester, together with Håvard Karlsen Solheim and under the supervision of Ajit Jha and Muhammad Faisal Aftab, I’ve been working on a project through the CARM Centre: Teaching a robot arm to recognize and pick up electronic components from circuit boards.

About me

I have been interested in robotics for as long as I can remember. The way they move and allow for inhuman control fascinates me so being able to learn to use a 6 DOF robot was a dream come true. Being a mechatronics student means that a lot of theory is learnt but actually putting it into practice is something entirely else. I like the parts of engineering where you can’t just simulate your way to an answer, you have to build something, watch it fail, and figure out why and how to prevent it from happening again.

My work at CARM

My side of the project split roughly in two: getting a machine learning model to actually recognise the components and making sure all the physical parts fit together the way they needed to.
For the detection side, I trained a YOLO-based object detection model to recognise capacitors, resistors, and transformers on circuit boards, using the Roboflow platform. Our development machine only had 2 GB of VRAM, so training a serious model locally was never really an option — Roboflow’s cloud training became our solution. We started with a dataset of 151 images of the circuit boards and worked our way up to around 1,400 through augmentation of the images. That alone gave the model a noticeable boost, and switching from the standard YOLOv11 model to the larger YOLOv11-XL variant pushed things further: our final model reached a mAP@50 of 91.4%, with 84.8% precision and 96.9% recall. Watching those numbers climb after each training round and then watching the model correctly draw a box around a capacitor it had never seen before was genuinely one of the most satisfying parts of the whole project. One thing I had to keep an eye on was bias: our dataset had far more capacitors than resistors or transformers, so the model got noticeably better at spotting capacitors than the other two component types. The images were labeled using the roboflow API to detect the components on the board where the API gave back the resulting bounding boxes.

The trained YOLOv11 model detecting capacitors on a circuit board, with confidence scores shown live on screen.
The trained YOLOv11 model detecting capacitors on a circuit board, with confidence scores shown live on screen.

On the mechanical side, I worked on designing and 3D printing the parts that hold the whole system together: the custom mounts that fix the RealSense camera to the robot base. None of these parts exist off the shelf for this exact combination of camera and arm for eye on base application, so it came down to measuring, modelling, printing, test-fitting, and usually reprinting at least once before everything lined up.

The gripper, picking up a capacitor during a test run.
The gripper, picking up a capacitor during a test run.

Reflections

It was a good reminder that machine learning doesn’t live in isolation. A great model is only useful if the camera it’s plugged into is pointed at the right spot, held steady by a bracket that doesn’t wobble. Going back and forth between training runs and the 3D printer taught me to think about the whole pipeline, not just my own piece of it. There have been multiple new issues I didn’t see coming, but working through them and learning from them is an invaluable experience.

Looking ahead

I’d like to keep improving the balance between component classes in the dataset, and there’s a clear next step in exploring object-oriented bounding boxes, so the robot can reason about a component’s orientation and not just its position. As well as learning more about ROS 2 and how to apply robotics in specific tasks

Thank you for reading!

Scroll to Top