ESP32 - Motor

We are going to learn:

Motor Types

There are three types of motors widely-used with ESP32:

  • Servo motor
  • Stepper motor
  • DC motor
  • https://esp32io.com/images/cover/esp32-motor.jpg

The servo motor includes two main types: 180° servo motor and 360° servo motor. In fact, most of the people understand implicitly "servo motor" to be "180° servo motor".

360° servo motor is similar to DC motor, except for no hardware driver is required.

180° Servo motor

Characteristics

  • Rotation is limited between 0° and 180°
  • Rotating direction: clockwise, counter-clockwise
  • Rotating position: can be controlled to rotate to a specific angle between 0° and 180°
  • Rotating speed: can be controlled, but not smoothly
  • Extra hardware driver: NOT required. Just control directly from an ESP32 pin
  • Extra power supply: required
  • How to control: easy, just use PWM signal

Application

  • Any application that requires only to rotate a angle between 0° and 180°

Servo motor Tutorial

ESP32 - Servo Motor tutorial

Stepper motor

Characteristics

  • Rotation is unlimited
  • Rotating direction: clockwise, counter-clockwise
  • Rotating position: can be controlled to precisely rotate to any angle position.
  • Rotating speed: can be controlled precisely. Furthermore, acceleration and deacceleration can be controlled precisely
  • Extra hardware driver: required
  • Extra power supply: required
  • How to control: complicated, beginners should use the library

Application

  • Automation and robotics
  • Printers, 3D printer, CNC, X-Y plotter,
  • Cocktail Machine

Stepper Motor Tutorial

ESP32 - Stepper Motor tutorial

DC motor

Characteristics

  • Rotation is unlimited
  • Rotating direction: clockwise, counter-clockwise
  • Rotating position: very difficult to precisely rotate to a specific angle
  • Rotating speed: easy to control how fast, but very difficult to precisely control to a specific speed value.
  • Extra hardware driver: required.
  • Extra power supply: required
  • How to control: easy, just use high-voltage PWM signal

※ NOTE THAT:

  • To control the position of DC motor, we need extra hardware, called encoder, and then use a closed-loop control method such as PID control method. This is very difficult for beginners.
  • For speed control, we can easily control how fast it is, such as slow, medium, fast, very fast, how many percent of full speed. However, To control how many rounds per second, we need extra hardware, called encoder, and then use a closed-loop control method such as PID control method. This is very difficult for beginners.
  • Some DC motors on the market has a built-in encoder

Application

  • Used to control something that needs to rotate continuously but the value of speed does not need to be specified. For example fan, pump, RC car, drill ...

※ NOTE THAT:

There are two main DC motor types: the brushed DC motors and brushless DC motors. The brushed DC motor is widely used in DIY projects

DC motor Tutorial

ESP32 - DC Motor tutorial

Motor selection guide

Choosing a motor for a project depending on many factors, such as carried weight, power supply, application's characteristics...

  • If your project needs to rotate to angle position in between 0° and 180°, find a suitable 180° servo motor
  • If your project needs to precisely rotate to any position, find a suitable stepper motor
  • If your project needs to precisely rotate continuously without any position, find a suitable DC motor or 360° servo motor

Buy Motor

Please note: These are affiliate links. If you buy the components through these links, We may get a commission at no extra cost to you. We appreciate it.

※ NOTE THAT:

Note that this tutorial is incomplete. We will post on our Facebook Page when the tutorial is complete. Like it to get updated.

※ NOTICES

  • We are AVAILABLE for HIRE. See how to hire us to do your project
  • If this tutorial is useful for you, please support us to make more tutorials.
  • We spent a lot of time and effort to create the content for this tutorial, please respect our work! Please do not copy the content to share on other websites. Howerver, please feel free to share the link of this tutorial anywhere