ARDUINO by Myself Mini-CNC (Plotter)





Introduction: ARDUINO by Myself Mini-CNC (Plotter)

Arduino Mini-CNC machine (working as a Plotter)

Basic Operation and System Description:

In This project I will guide you on how to easily build your own Mini-CNC machine and with a low cost (using arduino and scraped old DVD/CD drivers).

I decided to write this detailed tutorial in order to help you do do it with a few simple steps.

To the Y and X axis we will use 2 step motors and trays of an old DVD/CD driver and for the Z axis it was used a common servo motor (9g like HXT900), this device will move a pen or pencil up and down on the Z axis.

For the structure I decided to use the DVD/CD's frames. The pen or pencil can be easily plugged to the sistem in the Z axis. I do not advise you to using a mini-drill or other weight object in the z axis cause the step motor has no power to handle that object It has no enough force to do it) so use just light object like pen or pencils.
The circuitry are based on Arduino Uno or compatible (like a stand alone ATMega328p with FTDI connection to the USB port) and it was used two L293D (H Bridge) Integrated Circuit to manage the step motors coils (but you can also build your own H-bridge based on transistors)

I did all adjustments and tests on a bread-board first and after that I developed a strip-board for the step motors driver. In this way I can connect the step-motors to the driver and connect the driver to the Arduino UNO.

For the system power I used a 5V@500mA external power source (to power the step motors) and the Arduino is powered by the USB connector. The Ground pin of Arduino and GND of the external power source must be connected in common.

Starts disassembling the DVD/CD drivers and saving the step motors rail and trail.
We will need to drill some holes in the frame of the DVD/CD and assemble the step motors rails (for the X and Y axis) on it.

The Frame must be mounted as an "L" and we must to ensure that we get a rigid structure (I used solder to join these two parts)
After that you can start to mounting the electronic devices (Arduino, step motors driver and connections)

You will need to identify the coils (A and B) of the step motors and take some notes (use a Ohmmimeter to do it) and after that you must to solder 20cm wires on the step motors terminals.


Some photos have comments in it.


All material used:

2 x DVD/CD drivels (ensure that the step motors are working properly)
2 x L293D
1 x servo motor HXT900
1 x Arduino UNO
1 x Arduino USB cable
Pin Heads
10mm x 3mm, screws
30mm x 3mm, screws
Plastic spacers with 3mm screw-thread
00mm x 100mm, fenolite board
Pen or pencil (thin point)
Wires and Jumpers for Arduino
Solder tin
Araldite or liquid Epoxy glue
Some tools
Specific parts will be shown in the next steps.


Disassemble the CD/DVD drivers and save parts as:

Frame, screws, step motor, shaft and rails;
LASER head without electronics and optical parts;
In the figure above you can see that the LASER head have two holes that will be used later.
Do not discard the damping rubbers we will use it later too...


Frame structure:

We need to build a frame structure with an "L" shape. All surface area that will be joined must be sanded and after it will receive a tin solder.
In the figures above you can see the X and Y axis position and direction.


Make four marks corresponding to holes of the stepper motor mounting structures (for the X and Y axis) .
For the Y axis, the position must start at the very beginning of the frame structure and centered in the middle of the frame.
For the X axis, the base must be centered on top of the frame structure.

Y-axis - the drillings must be centered on the front in relation to the side and positioned as close as possible to the beginning of structure.
X axis - the drillings must be centered in relation to the upper side and positioned as close as possible to the top of the structure

See the figures above for more details.


After performed the drillings is time to solder the frame structures Use a gas torch and tin to join the frame parts in order to form an "L" shape Use solder flux to help in this process.
Remembering: the Y-axis is the base of the "L" shape.

Screw the parts that forms the frame structure to be solid.
Use the screws removed and saved during disassembly.

Pass some solder flux in order to facilitate the welding process.
And use the gas torch.
Mounted Structure! We are halfway of our objective...
It is not perfect, i know but it is pretty solid.
The sides just a few soldering points.


If you have not already done....... so..... weld four wires to the step motor terminals use different colors in order to identify the pinout.
See in a later step how to identify the coils for a particular step motor. Most DVD/CD driver use this same configuration.
For this specific step motor, I got this configuration:
- coil A are the Green / Blue wires
- Coil B are the Purple / Gray wires
Solder some pin-heads terminals at the wires ends in order to facilitate the connection to the L293D driver.


The material needed to mounting the Y-axis are:

4 x 10mm spacers (it can be rubber or other material as your choice) 2 of them (the back ones) must be 2mm higher than the front ones (due to the step motor base be a little higher on the back) otherwise the structure will became unlevel.
My spacers was taken from an older printer.

We will need some 30mm x 3mm screws, washers and nuts.

Keep the original dump rubbers.... they will help us to level the system by pressing more one side than another (it is possible to control the flatness and keep pressure)

In the figures above, take a look at:
Spacer position;
Y-axis base position at the frame;
How to screw the Y-axis base to the frame;
As I said before, the original dump rubber will help to level the system and we can adjust till 2mm of hight on each side.


Materials needed to assemble the X-axis:

4 x plastic spacers with 3mm threaded

4 x washers 8 x 10mm x 3mm screws, it is not necessary to be plastic (it's what I had left over).

Install spacers in the X-axis structure:.

And finally install the basis of the X-axis, as done for the Y-axis.




The piece shown in the images above was taken from a old hinge of toilet seat lid... This piece will be used as a guide for our pen plotter (the pen fits very well to this piece without gaps, requiring some lubricant to facilitate the movements). You can use your imagination and skills to create your custom piece.....

Glue the servo motor in a phenolite board of 100mm x 50mm. Make two slots vertically about 40mm from the edge with 3.5 mm wide (they will be used to the pen height fine-tune). Glue the board and servo motor ... use your expertise to align the set (this is very important) The piece that will lift the pen was taken from an old sewing machine, (I will call "tweezers") once again use their skills to build your own tweezers piece.


Use two screws (10mm x 3mm) to hold the Z axis on the shaft base OF X-axis.
On the X-axis base we have two holes that fit just right with 3mm screws.

Now we can mount the Z-axis over the X-axis using two screws and the holes and perform a fine tuning of the pen height.

This fine tune should be done using practical, be very patient .......

Ensure that the tweezer do not touch the pen guide piece.


Materials needed for mounting the "table" plot.
2 x plastic spacers WITH 3MM threaded

4 x (10mm x 3mm) screws

1 x phenolite plate (100mm x 100mm)

2 x metal plate (100mm x 100mm)

Double-sided tape.

Cut into a plate of metal (100mm x 100mm) that will be used as basis of the table (DO NOT DRILL HOLES ON THIS PART), the flatter the better.

Cut a piece of phenolite (100mm x 100mm) and make two drills (centered and spaced like in the Y-axis base header, see the figures above).
So the drilling must be done so that the screw pass through it completely. The drilling must be in line with the holes in the base of the Y-axis (which are existing in the laser head).

Cut a piece of metal plate (100mm x 100mm) and make two drills as above instruction (but just tomput the screws and not to pass it completely) this piece will be used as the basis of the table.
Mine was removed from the old disk (3 1/4) driver.

Note that the existing holes in the head of the LASER will fit very good for the base table structure.
Put the spacers in these holes with (10mm x 3mm) screws.

Now let's make a "sandwich" with phenolite plate and other metal parts

Join the table basis with the phenolite plate using double sided tape

Join the flat metal part with the last one using double sided tape

Take in mind that the screws are internal and should not overpass the phenolite height.


If you follow all the steps up to here,....... and if you had a lot of patience and a lot of persistence, your MiniCNC - Plotter should be almost done.


Use a felt tip pen and bright paper (photographic paper) for better results in the tests.

The special screws was taken from an old sewing machine. They have a smooth surface which will facilitate the "tweezers" movement

Make a hole in the pen body about 800mm from the tip (this height must be adjusted by testing on the machine).


Now it is time to mount the Electronics modules.

Starting with the stepper motor drive ( using L293D integrated circuit) See all diagrams above. I mounted the electronics components on a standard perforated board. All diagram and photos can be download from the GitHub: Also the "Fritzing" schem. The board was designed on DIYLC software "Strip_Board_diylc-3.28.0", it can be downloaded for free from: https: // ...

In the diagrams we have the following pins attached to the board: D2, D3, D4 and D5 - connection to Arduino pins; M1A, M1A 'M1B and M1B' connection of the coils A and B to the step motor (Y-axis); D8 axis, D9, D10 and D1 - connection to Arduino pins; M2A, M2A 'M2B and M2B' connection of the coils A and B to the step motor (X-axis)

In the step motor we have 4 wires, take a look in the figures to know how to identify the coils A and B, the wires are A / A ' and B / B'

Material: 2 x L293D2 x socket for IC 16 pins 2 x 220nF poliester capacitors pinhead bars with 4 pins (in my case I used male and female)

The technique I used to mount the perforated board is .... creating all tracks with tin solder to connect the components like in a printed circuit board (see the figures above).


Using some jumper we can connect all modules (Arduino to step motor driver)

Use double sided tape to glue the modules on the structure frame (on the back)

Connec all jumper as shown on the diagram.


The software that we need are listed below and can be downloaded from GitHub.

1 - ArduinoByMyselfMiniCNC.ino file - you must open this file in the Arduino IDE, it must be compiled and sent to the Arduino Board.

2 - CNCTool.pde file - You must open this file using Processing IDE, it is the men-machine interface.

InkScape - If you wanto to create your own G-Code (CNC language - instructions codes), you will need this Image editor and an addon. You can generate the G-Codes from any Images or Texts.

There are a lot of tutorials on Youtube regarding this matter, I will put here (in a near future some tutorial too, stay tuned!)

You must download 0.48 version from:

And the Add-on "MakerBot Unicorn G-Code Output for Inkscape" (in order you be able to generate G-Codes files) from:

You can download processing from:

Arduino codes to testing the Z, X and Y - axis:

Eixo X:

const int stepsPerRevolution = 20;

//Connection pins: Stepper myStepperX(stepsPerRevolution, 8,9,10,11);

void setup() { //Set speed: myStepperX.setSpeed(100); //max 250 steps for dvd/cd stepper motors myStepperX.step(160); delay(100);


void loop() { }

Eixo Y:


const int stepsPerRevolution = 20;

// Connection pins: Stepper myStepperY(stepsPerRevolution, 2,3,4,5);

void setup() { // Set speed: myStepperY.setSpeed(100); // max 250 steps for dvd/cd stepper motor myStepperY.step(160); delay(100);


void loop() {


Eixo Z:

#include const int penZUp = 50;

const int penZDown = 30;

const int penServoPin = 6;

Servo penServo;

void setup(){

Serial.begin( 9600 );





void loop(){






After the tests... your are finally able to print the first image or text message. Lets do it together:

1 - connect your computer to the Arduino board via USB cable;

2 - opens the Arduino IDE;

3 -Load the "ArduinoByMyselfMiniCNC.ino" file;

4 - compile the file;

5 - sne d the file to the Arduino;

6 - opens "Processing";

7 - Load the "CNCTool.ino" file (see attached figure);

8 - Play the file (it will be opened the CNCTool application) (see attached figure);

9 - Basics commands from CNCTool by typing (see the figures for further details):

p - it will be selected the serial communication port with Arduino board;

0 - this command configure the initial position of the machine (Zero position, it is so important that the allall axis be in the phisical zero position before this command);

g - loads the G-Code to the machine (in the GitHub repository there are some test purpose files);

x - to stoping the file processing on the machin (stop sending the file to the Arduino) or if anything wrong was happened type "x" command

All G-Code commands performed by the machine can be seen in real time in the "Processing" window.

If all goes well...... CONGRATULATIONS!!! You conclude this project from "ARDUINO By Myself"

Step 18: VIDEOS

See this video on youtube:

I am so sorry but I have not produced videos in English language yet.


***Feel free to pointing any error on this tutorial (including Inglês language because I am not native speaker) , I will be glad to correct them.

For doubts, comment and suggestions keep in touch.

3 People Made This Project!


  • Paper Contest 2018

    Paper Contest 2018
  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Science of Cooking

    Science of Cooking

We have a be nice policy.
Please be positive and constructive.




Hello there
Thanks for sharing this is great project. I made it almost but this step motor (Stepper myStepperX(stepsPerRevolution, 2,3,4,5);) does not work. Ardunio PWM pins 2,3,4,5 dont have any voltage
I tried to increas feed voltage but it doesn't work.
I tried to test X axis and Y axis together it is working but When I uploaded 'ArdunioByMyselfMiniCNC' don't work. I used ardunio mega 2560 and 2xL293d.
Thank you and have nice day.

Excellent instructions

ficou muito bom. uma idéia inusitada essa de usar até a carcaça dos DVDs.

Hello BigDog,

Congratulations for this awesome badass instructable! I haven't completed it yet, but both axis are working, and servo too. Now it's about handcrafting and building, which is nearly done too.

I am really interested on the arrow keys movement feature, which seems not to be working. I tried to fix it myself, struggling with the code, but most of what i read is like chinese for me :S Have you worked on that or know what issue causes it not to work? I'd still like to work on this if i get some clues hehe. Another issue is the Home key, which seems to do nothing.

Also...once i finish it i would like to add some stuff such as "end of stroke stop" if needed, (sry for my english if i'm making lots of mistakes u.u), temperature sensors, an lcd screen, and so on...

Once again, thank you very much for this instructable. Has been a several days awesome experience to work on something like this for the first time. Your explanations, steps and code were clear.


Hey... I have tried to build the same but getting some problems as my x or y axis gets stucked in between the operation and it mostly happens when they reach to their home position so please can you suggest what's wrong with it... 2nd image is the output which is generated due to this problem... Please help me out...


Very exciting. Can you share me the documents related the control step motor by Arduino ?

All files you will find on:

Currently I have no other files. I will prepare a video tutorial in English soon.
Stay tuned.

Best Regards.

Sorry for this problem

Copy and past the link in your brownser and it will work properly