ESP32 S3 UNO - DIYables Bluetooth App Rotator
Overview
This ESP32 S3 Uno Bluetooth rotator tutorial shows you how to turn a knob on your phone and send the angle to the ESP32 S3 Uno form board over BLE. The DIYables Bluetooth STEM app gives you a rotatable disc. Each time you drag it, the board gets a new angle value, so you can move a servo, step a motor or set a volume level without any wires to the phone.
In this tutorial, you will:
- Install the DIYables Bluetooth library in the Arduino IDE
- Upload the BLE rotator example to the ESP32 S3 Uno
- Connect the DIYables Bluetooth app and read angle values in the Serial Monitor
- Switch between limited and continuous rotation modes
- Use the angle to control a servo motor, a PWM output or a stepper motor

※ NOTE THAT:
The ESP32 S3 Uno supports only BLE (Bluetooth Low Energy). It has no Bluetooth Classic radio, so the BluetoothSerial library and the Classic Bluetooth example (Esp32Bluetooth_Rotator) do not work on it. This page uses only the BLE example (Esp32BLE_Rotator). The good news: BLE works with the app on both Android and iOS, and you do not need to pair the board first.
Features
The rotator turns your phone screen into a round control knob. Here is what it gives you.
A knob you can drag
You touch the disc and drag it around. The app sends the new angle to the board as a float value in real time.
Two rotation modes
Continuous mode lets the disc spin a full 360° and wrap around. Limited mode keeps the angle inside a range you choose, such as 0° to 180° for a servo.
Two-way updates
The board can also send an angle back to the app. This keeps the knob in sync with the real position, for example after a reconnect.
BLE on Android and iOS
BLE works on both phone types and needs no manual pairing. It also uses less power than Classic Bluetooth.
Hardware Preparation
| 1 | × | ESP32 S3 Uno-form Board | |
| 1 | × | USB Cable Type-A to Type-C (for USB-A PC) | |
| 1 | × | USB Cable Type-C to Type-C (for USB-C PC) | |
| 1 | × | (optional) Servo Motor | |
| 1 | × | Breadboard | |
| 1 | × | Jumper Wires |
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Buy Note: For controlling multiple servo motors, use the PCA9685 16 Channel PWM Servo Driver Module to save MCU pins and simplify wiring.
ESP32 S3 Uno Pinout
The image below shows the pinout diagram of the ESP32 S3 Uno form board. Use it to find the Uno header pins (D9, D10, 5V, GND…) and their GPIO numbers if you add a servo or another part to this project.

ESP32 S3 Uno Code
The basic example needs no wiring at all. You only need the board, a USB cable and your phone. The steps below install the library and upload the BLE rotator sketch.
Detailed Instructions
- New to the ESP32 S3 Uno? Follow ESP32 S3 Uno - Getting Started first.
- Connect the board to your computer with a USB Type-C cable.
- Open Arduino IDE, choose the ESP32S3 Dev Module board and the correct COM port.
- Set the partition scheme: go to Tools > Partition Scheme and pick "Huge APP (3MB No OTA/1MB SPIFFS)". The Bluetooth library is big and does not fit in the default app space.
- Open the Library Manager: click the Libraries icon on the left bar of the Arduino IDE.
- Find the library: search "DIYables Bluetooth" and find the DIYables Bluetooth library by DIYables.
- Install it: click the Install button.
- Search for DIYables Bluetooth created by DIYables and click the Install button.
- Install the dependencies: when the IDE asks about other libraries, click Install All.
- Tip: if the upload fails with a "Sketch too big" message, check the partition scheme again. It often resets when you change the board.
ESP32 S3 Uno BLE Code (works with the app on Android and iOS)
This sketch starts a BLE server named "ESP32BLE_Rotator" and adds the rotator app to it. The knob works in limited mode from 0° to 180°, and every new angle is printed to the Serial Monitor. When the phone connects, the board sends the last known angle, so the knob in the app shows the right position.
- Load the example: in Arduino IDE, go to File Examples DIYables Bluetooth Esp32BLE_Rotator, or copy the code below into the editor.
- Upload: click the Upload button.
- Open the Serial Monitor and set it to 115200 baud.
- Check the output. It should look like this:
- Tip: the servo lines in the sketch are commented out. Remove the // marks when you wire a servo to D9 (GPIO46), as shown in the Servo Control example below.
Mobile App
The app is where you turn the knob. Because the ESP32 S3 Uno uses BLE, you connect from inside the app and skip the phone's Bluetooth pairing menu.
- Open the app and grant the permissions it asks for:
- Nearby Devices (Android 12+) or Bluetooth (iOS), needed to scan and connect
- Location (Android 11 and below only), needed by older Android versions to scan for BLE devices
- Turn on Bluetooth on your phone.
- Scan: on the home screen, tap the Connect button.

- Connect: tap "ESP32BLE_Rotator" in the scan results.
- Open the Rotator: the app returns to the home screen after it connects. Tap the Rotator app.

※ NOTE THAT:
You can tap the settings icon on the home screen to show or hide apps. For more details, read the DIYables Bluetooth App User Manual.
- Turn the knob: drag the disc to change the angle.

Go back to the Serial Monitor in the Arduino IDE. You will see each new angle as you turn the knob:
Creative Customization - Adapt the Code to Your Project
The example only prints the angle. The snippets below show the library functions you can use to shape the knob and react to it in your own ESP32 S3 Uno project.
Configure Rotator Mode
You pick the mode when you create the rotator object. You can also change it later while the sketch runs, and read the current settings back.
Handle Angle Changes
The onRotatorAngle() callback runs every time the app sends a new angle. Put your control logic inside it.
Handle Configuration Request from App
When the app opens the rotator screen, it can ask the board for its current state. Answer with the current angle so the knob starts in the right place.
Send Angle to App
The ESP32 S3 Uno can move the knob on the phone by itself. It can also send a short text message.
Handle Connection Events
These two callbacks tell you when the phone connects or leaves. Sending the angle on connect keeps the app in sync.
How to Use the Rotator
It helps to know what each part of the screen does before you build on it.
App Interface Controls
Rotatable disc
Touch the disc and drag it around to change the angle.
Angle display
The number in the middle shows the current angle.
Position marker
A marker on the disc points to the current position.
Rotator Modes
ROTATOR_MODE_CONTINUOUS (value 0) gives a full 360° turn that wraps back to 0°. ROTATOR_MODE_LIMITED (value 1) keeps the angle between the min and max values you set.
Programming Examples
These examples show real uses for the angle. Each one is a part of a sketch, so add it to the full BLE example above.
Servo Control
Limited mode from 0° to 180° matches a normal servo, so you can write the angle straight to the servo. Install the "ESP32Servo" library by Kevin Harrington first. The standard Servo library does not run on the ESP32 S3 Uno.
Wire the servo like this. Power it from the 5V pin, because servos need 5V. The signal goes out of the board, so the 3.3V level is safe and most servos read it fine.
| Servo Pin | ESP32 S3 Uno Pin |
|---|---|
| VCC (red) | 5V |
| GND (brown) | GND |
| Signal (orange) | D9 (GPIO46) |
WARNING
D9 (GPIO46) is a boot strapping pin on the ESP32 S3 Uno. The board reads it at startup to choose the boot mode. A servo signal line is normally fine, but if the board will not boot or upload while the servo is connected, unplug the signal wire, upload, and then plug it back in.
For a pan-tilt mount, add a second servo on D10 (GPIO10) and drive it from another control, such as a Bluetooth slider.
Volume/Brightness Knob
Here the knob runs in continuous mode. The sketch maps 0–360° to a PWM value of 0–255 and also prints it as a percentage. Connect an LED (with a resistor) or another PWM input to D5 (GPIO20).
Compass Display
This time the data flows the other way. The board reads a compass heading every 500 ms and moves the knob in the app to match it. Compass modules use I2C, so wire them to the SDA (GPIO8) and SCL (GPIO9) header pins.
Stepper Motor Control
A stepper driver with STEP and DIR inputs can follow the knob. The sketch turns the angle into a target step count for a 200-step motor, and stepper.run() moves it there. Wire STEP to D2 (GPIO18) and DIR to D3 (GPIO17).
Advanced Programming Techniques
Once the basics work, you can change how the angle is handled before you use it.
Angle Snap to Increments
This code rounds the angle to the nearest 15° step and sends the rounded value back. The knob in the app then jumps to clean positions.
Zone-Based Control
You can split the circle into four zones and run different actions in each one. Here every zone sets a different RGB LED color. Write your own setColor() function for your LED.
Why BLE Only on the ESP32 S3 Uno?
Some other boards offer both BLE and Classic Bluetooth. The ESP32 S3 Uno has a BLE radio only, so the choice is made for you. That is fine for this project, as the table shows.
| Feature | BLE on the ESP32 S3 Uno |
|---|---|
| iOS Support | Yes |
| Android Support | Yes |
| Power Use | Low |
| Range | About 30 to 100 m in open space |
| Pairing | Not needed, connect from the app |
| Example Name | Esp32BLE_Rotator |
Common Issues and Debugging
Most rotator problems come from the connection, the mode settings or the servo power. Check these first.
The device does not show up in the app
Make sure the sketch is uploaded and the board is powered. Turn on Bluetooth on your phone, and on Android 11 and below also turn on Location. Remember to look for "ESP32BLE_Rotator", not a Classic Bluetooth name.
The knob moves but nothing happens
Look at the connection status in the app and in the Serial Monitor. If you see no "Bluetooth connected!" line, disconnect and connect again.
The angle values look wrong
Check the mode (continuous or limited) and the min and max angles. Use getMinAngle() and getMaxAngle() to print the real settings.
The servo jitters
Ignore very small angle changes in your code, power the servo from a separate 5V supply, and add a capacitor across the servo power pins.
The connection drops often
Move the phone closer to the ESP32 S3 Uno and away from other BLE devices. A weak USB port can also cause drops.
Sketch too big
Go to Tools > Partition Scheme and pick "Huge APP (3MB No OTA/1MB SPIFFS)" or "No OTA (Large APP)". The default scheme leaves only about 1.2 MB for your code, which is too small for the Bluetooth library.
Debug Tips
This helper prints the angle, the mode and the range in one block. Call it inside onRotatorAngle() while you test.
Project Ideas
A knob is a simple input, but it fits many projects. Here are some ideas for your ESP32 S3 Uno.
Motor Control
A servo position knob, a stepper angle selector, a motor speed dial or a robot arm joint.
Display Projects
A compass heading display, analog clock hands, a wind direction indicator or a dial gauge.
Audio Projects
A volume knob, a tone frequency selector, an equalizer band or a radio tuner dial.
Lighting Projects
An LED ring position, a color wheel for hue, a spotlight direction or a stage light angle.
Integration with Other Bluetooth Apps
The rotator works well together with other DIYables Bluetooth apps on the same board.
Combine with Bluetooth Slider
Use the rotator for direction and a slider for speed. The code turns both into X and Y values for two motors.
Combine with Bluetooth Table
Show the angle, the quadrant and the angle in radians in a table on the phone.
Next Steps
When the rotator works, try these other examples on your ESP32 S3 Uno:
- Bluetooth Joystick for 2D direction control
- Bluetooth Slider for linear value control
- Bluetooth Analog Gauge for gauge-style feedback
- Multiple Bluetooth Apps to combine the rotator with other controls
Support
If you get stuck, these places can help:
- The API Reference documentation of the DIYables Bluetooth library
- The Arduino community forums
FAQ
Does the ESP32 S3 Uno support Classic Bluetooth for the rotator?
No. The ESP32 S3 Uno has BLE only. Use the Esp32BLE_Rotator example. The Esp32Bluetooth_Rotator example uses BluetoothSerial and will not compile or work on this board.
Which library do I need for the Bluetooth rotator on the ESP32 S3 Uno?
Install the "DIYables Bluetooth" library by DIYables and its dependencies. The ESP32 S3 Uno uses platforms/DIYables_Esp32BLE.h, while the UNO R4 WiFi uses platforms/DIYables_ArduinoBLE.h. The rotator functions are the same on both boards.
Can I power a servo from the ESP32 S3 Uno 5V pin?
A small SG90 servo with no load usually works from the 5V pin. A bigger servo, or one under load, can pull a current spike that resets the board. In that case use an external 5V supply and connect its GND to the ESP32 S3 Uno GND.
Is the 3.3V signal of the ESP32 S3 Uno enough for a 5V servo?
Yes, for most hobby servos. The signal goes out of the board, so it cannot harm the pin. Never connect a 5V signal into an ESP32 S3 Uno pin, because the pins are not 5V tolerant.
Why does my upload fail with "Sketch too big"?
The BLE stack and the DIYables library need more flash than the default partition gives. Select "Huge APP (3MB No OTA/1MB SPIFFS)" under Tools > Partition Scheme and upload again.
What if my project needs more pins than the Uno headers give?
The ESP32 S3 Uno has two extra rows of holes with more GPIOs: GPIO15 and GPIO16 (I/O, PWM, analog), GPIO45 and GPIO35 to GPIO42 (I/O, PWM), and GPIO47/GPIO48 (output only, PWM). Solder pin headers to use them and write the GPIO number in code. For extra servos or stepper drivers, GPIO35 to GPIO42 are a good choice. Be careful with two things. First, GPIO47 and GPIO48 may run at 1.8V instead of 3.3V on some modules (especially ones with "V" in the name, like R8V or R16V), so 3.3V devices can be damaged or act strangely. Second, GPIO0, GPIO3 (D6), GPIO45 and GPIO46 (D9) are boot strapping pins, and a wrong connection can stop the board from booting or uploading code. Use the other extra pins first.
Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| No COM port in Arduino IDE | USB driver missing or board not in download mode | Install the CP210x or CH340 driver, try another USB cable, or hold BOOT while you press RESET |
| Upload fails with Sketch too big | Default partition scheme is too small for BLE | Select Huge APP (3MB No OTA/1MB SPIFFS) in Tools > Partition Scheme |
| ESP32BLE_Rotator not in the scan list | Sketch not running, or phone Bluetooth or Location is off | Check the Serial Monitor for Waiting for Bluetooth connection, then turn on Bluetooth (and Location on Android 11 and below) |
| Compile error about BluetoothSerial | Classic Bluetooth example used | Use the Esp32BLE_Rotator example, as the ESP32 S3 Uno has no Classic Bluetooth |
| Servo does not move | Wrong pin, ESP32Servo not installed or attach() missing | Wire the signal to D9 (GPIO46), install ESP32Servo and call attach(46) |
| Board resets when the servo moves | Servo pulls too much current from the 5V pin | Use an external 5V supply for the servo and share GND with the board |
| Board does not boot with the servo connected | D9 (GPIO46) is a boot strapping pin | Unplug the servo signal wire during boot or upload, then plug it back in |
| Serial Monitor shows strange characters | Wrong baud rate | Set the Serial Monitor to 115200 baud |