loading

I designed this project for a 10-hour workshop for ChickTech.org 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: http://mirobot.io. 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 https://www.3dhubs.com/.

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

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:

Electronics:

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

Hardware:

3D-Printed Parts (check out www.3dhubs.com 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

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 https://learn.adafruit.com/introducing-pro-trinket...
  2. Arduino software from https://learn.adafruit.com/introducing-pro-trinket...

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

  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

  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

  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

  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

  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

  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

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

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)

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

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

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:

penup();
pendown();

Step 14: 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
backward(distance);
left(angle);         // degrees
right(angle);
penup();
pendown();
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

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!

<p>I am making it today, could someone please answer my question quick.</p><p>Thanks,</p><p>BossBoy</p>
<p>Check the information at https://learn.adafruit.com/introducing-pro-trinket/overview to learn how to program it. The code you need to upload to the Trinket is attached to Step 2 (&quot;TIRL_Trinket_TEST.ino&quot;).</p>
<p>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.</p><p>-BossBoy</p>
<p>Arduino drawing robot with remote!</p><p>https://youtu.be/mmCL_TnVYxM</p>
Nicely done! Thanks for sharing your success!
<p>Hello, its an amazing project, I was hoping to increase the speed of the motors is there any suggestions?</p>
<p>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. http://bit.ly/1PgRqCW</p>
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.
<p>Hi.. I would like to know the structure of the robot where to find it</p>
<p>Hi,</p><p>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. </p><p>Did someone successful use alternatives for this o-rings?</p><p>Thanks.</p>
<p>A few of us changed the microprocessor to the Adafruit Metro Mini (US $15) and Brian Silverman ported Logo to the turtle:</p><p><a href="http://monograph.io/joshburker/logoturtle" rel="nofollow">http://monograph.io/joshburker/logoturtle</a></p><p>A couple of ideas to share: </p><p>- 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?</p><p>- We found a wood shim between the stepper motor brackets improves the calibration considerably.</p><p>Thanks for the inspiration.</p>
<p>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 &quot;Pollock&quot; in honour of the American abstract expressionist! See http://interactdigitalarts.uk/pollock for details.</p>
<p>What kind of ultrasonic sensor did you use? Could you post links to that sensor and any other sensors that can also be used?</p>
Google &quot;HC - SR04&quot; (I don't know who to recommend buying from).
<p>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 http://interactdigitalarts.uk/pollock</p>
<p>Hello,</p><p>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,</p><p>thanks alot sir :)</p>
<p>Sounds like a problem with the battery wiring. Check Step 8 and the troubleshooting ideas there.</p>
<p>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 :)</p><p>So please if there anyother suggestions let me know.</p>
<p>I would try some fresh batteries. Mine always starts acting a little crazy when the batteries get low.</p>
<p>Okay, I will try that...</p><p>Thanks alot</p>
<p>I am part of the same group as Zachboston and enauman1. I got my Floor Turtle up and running today and started programming designs!</p><p>Our wiki has additional information: <a href="http://joshburker.pbworks.com/w/page/103156198/Logo%20Turtle%20Robot" rel="nofollow">http://joshburker.pbworks.com/w/page/103156198/Log...</a></p><p>Thanks for such an awesome project!</p><p>You </p>
<p>Nice write up and thanks for the photos!</p>
<p>Thanks for this awesome project, but how can I increase speed of the steppers?</p>
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.
<p>Well, 3 ms will be good right?</p>
<p>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.</p>
<p>Super cool! Thanks for posting a picture.</p>
<p>Hello!</p><p>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.</p><p>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? </p><p>Power switch: It's on the photo but not in the list of parts. Which one did you use?</p><p>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?</p><p>Thanks so much for this instructable and any help you can give us!</p><p>zackboston for the Twitter Tinkerers/maker educators</p>
I'd be interested to hear more about your program.<br><br>The Arduino chassis has extra space and standoffs for the Arduino board. It will work fine for the Trinket. Everything else is identical.<br><br>The Trinket runs on 3.3V, and didn't really need the capacitor.<br><br>Sorry about the switch. You are the first person to catch that. I use a SPDT EG1218 slide switch (https://www.digikey.com/product-detail/en/EG1218/EG1903-ND/101726), but I bet this RadioShack one would work (https://www.radioshack.com/products/dpdt-6vdc-slide-switch-1?variant=5717494213), or you could just wire it straight and remove a battery to turn it off and on.<br><br>Send me some pictures. I'd like to start a &quot;I built one page&quot; to show what others have done.
<p>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 &amp; 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. </p>
<p>The holes for the ball bearing caster are too close to the battery holder in the provided stl file.</p>
<p>Hi , can I use arduino Uno for tjis project? </p>
Yes! I just finished my instructable on that. Check out:<br>https://www.instructables.com/id/Arduino-Drawing-Robot/
<p>do you by any chance have the stl files for the arduino based chassi?</p><p>Thanks</p>
I'm working on an Instructable for the Arduino version. Here is the chassis: http://www.thingiverse.com/thing:1091401. I'm also including updated versions of the other parts.<br><br>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.<br><br>If that doesn't make sense, hold on a couple days and I'll have it written up.<br><br>
<p>super, thanks a lot.<br><br>While sourcing my parts, I found that there are Arduino prototype shields.</p><p><a href="http://www.ebay.com/itm/1PCS-UNO-R3-Prototype-Prototyping-Shield-ProtoShield-Mini-Breadboard-Arduino-x-/181846902070?hash=item2a56eb8536:g:QdwAAOSw3ydV4B0W">http://www.ebay.com/itm/1PCS-UNO-R3-Prototype-Prot...</a><br><br>for barely any money. and arduinos ar also only 3 or 4 bucks.<br><br>Soo thanks fot he updated 3D printer files and I'm looking forward to your next arduino update.<br><br>cheers</p>
<p>Hello,</p><p>I've printed out all the plastic parts on my Ultimaker 2.<br>I'm going to have a build day with this project at our Makerspace here.</p><p>As it printed out I came up with an interrogation.</p><p>Is there a technical reason why you made the robot in seveal piece?</p><p>Technically the chassis, pen holder and motor brackets could all be printed in one piece, couldn't they?</p><p>not that I think that would be simpler, but was wondering.</p><p>cheers</p>
<p>I think you are mistaken in step 10.</p><p>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)</p><p>Steps 3 and 4 are good to go.</p>
<p>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).</p>
<p>For an easy stable 5 volt power source for the raspberry pi, rechargeable phone chargers (or power banks) work great.</p>
<p>on step 8 can u explain switch connections.i couldnt able to power on board.</p>
<p>I've added a schematic view to Step 8. Let me know if that helps or not.</p>
<p>awesome it seems i made a wrong connection on second pin of switch thank you.</p>
<p>Could it draw a vector image? </p>
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.
<p>int fwd_mask[][4] is the array to apply four set of pulses to motor to move in forward direction &amp; int rev_mask[][4] to apply pulses to move in reverse direction. Am I right?</p>
Yep.
<p>void right(float degrees){</p><p> float rotation = degrees / 360.0;</p><p> float distance = wheel_base * 3.1412 * rotation;</p><p> int steps = step(distance);</p><p> for(int step=0; step&lt;steps; step++){</p><p> for(int mask=0; mask&lt;4; mask++){</p><p> for(int pin=0; pin&lt;4; pin++){</p><p> digitalWrite(R_stepper_pins[pin], rev_mask[mask][pin]);</p><p> digitalWrite(L_stepper_pins[pin], rev_mask[mask][pin]);</p><p> }</p><p> delay(delay_time);</p><p> } </p><p> } </p><p>}</p><p>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.</p><p>But you have applied rev_mask[mask][pin] array in both motors, that means both are rotating in reverse direction.</p><p>How far am I correct?</p>
<p>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.</p>
<p>Cool. Thanks</p>

About This Instructable

63,838views

590favorites

License:

More by MakersBox:Easy Joule Thief Soldering Project Using an Arduino Drawing Robot with Hour of Code Tutorials Arduino Drawing Robot 
Add instructable to: