Legobot mechanical arm that builds Lego structures from a scattered pile of pieces, relying purely on a Raspberry Pi camera and OpenCV image processing to locate individual Legos with a high degree of accuracy. The Pi processes location data, which is sent to an Arduino to translate into movement commands using several inverse kinematics formulas. A feedback loop between the Arduino and Pi allows for the arm to adjust movements to account for incorrectly placed pieces, or rotating blocks.