In this tutorial I will show you how I build a CNC controller based on Arduino and GRBL, for the DIY 3D Printed CNC Machine that I showed you how I built in my previous video.
Isn’t it fascinating that this 8-bit, inexpensive and probably the most popular electronics prototyping board, the Arduino UNO based on the ATmega328P microcontroller, is capable of being a CNC motion controller and we are able to produce high quality stuff with it.


Just take a look at the projects that I made with it. We can get really fine details and probably make anything we can think of with it.




I mean, to me that’s really fascinating, but does it sound too good to be true? Stick around to find out, as I will walk you through the entire process of building this Arduino and GRBL CNC controller, show you all the problems I encountered in order to get it working properly, and show you why and how I designed a custom Arduino UNO shield for this CNC build.
In this video I will also cover how I did the wiring on my DIY 3D Printed CNC Machine from the previous video, as well as how to setup GRBL and make your first cuts with your CNC machine using the Universal G-code Sender.
Arduino and GRBL Setup
All right, so let’s start with the CNC motion controller. There are so many options for a CNC motion controller to the point that is really overwhelming especially for beginners. I chose to use the Arduino and GRBL combo because it’s a popular choice among CNC beginners and it’s one of the cheapest options for a CNC controller.
Anyhow, let’s take a look at this diagram first, so we can better understand how our CNC machine will work in combinations with this Arduino and GRBL CNC Controller.

So, the Arduino board, or the ATmega328P is the microcontroller on which we need to install the open-source GRBL motion control firmware. Together they make the CNC motion controller which job is to translate the digital instructions or the G-code into electrical signals that will drive the motors, and eventually the CNC machine.
We also need a CNC control software on our computer, that will send the G-code to the Arduino via USB connection. There are many options here as well, but I will use the popular Universal G-code Sender which is also open-source.
A CAD/CAM software is also needed to create 2D or 3D digital models and generate instructions or G-code for the model.
DIY CNC Control Box Circuit Diagram – Wiring
Of course, the CNC motion controller itself cannot do much if it’s not companioned with some other electronics components, like a power supply, stepper drivers, limit switches etc.
Here’s the circuit diagram or how everything needs to be wired for our Arduino and GRBL CNC motion controller to work with our CNC Machine.

So we have the Arduino UNO as the brains of our CNC machine, which controls the four NEMA23 steppers motors through the four DM542 stepper drivers. This is a 3-axis CNC machine, but we use two motors for the Y-axis, so therefore we need 4 motors total. For powering these steppers motors and drivers, we can use a power supply from 24V to 48V. A higher voltage allows for higher torque at higher speeds. The power supply needs to have enough power to handle the four motors power draw. I chose a 36V power supply, rated at 16.7A or that’s 600W power supply. That’s enough power for these four NEMA23 steppers motors, which we will later set to draw around 1.5A to 2A of current each.
For powering the control box cooling fan we need 12V, but instead of using another 12V power supply I decided to us a DC-DC converter to step down the 36V to 12V. I also used these 12V for powering the optocouplers that we will use for electrically isolating the limit switches from the microcontroller. The optocouplers help reduce the problems with false alarm triggers that occur due to EMI, or electromagnetic interference. This Arduino and GRBL CNC motion controller is particularly prone to EMI issues and false alarm triggers, but more on that later in the video where I will explain how I dealt with them.
We also need an E-stop button, and a probe, as well as some terminal blocks for better managing the wiring.
Bill of Materials
Below is the complete list of components needed for this DIY CNC build.
| Component | Quantity | Purchase Links |
|---|---|---|
| Metal Enclosure – 400x400mm + | 1 | Amazon |
| DM542 Stepper Driver | 4 | Amazon | AliExpress |
| Power Supply 36V 600W | 1 | Amazon | AliExpress |
| Ground Bus Bar | 1 | Amazon | AliExpress |
| Terminal blocks | 2 | Amazon | AliExpress |
| DC-DC Converter 3A | 1 | Amazon | AliExpress |
| Cooling Fan 12V | 2 | Amazon | AliExpress |
| Double-shielded cable – 4 wires | 10-15m | Amazon | AliExpress |
| Double-shielded cable – 2 wires | 10-15m | Amazon | AliExpress |
| Wires | 10m | Amazon | AliExpress |
| GX16 connector – 5 pin Male + Female | 5 | Amazon | AliExpress |
| GX16 connector – 3 pin Male + Female | 5 | Amazon | AliExpress |
| AC Socket with Switch and Fuse | 1 | Amazon | AliExpress |
| Trim router – Makita | 4 | Amazon | AliExpress |
Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.
Please note the article is still in under construction. Please check later for updated BOM.
Assembling the CNC Control Box
You can watch the following video for a complete step-by-step guide on how to build this Arduino and GRBL CNC control box.
