ESP32 Servo motor

Control a servomotor with ESP32

Purpose of this tutorial:

In this tutorial we will test the servomotor by sweeping an angular range in one direction and then in the other:

  1. It is positioned at the angle 0 °

  2. it is positioned at the 180 ° angle.

  3. we go back to step 1

Necessary components

  • ESP32
  • servo motor
  • Connecting wires

  • test plate


The connection is almost always the same and will be done using 3 wires, the main colors of which you may encounter:

  • Red: power supply wire to be connected to the (+) terminal of a 9V battery

  • Brown: wire to connect to the GND pin of the ESP32 board

  • Yellow: Positioning signal wire connected to pin D4 of the ESP32 board

Programme en micropython

Voici le programme qui permet de contrôler un servomoteur  par la carte ESP32.

0 commentaire

Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top