ESP32 S3 UNO - DIYables Bluetooth App Analog Gauge
Overview
This ESP32 S3 Uno Bluetooth analog gauge tutorial shows you how to send live numbers from the ESP32 S3 Uno form board to a dial meter on your smartphone. The gauge lives in the DIYables Bluetooth STEM app and talks to the board over BLE (Bluetooth Low Energy). You set the range and the unit, so the same BLE gauge can act as a speedometer, a voltmeter or a pressure meter.
In this tutorial, you will:
- Install the DIYables Bluetooth library in Arduino IDE
- Upload a BLE analog gauge sketch to the ESP32 S3 Uno
- Connect the DIYables Bluetooth app on Android or iOS and watch the needle move
- Change the gauge range and unit for your own sensor
- Build real meters like a voltmeter, a pressure gauge and a speedometer

※ NOTE THAT:
The ESP32 S3 Uno supports only BLE. It has no Classic Bluetooth, so the Classic (BluetoothSerial) version of this example does not run on it. That is good news for you: BLE works with the app on both Android and iOS, and you do not need to pair the board first.
Features
The gauge app gives you a ready-made dial screen, so you only have to send numbers. Here is what you get out of the box.
Classic dial display
A needle moves across a graduated scale, like a real analog meter. The exact value is also shown as a number.
Your own range and unit
You choose the minimum, the maximum and the unit text, such as km/h, PSI, V or %. You can change all three while the sketch is running.
Live updates
The sketch sends a new value every 200 ms, so the needle moves smoothly. The app can also ask the board for the current value at any time.
BLE on Android and iOS
BLE uses little power and needs no manual pairing. The same sketch works with both phone platforms.
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 | × | 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 .
ESP32 S3 Uno Code
The main sketch does not need any sensor. It makes a smooth sine wave from 0 to 100 and sends it to the gauge, so you can test the app first and add a real sensor later.
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.
- Pick a big partition: go to Tools > Partition Scheme and select Huge APP (3MB No OTA/1MB SPIFFS). The Bluetooth library is large and does not fit in the default space.
- Open the library manager: click the Libraries icon on the left bar of 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: Arduino IDE asks to add some other libraries. Click Install All.
- Tip: if the upload does not start, hold the BOOT button, press RESET, then release BOOT and try again.
ESP32 S3 Uno BLE Code (works with the app on Android and iOS)
The sketch starts a BLE server named "ESP32BLE_Gauge" and adds the analog gauge app with a 0 to 100 km/h range. When a phone connects, it sends a value every 200 ms and prints it to the Serial Monitor. The ANALOG_PIN line already points to A0 (GPIO2), ready for a real sensor.
- Load the code: in Arduino IDE go to File Examples DIYables Bluetooth Esp32BLE_AnalogGauge, or copy the code below into the editor.
- Upload: click the Upload button to send the code to the ESP32 S3 Uno.
- Open the Serial Monitor and set it to 115200 baud.
- Check the output. You should see something like this:
- Tip: keep the Serial Monitor open. It shows when the phone connects and every value that goes to the gauge.
The setup() function also calls analogSetAttenuation(ADC_11db). By default, the ESP32 S3 Uno ADC can only measure a small voltage. With 11 dB attenuation, an analog pin reads the full range from 0V up to about 3.3V, so a sensor on A0 (GPIO2) uses the whole 0 to 4095 scale. Without it, readings hit 4095 too early and the gauge shows wrong values.
Mobile App
Now you connect your phone. Because the ESP32 S3 Uno uses BLE, there is no pairing step in the phone settings. You only scan and tap in the app.
- Open the app and grant the permissions it asks for the first time:
- Nearby Devices (Android 12 and newer) or Bluetooth (iOS), to scan and connect to devices
- Location (Android 11 and older only), because older Android needs it to scan for BLE devices

- Connect: tap "ESP32BLE_Gauge" in the scan results. The app goes back to the home screen when the link is ready.
- Open the gauge: select the Analog Gauge app from the menu.

- Watch the needle: it swings up and down as the sine wave values arrive.

- Tip: tap the settings icon on the home screen to hide or show apps. The DIYables Bluetooth App User Manual has more details.
Go back to the Serial Monitor in Arduino IDE. You will see lines like these:
Creative Customization - Adapt the Code to Your Project
The example is only a starting point. With a few lines you can turn it into the meter your project needs.
Configure Gauge Range and Unit
You set the range and the unit in the constructor. You can also change them later, for example when the user switches from km/h to MPH.
Send Gauge Value
Call send() with a number to move the needle. You can also send a short text, which is handy while the sensor warms up.
Handle Value Requests from App
The app can ask for the latest value, for example right after the gauge screen opens. This callback reads your sensor and answers at once.
Handle Connection Events
These two callbacks run when the phone connects or leaves. Sending a value on connect means the gauge never starts empty.
How to Use the Analog Gauge
It helps to know what each part of the screen means, so you can pick a good range and unit.
App Interface
The gauge screen has a dial with a moving needle and scale marks from your minimum to your maximum. Under the dial, a number shows the exact value, next to the unit text you set in the code.
Common Unit Configurations
| Use | Constructor |
|---|---|
| Speed | DIYables_BluetoothAnalogGauge(0.0, 200.0, "km/h") |
| Pressure | DIYables_BluetoothAnalogGauge(0.0, 100.0, "PSI") |
| Voltage | DIYables_BluetoothAnalogGauge(0.0, 3.3, "V") |
| Percentage | DIYables_BluetoothAnalogGauge(0.0, 100.0, "%") |
| RPM | DIYables_BluetoothAnalogGauge(0.0, 8000.0, "RPM") |
ESP32 S3 Uno Pinout
The examples below connect sensors to the board. The image shows the ESP32 S3 Uno form board pinout, so you can find the Uno header pins (A0, D2, SDA, SCL) and their GPIO numbers.

Programming Examples
Each example shows only the parts that change. Keep the BLE setup lines from the main sketch, including analogSetAttenuation(ADC_11db) in setup() for the analog examples.
Voltage Meter
This meter reads a voltage divider on A0 (GPIO2). A 5:1 divider turns up to 16V into about 3.2V, which is safe for the 3.3V ESP32 S3 Uno input.
| Component Pin | ESP32 S3 Uno Pin |
|---|---|
| Divider output | A0 (GPIO2) |
| Divider GND | GND |
Pressure Gauge (BMP280)
The BMP280 talks over I2C. On the ESP32 S3 Uno, A4 and A5 are not I2C pins, so wire the sensor to the SDA (GPIO8) and SCL (GPIO9) header pins. Wire.begin() uses them by default.
| BMP280 Pin | ESP32 S3 Uno Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| SDA | SDA (GPIO8) |
| SCL | SCL (GPIO9) |
Current Sensor (ACS712)
The ACS712 output goes to A0 (GPIO2). The code uses the 185 mV/A sensitivity of the 5A version and a 2.5V zero point.
WARNING
The ACS712 is a 5V module. Its output sits at 2.5V with no current and can go above 3.3V at high current, which can damage the ESP32 S3 Uno pin. Keep the current small, or add a voltage divider between the sensor output and A0, and change ZERO_CURRENT_VOLTAGE and SENSITIVITY to match.
Speed from Encoder
An encoder or a slotted wheel gives one pulse per slot. An interrupt counts the pulses on D2 (GPIO18), and the sketch turns them into km/h every 500 ms.
| Encoder Pin | ESP32 S3 Uno Pin |
|---|---|
| VCC | 3.3V |
| GND | GND |
| OUT | D2 (GPIO18) |
Advanced Programming Techniques
Raw sensor values are often noisy. These small helpers make the gauge easier to read.
Smooth Needle Movement
A simple filter moves the shown value only part of the way toward the new reading each time. A lower SMOOTHING number gives a calmer needle.
Peak Hold
Peak hold keeps the highest value on the dial for 3 seconds. You can then see short spikes that would otherwise flash by.
Range Auto-Scaling
If you do not know the sensor range yet, let the code widen the scale when a value goes past the edge.
Hardware Integration Ideas
Almost any sensor that gives a number can drive the gauge. Keep every signal that goes into the ESP32 S3 Uno at 3.3V or less.
Analog sensors
Potentiometers, force sensors and flex sensors work on the analog pins, such as A0 (GPIO2). The 12-bit ADC gives values from 0 to 4095.
I2C and SPI sensors
Use I2C sensors like the BMP280 (pressure) or INA219 (current and power) on SDA (GPIO8) and SCL (GPIO9). SPI sensors use D10 to D13, which match the default SPI pins.
Pulse and frequency sensors
Speed encoders, flow meters and RPM sensors work well with interrupt-based counting on a digital pin.
Load cells (HX711)
The HX711 amplifier lets you build a kitchen scale or a weighing station with a gauge display.
Bluetooth Mode on the ESP32 S3 Uno
The chip on the ESP32 S3 Uno has only BLE. Some other boards also offer Classic Bluetooth, but the Classic version of this example does not work here. The table shows what BLE gives you.
| Feature | ESP32 S3 Uno (BLE, Esp32BLE_AnalogGauge) |
|---|---|
| iOS support | Yes |
| Android support | Yes |
| Power use | Low |
| Range | About 30 to 100 m in open space |
| Pairing | Not needed, scan and connect in the app |
| Classic Bluetooth (BluetoothSerial) | Not supported by the chip |
Debug Tips
When the needle shows something odd, print the value, the range and the percentage. This small function puts everything in the Serial Monitor so you can compare it with the app.
Project Ideas
Need some inspiration? These projects all fit the gauge display well.
Vehicle and motion
A speedometer for an RC car or a bicycle, an RPM meter for motors, a G-force meter or a tilt angle indicator.
Electrical and power
A battery voltmeter, an ammeter for current use, a wattmeter or a battery level gauge.
Environment
A barometric pressure gauge, a wind speed meter, a UV index meter or a sound level meter.
Industrial
A weight scale, a flow rate meter, a tank level indicator or a torque meter.
Integration with Other Bluetooth Apps
The gauge works well next to other DIYables Bluetooth apps. One server can run several apps at once.
Combine with Bluetooth Temperature
Show pressure on the gauge and temperature on its own screen.
Combine with Bluetooth Table
Use the gauge for a quick look and a table for the details.
Next Steps
Once the gauge works on your ESP32 S3 Uno, try these examples next:
- Bluetooth Temperature - a display made for temperature
- Bluetooth Plotter - to see how a value changes over time
- Bluetooth Table - to show many values in rows
- Multiple Bluetooth Apps - to combine the gauge with other screens
Support
If you get stuck, these places can help:
- The API reference that comes with the DIYables Bluetooth library
- The Arduino community forums
FAQ
Why is there no Classic Bluetooth code for the ESP32 S3 Uno?
The chip on the ESP32 S3 Uno has only BLE (Bluetooth Low Energy). BluetoothSerial and other Classic Bluetooth code will not compile or run on it. Use the Esp32BLE_AnalogGauge example. It works with the app on Android and iOS.
Do I need a sensor to try the ESP32 S3 Uno Bluetooth gauge?
No. The main sketch makes a sine wave from 0 to 100, so the needle moves without any wiring. When you are ready, uncomment the analogRead() lines in readSensorValue() and connect your sensor to A0 (GPIO2).
Why does the code call analogSetAttenuation(ADC_11db)?
It sets the ESP32 S3 Uno ADC input range to about 0 to 3.3V, so the full sensor signal maps to 0 to 4095. Without it the range is smaller and readings saturate early. The UNO R4 does not need this line, because it is only for the ESP32 family. Keep the sensor output at 3.3V or less.
Can I connect a 5V sensor output to the ESP32 S3 Uno?
Not directly. The ESP32 S3 Uno pins are 3.3V logic and are not 5V tolerant. Use a voltage divider or a level shifter between a 5V output and the pin, and change the math in the code to match.
Why do I get "Sketch too big" when I upload?
The Bluetooth stack needs a lot of flash. Go to Tools > Partition Scheme and choose "Huge APP (3MB No OTA/1MB SPIFFS)". Then 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 and GPIO48 (output only, PWM). Solder pin headers to use them and write the GPIO number in code. For a second analog sensor on another gauge, GPIO15 or GPIO16 is the best choice; for encoder inputs, use GPIO35 to GPIO42, not GPIO47 or GPIO48. 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 charge-only cable | Install the CP210x or CH340 driver, use a data USB Type-C cable, or hold BOOT while pressing RESET |
| Sketch too big error | Default partition is too small for Bluetooth | Select Tools > Partition Scheme > Huge APP (3MB No OTA/1MB SPIFFS) |
| ESP32BLE_Gauge does not show in the app | Board not powered, sketch not uploaded, or phone Bluetooth off | Check the Serial Monitor for "Waiting for Bluetooth connection...", turn on Bluetooth, and on Android 11 or older turn on Location |
| Classic Bluetooth code fails to compile | The ESP32 S3 Uno has no Classic Bluetooth | Use the BLE example Esp32BLE_AnalogGauge instead of the BluetoothSerial one |
| Gauge stuck at 0 or wrong value | Sensor wiring wrong or value out of range | Check the wiring to A0 (GPIO2), print the value in the Serial Monitor, and fix the range with setRange() |
| Gauge always shows the maximum | Analog input above 3.3V or no ADC attenuation | Keep the signal at 3.3V or less with a divider, and keep analogSetAttenuation(ADC_11db) in setup() |
| Needle jumps around | Noisy sensor or floating analog pin | Add the smoothing filter, average several readings, and make sure the sensor GND is connected |
| Connection drops often | Phone too far away or weak USB power | Move the phone closer and use a good USB cable or power supply |