Introduction
The goal of this small project is to measure and display the speed of a Brushless DC (BLDC) motor, salvaged from an old hard disk drive (HDD). The setup involves using an Arduino Nano to generate a PWM signal that controls an Electronic Speed Controller (ESC), driving the BLDC motor. The speed of the motor is measured using a tachometer with an IR sensor, and the number of revolutions is displayed on a graphic module.
Components Used
- Arduino Nano
- ESC (Electronic Speed Controller) from Ali
- Hard Disk Drive (HDD)
- Tachometer (see here)
- LiPo Battery (2S-4S)
Schematics

Testing the PWM Output
Test the PWM output of your Arduino. You should get a signal with a frequency of 50 Hz and a pulse width between 1ms and 2ms, depending on the position of your potentiometer. The frequency should remain constant, and the voltage should be around VCC (5V).

Preparing the BLDC Motor
Remove Electronics: Once you have your HDD, remove any electronics and solder four wires to the motor (See here). Three wires will connect to the ESC, and the fourth wire is the common (NOT GROUND!!). This wire will be connected to an oscilloscope later for phase measurements.
Safety First: An oscilloscope is an earthed device. If you are unsure about using such a device, stop here to avoid any dangerous situations. For safer operation, use a battery-powered oscilloscope. This is why I use a battery to power the entire system. You have been warned!
Prepare the Disc: On the other side of the HDD (See here), glue a black stripe. Make sure you did a backup of your data :-). This stripe will work with the tachometer (See here).
Mount the Sensor: Stick the sensor through the lid by making a hole. The sensor should be close to the disk surface, about 3–4 mm. Don’t close the lid just yet (here and here).
Connecting Everything Together
- Initial Setup: Ensure your potentiometer is set to the lowest speed to prevent the security feature from shutting down the ESC if you try to start at full speed.
- Start Slowly: Gradually increase the speed. If you start hearing noise, manually spin the disk. The motor may need a nudge to start because it lacks hall sensors or other means to determine the direction. You may need to try a few times before it begins to spin.
- Final Setup: Attach the tachometer and close the lid. If everything is working correctly, you should see the number of revolutions displayed on the screen.
Calculating the Number of Pole Pairs p
If you know the frequency of the back EMF, and the speed of your motor S, you can calculate p:
p = f_backEMF / S
The tachymeter measured 75 revolutions per second.
p = 450.4 / 75 = 6
The oscilloscope is connected between a phase and the star connection common of the BLDC motor (not the ground of your circuit). Make sure again you know how to deal with an earthed oscilloscope because bad things may happen!

The number of poles N is therefore 2p = 12.
You can now calculate the speed of this motor knowing N.

Happy calculating!