ElectronParade

Project 20: Mini Arduino CNC Plotter

Have a couple of old, broken DVD or CD-ROM drives collecting dust? Don’t throw them out! Hidden inside those drives are highly precise, miniature stepper motors on sliding rails—the perfect mechanical foundation for a homemade CNC machine.

In this project, we are going to build a Mini Arduino CNC Plotter. We’ll extract the X and Y axis mechanisms from the optical drives, add a micro servo to lift a pen (the Z-axis), and use an Arduino Uno combined with an L293D Motor Drive Shield to control it all. By the end, your robot will be able to draw text and vector graphics right on your desk.

What You’ll Learn

Parts Required

Here are the specific components used in this build:

Step 1: Salvaging the Stepper Mechanisms

Salvaged DVD Drive Stepper Mechanism

The first step involves a bit of destructive engineering. Open up your two old DVD drives and carefully extract the optical laser sleds. You’ll notice a small stepper motor attached to a threaded rod, which moves the laser back and forth.

  1. Cut the ribbon cables attached to the motors (leave enough length to solder jumper wires to them).
  2. The stepper motor will have 4 pins. Use a multimeter in continuity mode to figure out which pairs of pins belong to Coil A and Coil B.

Step 2: Building the Chassis

We need to mount our two axes perpendicularly.

Step 3: Wiring the Motors

L293D Motor Drive Shield on Arduino

Stack the L293D Motor Shield onto your Arduino Uno.

  1. X-Axis Stepper: Connect the 4 wires of your X-axis motor to the M1 and M2 terminal blocks on the motor shield.
  2. Y-Axis Stepper: Connect the 4 wires of your Y-axis motor to the M3 and M4 terminal blocks.
  3. Z-Axis Servo: Plug the servo into the SERVO 1 header on the shield.
  4. Connect your external 12V power supply to the EXT_PWR terminals on the shield. Crucial: Remove the power jumper on the shield so you don’t fry your Arduino’s USB port!

Step 4: The Software (Grbl and G-Code)

To make this work, we won’t be writing an Arduino sketch from scratch. Instead, we use specialized firmware designed for CNC machines.

However, standard Grbl firmware is designed for dedicated CNC stepper drivers (like A4988s), not the L293D shield. Because of this, we must use a modified firmware called AFMotor Grbl or a custom processing script.

Here is the complete software stack you will need:

  1. Firmware: Download the custom GRBL for L293D / Servo repository from GitHub. Extract it, add it to your Arduino libraries, and upload the grblUpload.ino sketch to your Arduino.
  2. Sender: Download a G-Code sender program like Universal Gcode Sender (UGS) to stream the instructions from your PC to the Arduino.
  3. Generator: Generate your G-Code files using Inkscape combined with the MakerBot Unicorn G-Code Output extension.

Step 5: Calibration and Plotting

Once the software is running:

  1. Turn on the power supply.
  2. Load a simple G-Code file into your Universal Gcode Sender.
  3. Watch as your upcycled optical drives magically recreate your digital drawing in the real world!

Pro-Tip: You may need to tweak the steps-per-millimeter in the software settings via UGS (e.g. $100 and $101 settings), as different DVD drive motors have slightly different thread pitches on their rods.

Enjoy your very own desktop robot artist!