Check a Stepper Motor From the DVD-ROM © LGPL

The older members among you can still remember DVD-ROM drives well: let's take another look at the inner values of a past technology.

  • 48 respects

Components and supplies

maybe an old model from Desktop PC or Laptop or CD-ROM - what is lying around right now
Adafruit TB6612
12002 04
Breadboard (generic)
Ph a000066 iso (1) ztbmubhmho
Arduino UNO
or equivalent
Adafruit industries ada63 image 75px
9V 1A Switching Wall Power Supply
for separate power for the Stepper Motor
5V DC Power Adapter
1x - optional if you have the right Wall Power Supply
11026 02
Jumper wires (generic)

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

In my raids, I often come to projects where old CD-ROM or DVD-ROM drives are exploited (yep: round about year 2000 is old). Especially the stepper motor, which moves the read head, is used in projects where, for example, the self-construction of a CNC station is concerned. This is why it is so good because the existing mechanics - the guide slide - is already there and we expose ourselves to no danger to life and limb.

Let's Take a Closer Look at This Stepper Motor

I got four drives from a nearby electronics store that repairs desktop PCs:

  • one from a laptop,
  • one CD-ROM and
  • two DVD-ROM drives.

Unfortunately, I did not know what to look for, so I ventured directly to laptop drive. Every cable and every mini-screw is removed until I finally thought: huh - now you've found the stepper, but now you can not solder the necessary 4 control cables.


  • Not all CD/DVD ROM drives have steppers.
  • Sometimes you will find these also under the term "SLED engine".

What did I learn from this:

  • In addition to the current-carrying typical cables, broadband cables are also there to conduct signals and close circuits. Since these are also soldered to components or the PCB, do not just remove it.
  • Before you start get an overview of what you are actually looking for - because I had in advance no overview of what comes to me when disassembling the drives.

After that, I dismantled the other drives: first loosened the visible outer screws, worked them forwards over the front, and then carefully lifted the plastic inside out of the metallic body.

This brings us to our coveted target:

The stepper motor is the lower part with the shaft and the orange cable on it.

Wiring Arduino and Breakout Board

The wiring is not further explained here with Arduino and TB6612. Please have a look at this help. Here you will find information, also to other engine controls.

Pairing the 4 Stepper Cables

The pairing of the 4 cables can be determined for MotorA + CoinA - respectively MotorB + CoinB with several methods:

  • Coincidence - try it
  • Use your multimeter and set "Ohm"
  • Uses a LED - this lights when moving on the slide (demonstrated in the video)
Let's light the LED

Solder 4 cables either to the existing contacts of the motor or to the (here: orange) ribbon cable.

The quality of the carriage and the shaft is sometimes different: manufacturers save where they can and even manufacture the slide on one side of plastic. If the wave can be moved well by hand (= power off!), then you have a greasy film on your fingers.

Test it

Slow version: const int stepsPerRevolution = 20;
Fast version: const int stepsPerRevolution = 200;

What Else is There to Explore?

A small DC motor and a stopper component whose ends can be pressed in and thereby a trigger is set.

In addition the CD DVD Spindle engine, which brought the medium itself to the turning: a coil-wound motor, which is still sold today.

Useful in the End

* Datasheet for a typical motor

* DigiKey table for stepper motors with 499 results!

Now I have a few of these engines over - may someone take over? PM me!

I wish all the others a lot of fun in assembling their own CNC machine.

How Does It Work with PHPoC? (Update 23.01.2019)

If you've been working on PHPoC for a while, you can also do this setup with a PHPoC Blue / Black. An introduction to PHPoC can be found here.

Take the stepper motor expansion board PES-2405 piggyback on the blue board and following this guide for connecting the 4 cables or as explained directly in PHPoC tutorials. Check the pictures out.

Note that the example code can only be executed "local": this means that flashing the code via the PHPoC debugger (= IDE) causes an alert over the IP address of the board in the browser to an exit "0". You start the code using the play icon inside the IDE. That's all. ;-)

In general, make sure you have the latest release versions of PHPoC Debugger (v1.5.0), Expansion Board Firmware (v1.1) in case of PES-2405, and PHPoC Library (v2.2.1). Extract the ZIP archive and flash it to the board using PHPoC Debugger.

But Why Does the Sled Run Smoothly Over the Wave?

This question is answered by the PHPoC support using the example of mapping the Arduino example code into the PHPoC Blue command world as follows:

"In Arduino, speed unit is rotations_per_minute. In PES-2405, speed unit is micro_step_per_second. Now let's convert speed from rotations per minute to step per second:

  • We need to find the "steps_per_revolution" parameter on specification of motor.
    Note that some motor specification provide "Step_Angle", which means "angle_per_step". In this case, we can calculate:

steps_per_revolution = 360 / angle_per_step

  • Now we can convert speed from rotations per minute to step per second by using the following formula:

step_per_second = rotations_per_minute * steps_per_revolution / 60

  • Since PES-2405 use the micro-stepping method to control motor, this method have two advantages: Make motor move more smoothly and control motor more precisely. Why? Because one step on full-step control can be divided to a number of micro-steps. This increases resolution of step motor. A number of divided micro-steps can be specified via
spc_request_dev($sid, "set mode $mode"); 

command. You can refer more here

  • Now we need to calculate:

micro_step_per_second = step_per_second * $mode

In your code, you use $mode = 4.

=> now can set speed via command:

spc_request_dev($sid, "set speed $micro_step_per_second");

Since you already set speed in "set speed command", you do not need to set speed when you use "move" command. You just need:

spc_request_dev($sid, "move $steps");

Advanced Control

PES-2405 allows to set acceleration and deceleration via "set accel (accel) [decel]" command (see manual).

This is one of the factors make motor move more smoothly."

Thx support! You can follow the forum-thread to this topic here.


It works


Stepper Example TB6612 and ArduinoC/C++
fast version
#include <Stepper.h>

// change this to fit the number of steps per revolution for your motor
const int stepsPerRevolution = 200;  

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 4, 5, 6, 7);

void setup() {
  // set the speed at x rpm:
  // initialize the serial port:

void loop() {
  // step one revolution in one direction:

  // step one revolution in the other direction:
Stepper Example with PHPoC Blue & PES-2405 R2 Expansion BoardPHP

       exit; // avoid php execution via http request

    include_once "/lib/sd_spc.php";


    $sid = 1;
    $mode = 4;
    spc_request_dev($sid, "set mode $mode");
    spc_request_dev($sid, "set vref stop 2");
    spc_request_dev($sid, "set vref drive 8");
    spc_request_dev($sid, "set rsnc 120 250");

    $steps_per_revolution = 200;
    $micro_steps_per_revolution = $steps_per_revolution * $mode;

    // myStepper.setSpeed(2);
    $speed = 2 * $micro_steps_per_revolution;
    spc_request_dev($sid, "set speed $speed");

        // myStepper.step(stepsPerRevolution);
        spc_request_dev($sid, "move $micro_steps_per_revolution");
        while((int)spc_request_dev($sid, "get state"))


        // myStepper.step(-stepsPerRevolution);
        spc_request_dev($sid, "move -$micro_steps_per_revolution");
        while((int)spc_request_dev($sid, "get state"))



Similar projects you might like

Stepper - A First Introduction to Nema 17

by Ingo Lohs

  • 76 respects

Using Stepper Motor as Rotary Encoder

by Andrewf1

  • 1 comment
  • 27 respects

Large Stepper Motor Control A4988

Project tutorial by 3 developers

  • 12 respects
Add projectSign up / Login