Introduction: Low-Cost, Arduino-Compatible Drawing Robot

Picture of Low-Cost, Arduino-Compatible Drawing Robot

I designed this project for a 10-hour workshop for whose goal is to introduce teenage women to STEM topics. The goals for this project were:

  • Easy to build.
  • Easy to program.
  • Did something interesting.
  • Low-cost so participants could take it home and continue to learn.

With those goals in mind, here were a couple of the design choices:

  • Arduino compatible for ease of programming.
  • 4xAA battery power for cost and availability.
  • Stepper motors for accurate motion.
  • 3D Printed for ease of customization.
  • Pen plotting with Turtle graphics for interesting output.
  • Open Source so you could make one of your own!

Here is the robot that came closest to what I wanted to do: I don't have a laser cutter and shipping from England was prohibitive. I do have a 3D printer, so I guess you can see where this is going . . .

Don't let the lack of a 3D printer deter you. You can locate local hobbyists willing to help you out at

It took a lot of work, but I'm please with how it turned out. And, I learned quite a bit in the process. Let me know what you think!

Step 1: Parts

Picture of Parts

There are a number of ways to power, drive, and control robots. You may have different parts on hand that will work, but these are the ones I've tried and found to work well:


*Note: See the last step for a discussion on using regular Arduino or Raspberry Pi boards.


3D-Printed Parts (check out if you don't have access to a printer):

Tools and Supplies:

  • Phillips screw driver
  • Hot glue gun
  • Digital multi-meter
  • Sharp knife
  • Crayola colored markers

Step 2: Flash the Firmware

Picture of Flash the Firmware

Before we get too far into construction, lets load the test firmware on to the microcontroller. The test program just draws for boxes so we can check for proper direction and dimension.

To talk to the Trinket Pro, you are going to need:

  1. Driver from
  2. Arduino software from

Lady Ada and the Adafruit team have created a far better set of instructions in the links above than I can provide. Please use them if you are stuck.

Note: The one trick that makes the Trinket different from regular Arduino is that you have to reset the board before uploading the sketch.

Step 3: Pen Holder and Battery Holders

Picture of Pen Holder and Battery Holders
  1. Install the Pen Holder with the Servo Bracket on the shorter side of the chassis (Image 1).
  2. Insert the nuts on the top side of the chassis (Image 2)
  3. Attach the battery holders on the bottom of the chassis using 3Mx6mm flat-head screws (Images 3 & 4).
  4. Thread the battery leads through the rectangular cable runs (Image 4 & 5).
  5. Repeat for the other battery holder.

Note: Unless specified, the remainder of the screws are 3Mx8mm pan head srews.

Step 4: Wheels

Picture of Wheels
  1. Test fit your wheel to the stepper shaft (Image 1).
    1. If it is too tight, you can heat the wheel hub with a hair drier or hot air gun and then insert the shaft.
    2. If it is too loose, you can use a 3Mx8mm screw to hold it against the flat of the shaft (Image 2).
    3. If you are a perfectionist, you can calibrate your printer and get it just right.
  2. Place the o-ring around the rim of the wheel (Image 3 & 4).
  3. Repeat for the other wheel.

Step 5: Stepper Backets

Picture of Stepper Backets
  1. Insert a nut into the stepper bracket and attach them to the top of the chassis with a screw (Image 1).
  2. Insert the stepper into the bracket and attach with screws and nuts.
  3. Repeat for the other bracket.

Step 6: Caster

Picture of Caster
  1. Insert the ball bearing into the caster.
    • Do not force it in or it will break. Use a hair-drier or hot air gun to soften the material if needed.
  2. Attach the caster to the bottom side of the chassis in front of the battery holder.

Step 7: Breadboard

Picture of Breadboard
  1. Remove one of the power rails using a sharp knife, cutting through the bottom adhesive (Image 1).
  2. Holding the breadboard over the chassis rails, mark where they intersect the edge (Image 2).
  3. Using a straight edge (like the removed power rail), mark the lines and cut through the backing (Image 3).
  4. Place the breadboard on the chassis with the rails touching the exposed adhesive (Image 4).

Step 8: Power

Picture of Power
  1. Place the microcontroller, darlington driver, and power switch on to the bread board (Image 1).
    • I've added orange dots for visibility to mark the following:
      • Pin 1 of the darlington driver.
      • The battery pin of the microtroller.
      • The power switch "on" position.
  2. With the right-hand battery leads:
    1. Connect the red line to the first pin of the power switch (Image 2).
    2. Connect the black lead to an empty row between the microcontroller and the darlington chip (Image 2).
  3. With the left-hand battery leads:
    1. Connect the red line to the same row as the black lead of the other battery (Image 3).
    2. Connect the black line to the negative rail of the breadboard (Image 3).
  4. Connect power to the microcontroller:
    1. Red jumper from positive rail to the battery pin (orange dot, Image 4).
    2. Black jumper from the negative rail to the pin marked "G" (Image 4).
  5. Install batteries and switch the power on. You should see the green and red lights of the controller come on (Image 5).

Troubleshooting: If the microcontroller lights do not come on, immediately turn the power off and troubleshoot:

  1. Batteries installed in the correct orientation?
  2. Double check battery leads positioning.
  3. Double check switch leads positioning.
  4. Use a multi-meter to check voltages of batteries.
  5. Use multi-meter to check power rail voltages.

Step 9: Headers and Servo Wiring

Picture of Headers and Servo Wiring

Male header pins allow us to connect the 5-pin servo JST connectors to power and the darlington driver (Image 1):

  1. The first 5-pin header starts one row in front of the darlington driver.
  2. The second servo header should then line up with the end of the darlington driver.

Before the wiring gets to complicated, lets get the servo wired up:

  1. Add a 3-pin header for the servo on the right edge of the forward section of the breadboard( Image 2).
  2. Add a red jumper from the center pin to the positive side of the power rail.
  3. Add a black or brown jumper from the outer pin to the negative side of the power rail.
  4. Add a colored jumper from the inner pin to Pin 8 of the microcontroller.
  5. Install the servo horn with the shaft to the full clock-wise position and the arm extending to the right-side wheel (Image 3)
  6. Install the servo in the pen holder using the servo's screws (Image 3).
  7. Connect the servo connector aligning the colors (Image 4).

Step 10: Stepper Control

Picture of Stepper Control

Time to wire power for the darlington driver and steppers, which will be driven directly from the battery:

  1. Connect a black or brown jumper from the lower right darlington pin to the negative side of the power rail (Image 1).
  2. Connect a red jumper from the upper right darlington pin to the positive side of the power rail.
  3. Connect a red jumper from the upper left pin header to the positive side of the power rail (Image 2).
  4. Connect the left stepper connector to the left side pin header with the red lead on the right side (Image 3).
  5. Connect the right stepper connector to the right side pin header with the read lead on the left side.

Note: The red lead of the stepper connector is the power and should match the red leads on the breadboard.

Step 11: Stepper Control (Continued)

Picture of Stepper Control (Continued)

Now we will connect the stepper signal wires from the microcontroller to the input side of the darlington driver:

  1. Starting with Pin 6 of the microcontroller, connect the leads for four control jumpers for the left stepper motor (Image 1).
  2. Match these jumpers to the input side of the darlington on the right. All colors should match with the exception of green, which matches the pink wire of the stepper (Image 2).
  3. Starting with Pin 13 of the microcontroller, connect the leads for the four control jumpers for the right stepper motor (Image (3).
  4. Match these jumpers to the input side of the darlington on the left. All colors should match with the exception of green, which matches the pink wire of the stepper (Image 3).

Step 12: Testing and Calibration

Picture of Testing and Calibration

Hopefully you already uploaded the firmware in Step 2. If not, do it now.

The test firmware just draws a square repeatedly so we can check direction and accuracy.

  1. Place your robot on a smooth, flat, open surface.
  2. Turn the power on.
  3. Watch your robot draw squares.

If you are not seeing lights on the microcontroller, go back and troublshoot power as in Step 8.

If your robot is not moving, double check the power connections to the darlington driver in Step 9.

If your robot is moving erratically, double check the pin connections for the microcontroller and darlington driver in Step 10.

If your robot is moving in an approximate square, it is time to put some paper down and put a pen in it (Image 1).

Your calibration points are:

float wheel_dia=66.25;  // mm (increase = spiral out)
float wheel_base=112;   // mm (increase = spiral in)
int steps_rev=128;      // 128 for 16x gearbox, 512 for 64x gearbox

I started with a measured wheel diameter of 65 mm and you can see the boxes rotating inward (Image 2).

I increased the diameter to 67, and you can see it was rotating outward (Image 3).

I eventually arrived at a value of 66.25 mm (Image 4). You can see that there is still some inherent error due to gear lash and such. Close enough to do something interesting!

Step 13: Raising and Lowering the Pen

Picture of Raising and Lowering the Pen

We've added a servo, but haven't done anything with it. It allows you to raise and lower the pen so the robot can move without drawing.

  1. Place the pen collar on the pen (Image 1).
  2. If it is loose, tape it in place.
  3. Check that it will touch the paper when the servo arm is lowered.
  4. Check that it will not touch the paper when raised (Image 2).

The servo angles can be adjusted either by removing the horn and re-positioning it, or through the software:

int PEN_DOWN = 170; // angle of servo when pen is down
int PEN_UP = 80;    // angle of servo when pen is up

The pen commands are:


Step 14: Have Fun!

Picture of Have Fun!

I hope you made is this far without too many curse words. Let me know what you struggled with so I can improve the instructions.

Now it is time to explore. If you look at the test sketch, you will see I have provided you some standard "Turtle" commands:

forward(distance);   // millimeters
left(angle);         // degrees
done();              // release stepper to save battery

Using these commands, you should be able to do just about anything, from drawing snow flakes or writing your name. If you need some help getting started, check out:

Step 15: Other Platforms

Picture of Other Platforms

Could this robot be done with a regular Arduino? Yes! I went with the Trinket because of the low cost and small size. If you increase the chassis length, you can fit a regular Arduino on one side and the breadboard on the other (Image 1). It should work pin-for-pin with the test sketch, plus, you now can get to the serial console for debugging!

Could this robot be done with a Rasberry Pi? Yes! This was my first line of investigation because I wanted to program in Python, and be able to control it over the web. Like the full size Arduino above, you just place the Pi on one side, and the breadboard on the other (Image 2). Power becomes the primary concern because four AA is not going to cut it. You need to provide about 1A of current at a stable 5V, otherwise your WiFi module will stop communicating. I've found the Model A is much better on power consumption, but I'm still working out how to supply reliable power. If you figure it out, let me know!


ZbossMan (author)2016-06-06

I am making it today, could someone please answer my question quick.



MakersBox (author)ZbossMan2016-06-06

Check the information at to learn how to program it. The code you need to upload to the Trinket is attached to Step 2 ("TIRL_Trinket_TEST.ino").

ZbossMan (author)2016-06-06

Hello, awesome project! I was wondering how to program the robot, I do not understand why you gave little 3 lined list of code. Could you please define each function more clearly, thanks.


AlessandroP50 made it! (author)2016-06-02

Arduino drawing robot with remote!

MakersBox (author)AlessandroP502016-06-02

Nicely done! Thanks for sharing your success!

AmiineA (author)2016-05-17

Hello, its an amazing project, I was hoping to increase the speed of the motors is there any suggestions?

More Than the Sum (author)2016-03-18

This is awesome! I made it with and arduino Uno that has a prototype shield. I am attempting to write a function for arcs using an input for radius and degree. I have been partially successful, but haven't been able to match the inputs to what it is drawing. It could be my math is off. Have you had success with drawing arcs? Here is what i wrote if you are interested in seeing it.

I've done a little work on the Python version. I think the key is to just make it a 12 - 20 sided polygon which will look like circle.

HanooF (author)MakersBox2016-05-08

Hi.. I would like to know the structure of the robot where to find it

roroid (author)2016-01-27


First of all thanks for this great project. I printed all parts and procure all other electronics, but I have a issue. In Romania I can't find such o-rings that you are using. I was thinking to modify the wheels but the max o-ring i can find is with OD=40mm or 110mm.

Did someone successful use alternatives for this o-rings?


JoshB61 (author)2016-01-26

A few of us changed the microprocessor to the Adafruit Metro Mini (US $15) and Brian Silverman ported Logo to the turtle:

A couple of ideas to share:

- Any chance of you fixing the location of the ball bearing holder holes in the chassis so people do not have to drill their own?

- We found a wood shim between the stepper motor brackets improves the calibration considerably.

Thanks for the inspiration.

seancuttlefish made it! (author)2016-01-20

Hi, we are using this excellent robot as the main project for our Code Club in Leicester, UK. We've already reworked the chassis and added an ultrasonic sensor. Next we want to program it to draw autonomously. We'll let you know how we get on with it over the coming weeks. We're calling our version "Pollock" in honour of the American abstract expressionist! See for details.

SamuelR52 (author)seancuttlefish2016-01-22

What kind of ultrasonic sensor did you use? Could you post links to that sensor and any other sensors that can also be used?

MakersBox (author)SamuelR522016-01-22

Google "HC - SR04" (I don't know who to recommend buying from).

seancuttlefish (author)SamuelR522016-01-22

Hi. I used the classic HC-SR04 with four pins - 5v, gnd, ping and echo. Check out the NewPing Arduino library linked on the project GitHub page. Our Code Club starts up on Monday and I will post updates to the project on

AmiineA (author)2015-12-12


Well, I did the exacte same for mine and it works perfectly when i use the USB as a power supply. but when i use battries the steppers hardly move and they don't work as expected. Anyways I was wondring if you have any suggestions for me,

thanks alot sir :)

MakersBox (author)AmiineA2015-12-12

Sounds like a problem with the battery wiring. Check Step 8 and the troubleshooting ideas there.

AmiineA (author)MakersBox2015-12-13

Thanks for ur answer, but I don't think its a wiring problem because when i changed the program from kind of complexe to simple one (forward moving) everything went Okay :)

So please if there anyother suggestions let me know.

MakersBox (author)AmiineA2015-12-13

I would try some fresh batteries. Mine always starts acting a little crazy when the batteries get low.

AmiineA (author)MakersBox2015-12-13

Okay, I will try that...

Thanks alot

MakersBox (author)2015-12-12

Sounds like the battery circuit is not quite correct. Go back and check the troubleshooting steps in Step 8.

joshburker made it! (author)2015-12-10

I am part of the same group as Zachboston and enauman1. I got my Floor Turtle up and running today and started programming designs!

Our wiki has additional information:

Thanks for such an awesome project!


MakersBox (author)joshburker2015-12-10

Nice write up and thanks for the photos!

AmiineA (author)2015-11-28

Thanks for this awesome project, but how can I increase speed of the steppers?

MakersBox (author)AmiineA2015-11-28

The speed of the steppers is a function of their gear ratio and the delay time in the code (int delay_time=6; ). You can lower the delay time to increase the speed, but somewhere lower than 2 ms, it will be too fast for the steppers to physically keep up and they will stop moving.

AmiineA (author)MakersBox2015-11-28

Well, 3 ms will be good right?

enauman1 made it! (author)2015-11-25

This project is so awesome! Great design. One liberty I took on the materials is using elastic hair bands instead of the O-rings. As you can see my first calibration is quite off, maybe it's the hair bands. Great job, this is a really nice build to see come together.

MakersBox (author)enauman12015-11-25

Super cool! Thanks for posting a picture.

zackboston1 (author)2015-11-21


I'm part of a twitter team, where we all are trying to make these drawing bots! So your help would benefit 4 of us.

I printed out the Arduino-Uno-based .stl files by mistake. Are all the files for the Trinket-based one the same except for the chassis? Or do I need to reprint?

Power switch: It's on the photo but not in the list of parts. Which one did you use?

Capacitor: It's on the photo, used in the Arduino-Uno based one, but doesn't appear to be used in the Trinket based one. Can you tell me why?

Thanks so much for this instructable and any help you can give us!

zackboston for the Twitter Tinkerers/maker educators

MakersBox (author)zackboston12015-11-21

I'd be interested to hear more about your program.

The Arduino chassis has extra space and standoffs for the Arduino board. It will work fine for the Trinket. Everything else is identical.

The Trinket runs on 3.3V, and didn't really need the capacitor.

Sorry about the switch. You are the first person to catch that. I use a SPDT EG1218 slide switch (, but I bet this RadioShack one would work (, or you could just wire it straight and remove a battery to turn it off and on.

Send me some pictures. I'd like to start a "I built one page" to show what others have done.

zackboston1 (author)MakersBox2015-11-22

Oh it's not a program, it's just a bunch of geeky fun educators (some who know each other outside twitter, some who don't) who decided to build it together so we could support each other when we got stuck. We're communicating via a build wiki. I personally have been using various incarnations of drawing robots in my Learn 2 Teach, Teach 2 Learn program for about 8 years. I've (hangs head in shame!) never used a stepper motor & have been a little scared of them, so I thought that building this would hatch two birds from one egg --- seeing if we can use this in our program and facing my fears! smile. Thanks. We'll have more discoveries in the building that I will share with you.

BuzzGoodYear made it! (author)2015-11-02

The holes for the ball bearing caster are too close to the battery holder in the provided stl file.

LashaG (author)2015-10-31

Hi , can I use arduino Uno for tjis project?

MakersBox (author)LashaG2015-10-31

Yes! I just finished my instructable on that. Check out:

ybaggi (author)2015-10-24

do you by any chance have the stl files for the arduino based chassi?


MakersBox (author)ybaggi2015-10-24

I'm working on an Instructable for the Arduino version. Here is the chassis: I'm also including updated versions of the other parts.

I'm finding 5 AA needed to provide stable voltage from Arduino's 5V regulator. The holes will allow either a 2x or 3x on either side. I'm driving the steppers directly from the Vcc, and the servo from 5V.

If that doesn't make sense, hold on a couple days and I'll have it written up.

ybaggi (author)MakersBox2015-10-25

super, thanks a lot.

While sourcing my parts, I found that there are Arduino prototype shields.

for barely any money. and arduinos ar also only 3 or 4 bucks.

Soo thanks fot he updated 3D printer files and I'm looking forward to your next arduino update.


ybaggi (author)2015-10-24


I've printed out all the plastic parts on my Ultimaker 2.
I'm going to have a build day with this project at our Makerspace here.

As it printed out I came up with an interrogation.

Is there a technical reason why you made the robot in seveal piece?

Technically the chassis, pen holder and motor brackets could all be printed in one piece, couldn't they?

not that I think that would be simpler, but was wondering.


elexhack (author)2015-10-13

I think you are mistaken in step 10.

The lower right must be connected to positive rail of power supply, not ground, and the lower left must be connected to ground (and I suppose you are taking directions with reference to notch i.e. your orange color on top)

Steps 3 and 4 are good to go.

EricB44 (author)elexhack2015-10-24

As far as I can see. Text is confusing since it depends on your point if reference, the image is correct however (pin 9 connected to gnd).

iainc3 (author)2015-10-24

For an easy stable 5 volt power source for the raspberry pi, rechargeable phone chargers (or power banks) work great.

Gerile3 (author)2015-10-23

on step 8 can u explain switch connections.i couldnt able to power on board.

MakersBox (author)Gerile32015-10-23

I've added a schematic view to Step 8. Let me know if that helps or not.

Gerile3 (author)MakersBox2015-10-23

awesome it seems i made a wrong connection on second pin of switch thank you.

steve444 (author)2015-10-18

Could it draw a vector image?

MakersBox (author)steve4442015-10-18

By definition, that is what it is doing. As far as it reproducing something like an SVG image, that would take some serious code work.

elexhack (author)2015-10-11

int fwd_mask[][4] is the array to apply four set of pulses to motor to move in forward direction & int rev_mask[][4] to apply pulses to move in reverse direction. Am I right?

MakersBox (author)elexhack2015-10-11


elexhack (author)MakersBox2015-10-11

void right(float degrees){

float rotation = degrees / 360.0;

float distance = wheel_base * 3.1412 * rotation;

int steps = step(distance);

for(int step=0; step<steps; step++){

for(int mask=0; mask<4; mask++){

for(int pin=0; pin<4; pin++){

digitalWrite(R_stepper_pins[pin], rev_mask[mask][pin]);

digitalWrite(L_stepper_pins[pin], rev_mask[mask][pin]);






This is your function to rotate the bot to right. As far as I know, right motor should rotate reverse and left motor forward, in order to turn the bot right.

But you have applied rev_mask[mask][pin] array in both motors, that means both are rotating in reverse direction.

How far am I correct?

MakersBox (author)elexhack2015-10-12

Yes. Since the steppers orientation is mirrored, to move forward, you have to drive one forward and one backward. To turn, you drive them the same direction.

About This Instructable




More by MakersBox:OSH Park BadgeGeek SpinnerProgrammable POV Fidget Spinner
Add instructable to: