Introduction: Arduino Drawing Machine

About: Hello!

Hello, I hope you're doing well. I'm Noah. I'm currently an eighth grader. This is a project that I have worked on for the past 5 months. Some steps are hard to explain, so I hope the pictures will help y'all. I know many of these machines have an imported application, but I used code for mine. I must state, this will be slower, and more simplistic than the other drawing machines. If you are looking for a high-quality machine, I recommend viewing others' projects. Thank you very much, have fun throughout this project!

Supplies

  • Arduino Uno Board
  • Timing Belt and Bearings
  • 12v Motors (x6)
  • 12v power supply (x3)
  • Motor Driver L298N (x3)
  • Jumper Wires
  • Breadboard
  • Wooden or Metal Rods (x8)

Step 1: Set Up Your Frame

It is important to start with the framework in order to mount each of the 4 motors. This will allow us to secure the slider that will hold the drawing utensil in future steps.

  1. Cut 4 blocks of wood. The blocks should be about 2-3 inches tall. If you don't have access to certain wood an 'L' shaped cut will work.
  2. Attach the rods to form a square like shown in the diagram. It should form a square, 4 blocks on the corner, attached by 2 rods on each side.
  3. Attach 4 motors, one to each corner of the frame. Attach your bearings to the motors. Two should be perpendicular, both pairs on opposite sides.

Step 2: Making Your Sliders

This will make 2 pieces attached by one. This will be the part that the motors will manipulate.

  1. Attach timing belt to both bearings on both pair. This will make two perpendicular lines with the timing belts.
  2. 3d print a piece that had two holes in the middle of it. Slide both rods through the holes. If you don't have access to a 3d printer like me, a smooth surface such as Legos or wood will work. I found Legos to work better.
  3. Attach 2 motors on top of the 3d printed sliders, perpendicular to each other just like the other ones.

Refer to the attached images.

Step 3: Wire Your Circuit

Wire your circuit.

  1. Motor pins, pos and neg, ENA controls, 12v power supply, and Arduino power supply attached to motor driver L298N.
  2. Repeat with all motors.
  3. Pretty much wire the diagram, use two motors on the motor driver, and connect it to the motors' locations.
  4. Credit to Pinterest

Step 4: Create Your Code

The following code is linked below. This is an algorithm that will run through each coordinate and plot it out.

  1. Establish your variables, such as motor pins, timers and ENA speeds. This is necessary for both X and Y motors on each axis.
  2. Define your timers. This can be done by the value of a coordinate minus the previous coordinate, multiplied a certain amount of time (ms). This must be done for X and Y.
  3. Establish your pins as OUTPUT. All data comes from the computer.
  4. Run your first coordinates by 'digitalWrite', and delay by your timer for the specific coordinate. This means it will power your motor pins for the amount of the variable, 'timer', in milliseconds.
  5. Clarify which direction the motor will turn. If your current coordinate is greater than the previous, this means the x and y coordinate are increasing. Then run it for the amount of time of your current timer, minus the previous.
  6. For negative the procedure will be vice versa. power your motor in a negative direction. The algoritim is:

if (xx-x>0) {

digitalWrite(posPin, HIGH);

digitalWrite(negPin, LOW);

}


Repeat for ALL scenarios.


This is as simple as I can describe it. The code looks for the difference of your current coordinate and finds if both X and Y are increasing or not. It powers the motors accordingly. The code is linked to have a better idea of the algorithm.

Step 5: How It Works

Enter a drawing into a graphing calculator. Input the coordinates into the designated spot. Run the code, and the machine will draw it out.


Thank you for viewing this project. I hope you are doing well and have a great time making this. Feel free to ask any questions!

Electronics Contest

Participated in the
Electronics Contest