How to control Servo Motors with an ESP32 - directly, using I2C, and over WiFi.

We are working with the ESP32 again, today we’ll see a few different methods of controlling a servo motor using this amazing 32-bit microcontroller.

The ESP32 is well-suited to controlling analog servo motors as it has 16 PWM outputs. It’s built-in WiFi and Bluetooth open the doors to all sorts of remote control possibilities.

Although the ESP32 can’t use the Arduino Servo Library there are many replacement libraries available. I’ll be working with the ESP32Servo Library for most of these experiments.

We’ll see how to interface a servo to the ESP32 and then we’ll look at a few code examples that emulate the examples included with the Arduino.

We’ll also hook up a PCA9685 PWM controller to the ESP32 using its I2C connections. This is a great way to drive a lot of servo motors as each PCA9685 has 16 PWM outputs and you can cascade them to control up to 992 motors! I’ll only be using two motors for my demo.

One great reason to use an ESP32 over an Arduino is the built-in wireless communications. In the final example, we will control a servo motor with a web-based interface over WiFi.

Here is the Table of Contents for today’s video:

00:00 - Introduction
02:51 - Servo Motors & ESP32
10:10 - Hookup & ESP32Servo Library
15:08 - Sweep Sketch
19:23 - Improved Sweep Sketch
21:36 - Knob Sketch
27:18 - ESP32 & PCA9685 -
37:46 - WiFi Web-based Servo Control

Subscribe: https://www.youtube.com/c/Dronebotworkshop1/featured

#esp32 #arduino

Using Servo Motors with ESP32
2.70 GEEK