Skip to content

Drawing Robot

A marker holder, the "gondola", hangs on an upright whiteboard. Four stepper motors at the corners of an aluminum frame pull it around on timing belts, and the Arduino works out how long each belt has to be for every point. By the end, you send it a picture or a line of text from your laptop and it draws it.

How it works

flowchart LR
    A[Laptop<br/>Python bridge] -- "M x y / U / D" over USB --> B[Arduino Uno<br/>your code]
    B -- "point → belt lengths → steps" --> C[CNC Shield V3<br/>4 × A4988]
    P[24 V supply] --> C
    C --> M1[Top-left motor]
    C --> M2[Top-right motor]
    C --> M3[Bottom-left motor]
    C --> M4[Bottom-right motor]
    M1 & M2 & M3 & M4 -- belts --> G[Gondola + marker]
    B -- pin 9 --> S[Servo: pen up / down]
    S --> G

Each motor winds or unwinds a belt. If you know where the gondola is, the length of each belt is one line of Pythagoras: the belt is the hypotenuse, and the sides are the horizontal and vertical distances from the motor to the pen. Change the lengths and the pen moves. A straight line is many short moves in a row.

You start with only the top two motors. Gravity keeps those two belts tight, and that machine (a "polargraph") already draws. Then you add the bottom two belts, each with a small spring, so the gondola is held from all four sides and can move faster.

The six classes

Class By the end of class
1 · Frame and one motor The frame is bolted around the board, the drivers are set, and one motor moves a belt a measured distance.
2 · Gondola and two belts The gondola hangs on the top two belts and goes to points you name in millimeters.
3 · Lines and shapes It draws straight lines, a square, a circle and your initials, lifting the pen between shapes.
4 · All four motors Four belts hold the gondola, and it draws a picture stored in your code, faster than before.
5 · Pictures from the laptop A Python script on the laptop sends points over USB and the robot draws text or a line drawing.
6 · Polish and showcase It draws something live, reliably, in front of people.

Before Class 1

  • Start the motor mounts in Onshape. A NEMA 17 motor has a 42 mm square face, four M3 holes on a 31 mm square, and a 22 mm round boss in the middle. Measure the hole size and spacing on your 2×1 tube with calipers rather than trusting a drawing. Print one mount and test-fit it before printing four.
  • Start the gondola in Onshape too. It holds a dry-erase marker, has four belt attachment points close to the pen tip, and has a spot for the kit's servo. Leave the servo mount simple; you'll change it once you see how the pen lifts.
  • Find the Ender 3. Look at how the motors, belts, pulleys and power supply come off before you take anything apart. Take photos as you go.

Where Claude Code fits

You write the Arduino code: the belt-length math, the stepper moves, the pen lift and the Serial commands. Those are the project.

Claude Code is allowed for one piece only: the bridge in Class 5, a Python script on the laptop that turns an SVG file or a line of text into a list of points and sends them over Serial. Python and SVG parsing are new and not what this course is about, so that's where help is worth it. You define the commands the script sends; the script follows your rules, not the other way around.

Credits

  • The two-belt design is a polargraph, a hanging-pen plotter that makers have been building for years. Say so on your poster.
  • AccelStepper and MultiStepper are by Mike McCauley (documentation).
  • The motors, pulleys and power supply come from a Creality Ender 3 printer.