exosynk/esp32-servo-sweep

exosynk/esp32-servo-sweep

ESP32 servo sweep with status LED

A 5-part starter project using the new ESP32 DevKit + hobby servo. GPIO18 drives servo signal, GPIO23 lights a status LED while the code is running.

3 views0 upvotes0 forks5 partsUpdated Apr 22, 2026, 5:36 AMCreated Apr 22, 2026

README

ESP32 servo sweep — 5 parts, 20 lines of code

This is a classic "hello world" for the ESP32: drive a hobby servo back and forth, with a little status LED that confirms the board is alive.

Bill of materials

  • 1 × ESP32 DevKit (or any ESP32 board with GPIO18 + GPIO23 broken out)
  • 1 × Hobby servo (SG90 or similar — anything that runs on 3.3–6V)
  • 1 × 330 Ω resistor
  • 1 × LED (any color)
  • 1 × Ground rail

Wiring

  • ESP32 3V3 → Servo V+
  • ESP32 GND → Servo GND → Ground rail
  • ESP32 GPIO18 → Servo signal
  • ESP32 GPIO23 → 330 Ω resistor → LED anode → Ground

How it runs

Flash the code, power the board, and the servo will sweep 0 → 180 → 0 over roughly three seconds while the status LED stays lit. If the LED stays dark, GPIO23 isn't writing high — check the wire order.

Try it

Hit Simulate in the lab. The status LED turns on because GPIO23 is set to 3.3V in the initial props. Drag the servo position in the inspector and watch the arm move.

0 comments

No comments yet. Be the first.
Sign in to leave a comment.