Control a Combat Robot with Motors, Servos and LEDs with ESP32 and Bluetooth Game Controller

Control LEDs, Servos and Motors with a Game Controller and ESP32

Go from gaming to operating your own robot vehicle or a robotic arm using your game controller! Today, I’ll show you how to control LEDs, servos, and motors using a game controller connected to an ESP32 via Bluetooth.

We’ll start by wiring up each component to the ESP32, making sure you get a solid grasp on the hardware side of things. Then, we’ll move on to writing an Arduino sketch that will turn your joysticks and buttons into the ultimate control interface, allowing you to handle motors for a responsive robot vehicle, servos for a precise robot arm and trigger other components like LEDs and more.

This ESP32 project builds on a previous tutorial where we learned how to pair a game controller to an ESP32 using the Bluepad32 library. I then showed you how to see the values that your game controller buttons and joysticks produce so we can use those values in this project.

If this is your first time using a game controller with an ESP32, be sure to start there before proceeding:

Recommended Tutorial: Connect Your Game Controller to an ESP32: The Complete Guide

There are some steps you have to go through first like installing board managers and board packages before you can use this Arduino sketch for your ESP32 project. The previous ESP32 game controller tutorial takes you through it all, step-by-step. Then, once you’re done, join us back here!

For everyone else, let’s get started and turn that pile of components into a responsive, gamepad-controlled robot!

Already a newsletter subscriber or community member? Sign In to access the full tutorial.

Get code examples and wiring diagrams for ALL my tutorials and projects

Choose an option below:

Magic Smoke Weekly Includes:

  • Immediate access to the full versions of all my tutorials and projects on my website.
  • A new tutorial or project delivered weekly straight to your inbox.
  • Crystal-clear wiring diagrams
  • Copy-paste ready code
  • Code packs to inspire epic builds – think lights, sounds, movement, and pure DIY magic.

Engineering Artists Community Includes:

  • Magic Smoke Weekly Newsletter
  • Immediate access to the full versions of all my tutorials and projects on my website.
  • Personalized hands-on help with your projects.
  • Full Access to my Discord Community
  • Live Workshops
  • Live Small Group Office Hours
  • Electronics & Coding Project Challenges
  • Live Video and Text Chat Support
  • All Live Event Replays