Mini CNC Machine Arduino Based & Adafruit Driver Motor L293D V1 & 2*Mini Stepper CD/DVD Player #1




My name is Abderrahim Aabida , 23 years , living in Morocco - Safi , holds a diploma in basic phy...

In this project I will show you how to easily build your own low-cost Arduino Mini CNC Plotter!

For X and Y axis we will use stepper motors and rails from two dvd/cd roms! Printing area will be max 4x4cm.

Step 1: The Video in Youtube :

Step 2: Parts

For this project you will need:

- Part list for beginners:

- Arduino uno ( or Mega ) Breadboard

- Shield driver motor L293D adafruit v1

- Mini Servo motor 9g

- 2x DVD/CD Drives

Librairy For Adafruit Shield Driver Motors v1 :

Step 3: X Y Axe

In first image above you will see the Y axis of our CNC machine. Attach it on your surface, in this part you will need some screws and nuts.

In second image you will see the X and Y axis. The X axis is attached to two plastic parts that I took from remaining 'garbage' stuff. I cut it to fit the construction. This is an easy procedure. Just make sure to put the Y axis straight to CNC base and the X axis vertically in this (90 degrees)

Step 4: The Z Axis

That's the most difficult part of our construction.

You will need something to attach it on X axis, a flat surface. On that surface you will attach the servo motor (Z axis) and the pen base. Pen (or pencil) must be able to move up and down with the help of servo motor. Watch the above image to understand what you need to do to duild Z axis. Tip! Use your imagination ;)

Step 5: the Circuit

Step 6: Uploading the CNC Code

Here is the main CNC code embedded using codebender!

In this part you will see your pen goes up. If don't, change penUp and penDown variables that controlling the servo motor. Press the "Run on Arduino" button and program your board from your browser!

Step 7: Make Your Own Gcode Files

To make gcode files that are compatible with this cnc machine you have to use the Inkscape.

Inkscape is professional quality vector graphics software which runs on Windows, Mac OS X and Linux. It is used by design professionals and hobbyists worldwide, for creating a wide variety of graphics such as illustrations, icons, logos, diagrams, maps and web graphics. Inkscape uses the W3C open standard SVG (Scalable Vector Graphics) as its native format, and is free and open-source software. Download and install Inkscape from :

(Important: download 0.48.5 version)

Now you need to install an Add-on that enables the export images to gcode files. This add on can be found here with installation notes.

Setup Inkscape for first use
Open the Inkscape, go to File menu and click "Document Properties". See the 1st image above and make the changes, make sure to change first to "cm". Now close this window. We will use the area within 4 to 8 cm. See the 2nd image above. How to print texts Put text, change font to Times New Roman and size to 22. Now click on cursor icon and center the text like the 3rd image above. Select Path from menu and "Object to Path". How to print images This is more difficult than texts. Images must have a transparent background. Drag and drop the arduino logo image (download it from files) in Inkscape. Click ok to the next window. Now you have to re-size the image to fit our printing area, see the 4th image above. Click Path from menu and "Trace Bitmap". Make changes as the 5th image above. Click ok and close the window. Now, move the gray scale image, and delete the color one behind it. Move the grey image to the correct place again and click from Path menu "Object to path". The 6th image above show how to delete image outline. Export as gcode Final, go to file menu, click save as and select .gcode. Click ok on next window. That's it! Ready to go! Use the gctrl.pde app to print the gcode file on your new Arduino CNC Plotter! I will make a video on next days about this procedure because it's little complicated. It took me a lot of time to understand how it's working...

Step 8: The GCTRL Program

Now we are ready to print our first image! To do this we will use the gctrl . This program sends 'gcode' images to the cnc plotter.

What is gcode? Gcode is a file with X,Y and Z coordinates. Header of this file is set to: M300 S30.00 (Servo down) G1 X10.00 Y10.00 F2500.00 G1 X20.00 Y10.00 F2500.00 M300 S50.00 (Servo up)

Click the "play" icon/button to start the program.

Download gctrl for Windows :

Click First time to " p " to select Port number for Arduino

and click to " g " to select Gcode file ...

Step 9: Examples Gcode File

13 People Made This Project!


  • Optics Contest

    Optics Contest
  • Make it Glow Contest 2018

    Make it Glow Contest 2018
  • Plastics Contest

    Plastics Contest

56 Discussions


Question 2 months ago on Step 8

Servo not responding.....Servo pin setting is rechecked......individual servo test is ok....


Question 6 months ago

at which value of voltage and external supply current for a shield motor l293


Question 8 months ago

This did not work for me, tried to test x and y axis from gctrl, wont budge, nothing moves. all libraries were installed and code uploaded to the Uno. Thought it might be the motor shield, went and wrote a test stepper motor sketch,shield and the Uno work fine... Pity, looks like a nice little project...


Question 9 months ago on Introduction

Hi, i made CNC as you wrote, but I'm not able to find the right configuration of stepper motor. With two motors, and 8 wire, there wre a lot of wiring possibilities!!! how can i found the right configuration ??
many many thanks, and very good job!! bye, Simone (italy)


10 months ago

I have a problem .... i made the whole setup . But when i upload the gcode .. the neitherX.Y.norZ .... axes...... it just doesn't move... yhere is no movement in the motors.
Plzzz solve my problrm..


11 months ago

Hi, my cnc only draw a line, the Y motor go to the limit and cant draw, all is in the same Y line. And i cant set a correct my work area all time only print another line and another..etc Tnx for Help i like this proyect but not is my day :(


1 year ago

Hello guys, now i'm making cnc, i've followed all the steps that already exist, but the output of the resulting image is very messy and i am confused the fact is where is the error?

Please help

Eduardo A.D

1 year ago

Hi, very, very good project, I see that many people have been successful.

I have uploaded Test_X_Axis_CNC_Plotter and Y, and my engines have good movement.

I have a problem with gctrl.pde and gctrl.exe, but I do not know why. My engines have no movement with gctrl. Select the serial port (OK), use the arrows and no movement, load a gcode image with (G) and no movement. I do not know where the problem is.

You help me? Thank you

My beta-CNC without Arduino, only router with OpenWRT and L293 driver. Does not interpret GCODE yet:


1 year ago

How do I fill out the drawing? I can only make outlines.

Juan ManuelK

1 year ago

hello, my problem i:

Arduino:1.6.11 (Windows 10), Tarjeta:"Arduino/Genuino Uno"

C:\Users\Kriivo\AppData\Local\Temp\ccdbL8gd.ltrans0.ltrans.o: In function `loop':

ccdbL8gd.ltrans0.o:(.text+0xcb4): undefined reference to `AF_Stepper::onestep(unsigned char, unsigned char)'

ccdbL8gd.ltrans0.o:(.text+0xce2): undefined reference to `AF_Stepper::onestep(unsigned char, unsigned char)'

ccdbL8gd.ltrans0.o:(.text+0xd28): undefined reference to `AF_Stepper::onestep(unsigned char, unsigned char)'

ccdbL8gd.ltrans0.o:(.text+0xd56): undefined reference to `AF_Stepper::onestep(unsigned char, unsigned char)'

C:\Users\Kriivo\AppData\Local\Temp\ccdbL8gd.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_FKZY7W9IN4TTHPJ.ino.cpp.o.1877':

ccdbL8gd.ltrans0.o:(.text.startup+0xc4): undefined reference to `AF_Stepper::AF_Stepper(unsigned int, unsigned char)'

ccdbL8gd.ltrans0.o:(.text.startup+0xd2): undefined reference to `AF_Stepper::AF_Stepper(unsigned int, unsigned char)'

C:\Users\Kriivo\AppData\Local\Temp\ccdbL8gd.ltrans0.ltrans.o: In function `main':

ccdbL8gd.ltrans0.o:(.text.startup+0x2f6): undefined reference to `AF_Stepper::setSpeed(unsigned int)'

ccdbL8gd.ltrans0.o:(.text.startup+0x302): undefined reference to `AF_Stepper::setSpeed(unsigned int)'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compilación en tarjeta Arduino/Genuino Uno.

Este reporte podría tener más información con
"Mostrar salida detallada durante la compilación"
opción habilitada en Archivo -> Preferencias.


1 year ago

hello sir my cnc not drow properly it can drow only a square it's urjent plz sir


1 year ago

my cnc not drow properly it can drow only square


1 year ago

Is gctrl compatible with Windows 10, I did run it a couple of times, cannot do any selections, pressing "p" or "g" button does not work. Your help is much appreciated.


1 year ago

all im getting from the z- axis servo is jitters, any help?


1 year ago

I have heat problem. Both of motors and l293d are overheated in 30-40 second. can anyone give me some advice.


1 year ago

Super nice project !

My project its up and running.

Now i have som ? about it.

Can`i change the motorer on X and Y from DVD step motorer to eks. 28BYJ-48 5 volt.


1 year ago

I've made it but it isn't working after uploading the code please any one help me


1 year ago

Hello, I Hav Made It But I Hav A Major Issue With Power Supply. Ones I Hav Supplied 19v 1.5Amp Then 1 Cap. Of 16v 100uf Blew Up I Hav Repaired It Will Any One Will Suggest Me Wat To Supply Power To L293D Motor Sheild

1 reply

Reply 1 year ago

Remove the jumper from the motor driver board L293D and supply 5V to the board this worked for me


2 years ago

hola a todos; eh estado trabajando en este proyecto y podrian modificar ciertas cosa del codigo para mejorar el rendimiento de nuestro mini cnc y evitar daños en nuestra shield motor. ademas reducir el ruido de los motores y el calor que esto producen al trabajar.

entonces la parte del codigo que hay que modificar seria esta:

void setup() { // Setup

Serial.begin( 9600 );

TCCR2B = TCCR2B & B11111000 | B00000001;

TCCR0B = TCCR0B & B11111000 | B00000001;




// Decrease if necessary




que sea de su agrado!!!!!