2 HP DC MOTOR ADJUSTABLE SPEED CONTROL

Photo of author

By Jackson Taylor

Home » Electronics Topics » Power Electronics » 2 HP DC MOTOR ADJUSTABLE SPEED CONTROL

As an Amazon Associate we earn from qualifying purchases.

A 2 HP DC motor is a serious piece of hardware. Being able to change its speed smoothly makes it useful for workshop machines, conveyors, pumps and other equipment that needs variable speed. This article shows a simple and popular way to do it: pulse width modulation (PWM) from an Arduino, set by a potentiometer.

The video below shows the project working. The circuit and the code follow, with notes on how the system works and what to check before you connect a motor of this size.

How adjustable speed control works

The speed of a DC motor depends mostly on the average voltage across its armature. Lower the average voltage and the motor slows down. Raise it and the motor speeds up.

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video

PWM does this without wasting power as heat. A switch (usually a MOSFET or IGBT) turns the supply on and off many times per second. The duty cycle is the share of each cycle the switch stays on. A 25% duty cycle gives roughly a quarter of the supply voltage on average, and a 90% duty cycle gives most of it. The motor’s inductance smooths these pulses into a fairly steady current.

What you need

  • An Arduino board with a PWM-capable pin (the code below uses pin 11)
  • A potentiometer to set the speed
  • A power switching stage rated for the motor’s voltage and current, such as a MOSFET or IGBT with a gate driver
  • A flyback (freewheel) diode across the motor
  • A suitable DC supply for the motor, plus a fuse or breaker
  • A heat sink for the switching device
  • Heavy-gauge wiring for the motor and supply connections

Circuit

The Arduino only produces a low-power control signal. The potentiometer’s wiper goes to analog input A1, and the PWM output on pin 11 drives the switching stage that feeds the motor. The Arduino never supplies motor current itself. The power stage is switched by the PWM signal and connects the motor to its own supply.

See also
HC05 BLUETOOTH PAIRING
Circuit diagram of Arduino potentiometer PWM speed controller for a DC motor

If you want to understand the switching stage on a smaller scale first, try our guide to motor speed control with a MOSFET and a potentiometer. The principle is the same, and it is a safer way to test the idea before moving to a motor of this size.

Program

void setup()
{
}
void loop()
{
    int a= analogRead(A1)/4;
    analogWrite(11,a);
}

How the code works

  1. analogRead(A1) reads the potentiometer voltage as a number from 0 to 1023.
  2. Dividing by 4 scales that range down to 0 to 255, which is the range analogWrite() accepts.
  3. analogWrite(11, a) sets the PWM duty cycle on pin 11. A value of 0 is always off, 255 is always on, and values in between give intermediate speeds.

The setup() function is empty because analogWrite() configures the pin as an output by itself. Adding pinMode(11, OUTPUT); inside setup() is still good practice and makes the code easier to read.

Sizing the power stage for a 2 HP motor

One horsepower is about 746 watts, so a 2 HP motor delivers roughly 1,500 W of mechanical output. The electrical input is higher because of losses. As a rough example, 1,500 W from a 120 V DC supply means more than 12 A, and the motor can draw several times its running current when it starts or is heavily loaded.

Always use the nameplate voltage and current of your own motor. Choose a switching device with a comfortable margin on both voltage and current, and fit a heat sink. Consider a soft start so the motor is not hit with full voltage at once.

Practical tips and safety

  • Use a flyback diode. A motor is an inductive load, and switching it off creates voltage spikes that can destroy the switching device.
  • Isolate the control side. A gate driver or opto-isolator protects the Arduino from faults on the power side.
  • Share a common ground between the Arduino and the driver stage, unless you use an isolated driver.
  • Add a fuse or breaker in the motor supply line.
  • Test with a small motor first. Confirm the code and wiring at low power before connecting the 2 HP motor.
  • Secure the load. Make sure the shaft is clamped or guarded before powering up.
  • Be careful with mains-powered supplies. A DC supply for a motor this size often comes from rectified mains, which is dangerous. If you are not experienced, get help from a qualified person.
See also
Best Cameras for Adventure Photography: 5 Picks by Depth, Cold and Weight

Improving the design

The basic circuit controls speed in one direction only. If you also need to reverse the motor, see our H-bridge DC motor direction control project. For smoother and more repeatable speed, you can add a tachometer or encoder and a feedback loop so the controller holds the set speed as the load changes.

Brush-type motors are not the only option. If you are curious about a brushless DC motor, it needs an electronic commutation scheme instead of a single PWM channel. For AC fans and similar loads, a different approach such as triac-based speed control is used.

FAQ

Can an Arduino drive a 2 HP DC motor directly?

No. An Arduino pin can supply only a few tens of milliamps. It must control a power stage, such as a MOSFET or IGBT with a driver, that handles the motor current.

Why divide the analog reading by 4?

The Arduino’s analog input returns values from 0 to 1023, while analogWrite() takes 0 to 255. Dividing by 4 maps one range onto the other.

Sustainable Tech

Keep Toxic E-Waste Out of Landfills

Don't throw away your failing laptop, phone, or car batteries. Learn how to recondition them at home in just a few hours. It's better for the planet—and your wallet.

Learn How It Works

Does lowering the duty cycle reduce motor torque?

Reducing the average voltage lowers the speed the motor can reach. Torque depends mainly on armature current, so the motor can still deliver torque at low speed as long as the controller allows enough current. Running at low speed under heavy load for long periods can overheat a motor that depends on its own fan for cooling.

Do I need a flyback diode?

Yes. It gives the motor’s inductive current a path when the switch turns off, which protects the switching device from voltage spikes.

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works