This document describes a novel technique for controlling CNC systems using Matlab software and an Arduino microcontroller. Matlab is used to process images of parts and convert them into arrays of pixel data representing the geometry. This data is sent via serial communication to an Arduino microcontroller, which generates pulse trains to control stepper motors in the CNC machine and execute the machining instructions. The technique was implemented and tested on a 3-axis milling machine. Analysis showed the approach can develop and use CNC part programs for various machining and non-machining applications.