XY Plotter Drawing Robot | Arduino | Polargraph




About: Arduino, Raspberry Pi, esp8266, Tutorials, Projects

In this tutorial we will learn how to make X Y Plotter Drawing machine. With Drawing Robot you can draw images on wall, panel or A4 paper. You can print pictures or print text. All required hardware for this project are listed below. We will learn how to install and use the Polargraph program for robot control. Video editing of this project took a lot of time. I hope the video will be useful to you. If you want, you can subscribe to the my channel for support.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Required Hardwares

Arduino Board -- http://bit.ly/2xt9MVk

L293D Motor Shield -- http://bit.ly/2H7vmy9

L293D Motor IC -- http://bit.ly/2J4N3jD

17 Stepper Motor -- http://bit.ly/2J0xqhf

Servo Motor -- http://bit.ly/2JfGtuj

GT2 Pulley 16 Teeth Set -- http://bit.ly/2H9DoXq

GT2 Rubber Belt (5M) -- http://bit.ly/2Lfc0tJ

DC Power Supply -- http://bit.ly/2sotn4i

Adapter Power Supply -- http://bit.ly/2syTLHA

Board Marker Pen -- https://goo.gl/vP6jkm

Jumper Wires -- http://bit.ly/2J6de9E

Lead Weight -- https://goo.gl/vP6jkm

Anet® A8 3D Printer -- http://bit.ly/2J18Ahn

3D Printer not Available

Stepper Mounting Bracket -- https://goo.gl/EEjirC

CD for Gondola

Arduino Starter Kit and Supplies (Optional):

Arduino Basic Learning Starter Kit #01 -- http://bit.ly/2sxyG0v
Arduino Basic Learning Starter Kit #02 -- http://bit.ly/2Lf5ToV

Arduino Basic Learning Starter Kit #03 -- https://amzn.to/2sqQ47X

Mega 2560 Ultimate Starter Kit with Tutorial -- https://amzn.to/2Jkdtl7


Sensor Module Kit For Arduino #01 -- http://bit.ly/2JanxK7

Sensor Module Kit For Arduino #02 -- http://bit.ly/2J93QCg


Arduino Board & SCM Supplies #01 -- http://bit.ly/2J2AFF7

Arduino Board & SCM Supplies #02 -- http://bit.ly/2Hb1NvD

Step 2: 3D Models - Plotter Gondola and Stepper Bracket

  • You can find many models on the Thingiverse platform.
  • Links of the models used in this project as below.

Gondola 3D Model -- https://goo.gl/cu7ry7

Stepper Mounting Bracket 3D Model -- https://goo.gl/1yLiZh

  • If a 3D printer is not available, you can use a CD for create the Gondola

Step 3: Assembly of the Gondola, Stepper Motors and Servo

  • Belts connect to the Gondola. (Adjust the length of the belts according to size of your board.)
  • Servo motor connect to the Gondola
  • Assembly the mounting brackets to the stepper motors.
  • Attach a weight to the empty end of the belts (I used 4xAA batteries for weight.)

Step 4: Assembly All Parts on the Board

  • Fix the stepper motors to the upper right and upper left corner of the board.
  • Fiz the servo motor and pen to the gondola.
  • Connect enough weight to the empty en of the belts.
  • Also use a weight to hang the gondola down. (This weight may be coins or batteries.)

Step 5: Machine Dimensions

  • Remember that your machine size is NOT the same as your surface siz.
  • Your PAGE or drawing AREA size will be smaller.
  • Machine Width:

This is the distance between two closest points on the sprockets (between two pulleys).

  • Machine Height:

This is the distance from the sprocket axis to bottom of your drawing (board) area.

  • Home Point:

This is a magic point marked on the centerline, exactly 120mm (12cm) down from the top edge of your machine.

  • Keep the dimensions of your machine. We will use these values in the software section.

Step 6: Connections

  • We use a high-torque stepper motors with the L293D motor driver, so the L293D integration overheated.
  • We should upgrade the L293D motor driver before connecting. You can watch the following tutorial for this.

Tutorial - L293D Motor Shield Upgrade for the High-Torque Stepper Motor

  • After L293D upgrade, make connections according to the circuit diagram above.

Step 7: Source Code and Polargraph

  • Download and install Processing version 1.5.1 -- https://processing.org/download/
  • Download and install Arduino IDE version 1.0.5 -- https://www.arduino.cc/en/Main/OldSoftwareReleases
  • Finally, download the following compressed file for Polargraph 1.2 and its libraries.

  • Copy the libraries to be used for the Arduino source code. (Copy the libraries in the Polargraph libraries folder to the Arduino libraries folder.)
  • Find the source code to use for the Arduino. (Open the cource code in the Polargraph/ arduino-source/ polargraph_server_a1 folder.)
  • Upload the polargraph_server_a1.ino source code to the Arduino.
  • Then open the Processing software. Find the SketchBook folder from file / preferences/ sketchbook/ location
  • Find the Processing libraries in the Polargraph folder. Copy all the library folders in this folder into the libraries folder in the Processing Sketchbook folder.
  • Move the Polargrapcontroller folder inside the Polargraph folder/ processing-source/ folder into the sketchbook folder.

Define first settings - Machine dimensions

  • Open Processing. Then open polargraphcontroller (file -> sketchbook -> polargraphcontroller)
  • Run the program by pressing the Run button.
  • Enter the Setup section from the tool bar.
  • Adjust the size between two pulleys on the Machine Width
  • Adjust the Machine Height (height between the pulleyand the end of the panel)
  • After machine dimensions, adjust the size the area you will draw. (If ou will draw on an A4 paper, set the A4 size.)
  • Then, first clicthe Center Page and then set the Page Pos Y value 120.
  • Secondly click Center Home Point and set Home Pos Y value 120.

Stepper motor and pulley settings

  • Set the MM Per Rev value according to the pulley and belt you are using. For example, if the belt is GT2 the lue is 2mm. If the pulley has 16 teeth, 2x16 = 32mm. So, the belt will advance 2mm each turn.
  • Adjust Steps Per Rev according to the stepper motor type. For example, if te step angle of the used stepper motor is 1.8 degrees the value is 200 steps. This value is adjust to 400 because dual motor is used.

Servo motor (Pen) settings

  • Pen Up Position and Pen Down Position values are the operating angle of the servo motor.
  • Click Serial Port and select Arduino's port from the list of connected devices.
  • When the correct port is selected, the 'No Serial Connection' display will turn GREEN and the port number to which it is CONNECTED will be displayed.
  • Click on 'Command Queue' and command transmission is activated.
  • Click Upload Lift Range, then click Test Lift Range and test the servo motor angle.

Last Settings - Upload vector image and start the print

  • Save your setting. Load your setting every time you turn on the program.
  • Click the Input tab and switch to the main screen of the program.
  • Then we will anually set the gondola for 'Set Home' manually. Move the gondola by manually and move it to the previously defined home point. The gondola must be adjusted this way before each drawing before clicking 'Set Home'.
  • After this adjustment is done, Set Home and Set Pen Position are clicked.
  • Click Set Area to specify your drawing are. Then click Set Frame to Area to make all necessary settings for drawing.

Draw Vector

  • Find any vector drawing image. Convert image to the SVG format from any converter platform.
  • After select Load Vector from program. Adjust image size with Resize Vector. Move the image to the desired area with Move Vector. Then adjust the area to be printed with Select Area and Set Frame to Area.
  • Finally, click the Draw Vector command to start the machine.

3 People Made This Project!


  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

48 Discussions


Question 5 weeks ago

All works perfectly ! Only 2 things to clarify:
1- what are the advantages to use arduino mega? (If any)
2- ti draws perfectly but all of my images seem rotated by 8/9 deg counterclockwise direction, if I draw a simple square it’s cristal clear. Any ideas?

Thanks in advance

andrea tecno

Question 3 months ago

S ragazzi, qualcuno di voi usando arduino uno ha trovato problemi con la libreria EEPROMAnything ? io credo che il mio problema sia tale libreria che è possibile non sia aggiornata coni drivers

1 answer
VũP24andrea tecno

Answer 6 weeks ago

you not yet copy library of polargragh into library of sketch processing


Question 3 months ago

Polargraphcontroller give me error, who can help?


6 months ago

After removing jumper between board and shield while arduino is connected to laptop(for getting processing commands) ,is it necessary to give extra 9V supply(by battery) to arduino(as shown in your circuit diagram).


Question 7 months ago

Can I use two different motors?


Question 8 months ago on Step 1

Can someone tell me how i connect the Arduino to the stepper motor shiled. if is not clear in the connections. if i become a premium member and download the PDF will that have more information? This is what I have built so far - see image - it is a Steam Punk version. Alo what pen fits the triangular gondola opening -I tried the Faber Castel, but it is too fat....


9 months ago

Salut, je me retrouve avec un dilemme avec processing, impossible de lancer le programme dessus

Capture d’écran 2018-12-31 à 13.06.51.png

1 year ago

why is it that i can move to the pen whitin the area of the machine but when I upload the vector inside that area, it shows error that the points fall out of the machine ,skipping it.!!!!

Any help is highly appreciated.

3 replies

Reply 9 months ago

i have the same error, can someone help please, i need to finish this proiect


Reply 1 year ago

Have you find solution for this ?
I've tried different computers and boards . Still not working;


Question 1 year ago

Is there a cheaper way with the DC Power Supply? Do I really need one?

1 answer

Answer 12 months ago

Definitely. Just get yourself a AC-DC wall "wart" plug in that supplies the required V (voltage) and A (amperage) - To be safe, I'd go a little above the required amperage to ensure the power brick doesn't get hot.


1 year ago

arduino IDE 1.0.5 link plz

Can only find 1.0.5-r2


1 year ago

I go this error message how can I fix it.

Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Uno"

polargraph_server_a1:157: error: 'multiplier' was not declared in this scope

float mmPerStep = mmPerRev / multiplier(motorStepsPerRev);


polargraph_server_a1:158: error: 'multiplier' was not declared in this scope

float stepsPerMM = multiplier(motorStepsPerRev) / mmPerRev;


exit status 1

'multiplier' was not declared in this scope

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

2 replies

Reply 1 year ago

Did you you install the new version of Arduino and processing or the one that was mentioned in the instructions ?


1 year ago

My Polargraph works fine but for few minutes only!

After a short whuile of drawing both of the Arduino Uno and LM293D motor shield boards get too hot causing the USB to disconnect .

I have tried 12v -1A and 5v 750ma, both of which resulted in the same thing!!!

Upgraded motor shield as well.

Does anybody know what is the problem?

Could it be faulty board?


Question 1 year ago

Hello everyone.

Is it possible to make the Polargraph work using A4988 drivers?

If yes how should it be connected and do I need to change the code?