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:

  1. Install the DIYables Bluetooth library in Arduino IDE
  2. Upload a BLE analog gauge sketch to the ESP32 S3 Uno
  3. Connect the DIYables Bluetooth app on Android or iOS and watch the needle move
  4. Change the gauge range and unit for your own sensor
  5. Build real meters like a voltmeter, a pressure gauge and a speedometer
ESP32 S3 Uno Bluetooth analog gauge

※ 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)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
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

  1. New to the ESP32 S3 Uno? Follow ESP32 S3 Uno - Getting Started first.
  2. Connect the board to your computer with a USB Type-C cable.
  3. Open Arduino IDE, choose the ESP32S3 Dev Module board and the correct COM port.
  4. 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.
  5. Open the library manager: click the Libraries icon on the left bar of Arduino IDE.
  6. Find the library: search "DIYables Bluetooth" and find the DIYables Bluetooth library by DIYables.
  7. Install it: click the Install button.
  • Search for DIYables Bluetooth created by DIYables and click the Install button.
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32S3 Dev Module
Library Manager
Type:
All
Topic:
All
DIYables Bluetooth by DIYables
A comprehensive Bluetooth library that connects Arduino to the DIYables Bluetooth STEM mobile app (Android & iOS) via BLE and Classic Bluetooth. Features 11 built-in apps: Monitor, Chat, Digital Pin Control, Joystick, Sliders, Plotter, Analog Gauge, Rotator, Temperature, RTC, and Data Table. Clean architecture with platform abstraction. Works with Arduino Uno R4 WiFi, Arduino Nano 33 BLE, ESP32, and other BLE-capable boards. No mobile coding required. More info
1.0.1
INSTALL
Newbiely.ino
···
1 void setup() {
Output
Serial Monitor
Ln 1, Col 1
ESP32S3 Dev Module on COM15
1
  1. Install the dependencies: Arduino IDE asks to add some other libraries. Click Install All.
  2. 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.

  1. Load the code: in Arduino IDE go to File Examples DIYables Bluetooth Esp32BLE_AnalogGauge, or copy the code below into the editor.
/* * This ESP32 S3 Uno code was developed by newbiely.com * * This ESP32 S3 Uno code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/esp32-s3-uno/esp32-s3-uno-diyables-bluetooth-app-analog-gauge */ /* * DIYables Bluetooth Library - ESP32 S3 Uno BLE Analog Gauge Example * Works with DIYables Bluetooth STEM app on Android and iOS * * This example demonstrates the Bluetooth Analog Gauge feature: * - Display values on an analog meter/gauge * - Configurable range and unit * - Perfect for sensor monitoring (speed, pressure, voltage, etc.) * * Board: ESP32 S3 Uno form board (BLE only, no Classic Bluetooth) * * Note: Select "Huge APP (3MB No OTA/1MB SPIFFS)" partition scheme * in Arduino IDE: Tools > Partition Scheme * * Optional: Analog sensor (potentiometer, pressure sensor, etc.) on A0 (GPIO2) * * Setup: * 1. Upload the sketch to your ESP32 S3 Uno * 2. Open Serial Monitor (115200 baud) to see connection status * 3. Use DIYables Bluetooth App to connect and view the gauge * * Tutorial: https://diyables.io/bluetooth-app * Author: DIYables */ #include <DIYables_BluetoothServer.h> #include <DIYables_BluetoothAnalogGauge.h> #include <platforms/DIYables_Esp32BLE.h> // BLE Configuration const char* DEVICE_NAME = "ESP32BLE_Gauge"; const char* SERVICE_UUID = "19B10000-E8F2-537E-4F6C-D104768A1214"; const char* TX_UUID = "19B10001-E8F2-537E-4F6C-D104768A1214"; const char* RX_UUID = "19B10002-E8F2-537E-4F6C-D104768A1214"; // Create Bluetooth instances DIYables_Esp32BLE bluetooth(DEVICE_NAME, SERVICE_UUID, TX_UUID, RX_UUID); DIYables_BluetoothServer bluetoothServer(bluetooth); // Create Analog Gauge app instance (min=0, max=100, unit="km/h") DIYables_BluetoothAnalogGauge bluetoothGauge(0.0, 100.0, "km/h"); // Variables for gauge value float currentValue = 0.0; unsigned long lastUpdate = 0; const unsigned long UPDATE_INTERVAL = 200; // Update every 200ms // Optional: Analog input pin for sensor const int ANALOG_PIN = 2; // ESP32 S3 Uno A0 (GPIO2) // Function to read sensor value float readSensorValue() { // TODO: Replace with actual sensor reading // Option 1: Read from analog pin and map to gauge range // int rawValue = analogRead(ANALOG_PIN); // return map(rawValue, 0, 4095, 0, 100); // ESP32 S3 Uno has 12-bit ADC // Option 2: Simulated data (sine wave) static float phase = 0; phase += 0.05; if (phase > 2 * PI) phase = 0; return 50 + 50 * sin(phase); // Oscillates between 0-100 } void setup() { Serial.begin(115200); // set the ADC attenuation to 11 dB (up to ~3.3V input) analogSetAttenuation(ADC_11db); delay(1000); Serial.println("DIYables Bluetooth - ESP32 S3 Uno BLE Analog Gauge Example"); // Initialize Bluetooth server with platform-specific implementation bluetoothServer.begin(); // Add gauge app to server bluetoothServer.addApp(&bluetoothGauge); // Set up connection event callbacks bluetoothServer.setOnConnected([]() { Serial.println("Bluetooth connected!"); currentValue = readSensorValue(); bluetoothGauge.send(currentValue); Serial.print("Initial value sent: "); Serial.print(currentValue); Serial.print(" "); Serial.println(bluetoothGauge.getUnit()); }); bluetoothServer.setOnDisconnected([]() { Serial.println("Bluetooth disconnected!"); }); bluetoothGauge.onValueRequest([]() { currentValue = readSensorValue(); bluetoothGauge.send(currentValue); Serial.print("Value requested - Sent: "); Serial.print(currentValue); Serial.print(" "); Serial.println(bluetoothGauge.getUnit()); }); Serial.println("Waiting for Bluetooth connection..."); Serial.print("Gauge range: "); Serial.print(bluetoothGauge.getMin()); Serial.print(" - "); Serial.print(bluetoothGauge.getMax()); Serial.print(" "); Serial.println(bluetoothGauge.getUnit()); } void loop() { bluetoothServer.loop(); if (bluetooth.isConnected() && millis() - lastUpdate >= UPDATE_INTERVAL) { lastUpdate = millis(); currentValue = readSensorValue(); bluetoothGauge.send(currentValue); Serial.print("Gauge: "); Serial.print(currentValue, 1); Serial.print(" "); Serial.println(bluetoothGauge.getUnit()); } delay(10); }
  1. Upload: click the Upload button to send the code to the ESP32 S3 Uno.
  2. Open the Serial Monitor and set it to 115200 baud.
  3. Check the output. You should see something like this:
∞
Newbiely | Arduino IDE 2.3.8
──
☐
✕
File
Edit
Sketch
Tools
Help
ESP32S3 Dev Module
Newbiely.ino
···
8 Serial.println("Hello World!");
Output
Serial Monitor
Message (Enter to send message to 'ESP32S3 Dev Module' on 'COM15')
New Line
9600 baud
DIYables Bluetooth - ESP32 S3 Uno BLE Analog Gauge Example Waiting for Bluetooth connection... Gauge range: 0.00 - 100.00 km/h
Ln 11, Col 1
ESP32S3 Dev Module on COM15
2
  1. 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.

  1. Install the app: get the DIYables Bluetooth App for Android or iOS.
  2. 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
  • Turn on Bluetooth on your phone.
  • Scan: on the home screen, tap the Connect button.
  • DIYables Bluetooth App - Home Screen with Scan Button
    1. Connect: tap "ESP32BLE_Gauge" in the scan results. The app goes back to the home screen when the link is ready.
    2. Open the gauge: select the Analog Gauge app from the menu.
    DIYables Bluetooth App - Home Screen with Analog Gauge App
    1. Watch the needle: it swings up and down as the sine wave values arrive.
    DIYables Bluetooth App - Analog Gauge Screen
    1. 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:

    ∞
    Newbiely | Arduino IDE 2.3.8
    ──
    ☐
    ✕
    File
    Edit
    Sketch
    Tools
    Help
    ESP32S3 Dev Module
    Newbiely.ino
    ···
    8 Serial.println("Hello World!");
    Output
    Serial Monitor
    Message (Enter to send message to 'ESP32S3 Dev Module' on 'COM15')
    New Line
    9600 baud
    Bluetooth connected! Initial value sent: 52.50 km/h Gauge: 55.0 km/h Gauge: 57.5 km/h Gauge: 59.9 km/h
    Ln 11, Col 1
    ESP32S3 Dev Module on COM15
    2

    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.

    // Constructor: DIYables_BluetoothAnalogGauge(min, max, unit) DIYables_BluetoothAnalogGauge bluetoothGauge(0.0, 100.0, "km/h"); // Change range at runtime bluetoothGauge.setRange(0.0, 200.0); // Change unit bluetoothGauge.setUnit("MPH"); // Read current configuration float minVal = bluetoothGauge.getMin(); // Returns 0.0 float maxVal = bluetoothGauge.getMax(); // Returns 100.0 String unit = bluetoothGauge.getUnit(); // Returns "km/h"

    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.

    // Send current reading float speed = 72.5; bluetoothGauge.send(speed); // Send text message bluetoothGauge.send("Calibrating...");

    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.

    bluetoothGauge.onValueRequest([]() { float currentValue = readSensor(); bluetoothGauge.send(currentValue); Serial.println("App requested value: " + String(currentValue)); });

    Handle Connection Events

    These two callbacks run when the phone connects or leaves. Sending a value on connect means the gauge never starts empty.

    bluetoothServer.setOnConnected([]() { Serial.println("Bluetooth connected!"); bluetoothGauge.send(currentValue); // Send current reading }); bluetoothServer.setOnDisconnected([]() { Serial.println("Bluetooth disconnected!"); });

    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.

    ESP32 S3 Uno pinout diagram

    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
    const int VOLTAGE_PIN = 2; // A0 (GPIO2) const float VREF = 3.3; const float DIVIDER_RATIO = 5.0; // Voltage divider ratio // Gauge configured for 0-16V range DIYables_BluetoothAnalogGauge bluetoothGauge(0.0, 16.0, "V"); void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 500) { lastUpdate = millis(); int raw = analogRead(VOLTAGE_PIN); float voltage = (raw / 4095.0) * VREF * DIVIDER_RATIO; bluetoothGauge.send(voltage); Serial.println("Voltage: " + String(voltage, 2) + " V"); } delay(10); }

    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)
    #include <Adafruit_BMP280.h> Adafruit_BMP280 bmp; // Gauge configured for atmospheric pressure range DIYables_BluetoothAnalogGauge bluetoothGauge(900.0, 1100.0, "hPa"); void setup() { Serial.begin(115200); bmp.begin(0x76); // ... Bluetooth setup ... bluetoothGauge.onValueRequest([]() { float pressure = bmp.readPressure() / 100.0; // Pa to hPa bluetoothGauge.send(pressure); }); } void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 1000) { lastUpdate = millis(); float pressure = bmp.readPressure() / 100.0; bluetoothGauge.send(pressure); Serial.println("Pressure: " + String(pressure, 1) + " hPa"); } delay(10); }

    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.

    const int CURRENT_PIN = 2; // A0 (GPIO2) const float SENSITIVITY = 0.185; // ACS712-05B: 185mV/A const float ZERO_CURRENT_VOLTAGE = 2.5; // Gauge configured for 0-5A range DIYables_BluetoothAnalogGauge bluetoothGauge(0.0, 5.0, "A"); void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 200) { lastUpdate = millis(); int raw = analogRead(CURRENT_PIN); float voltage = (raw / 4095.0) * 3.3; float current = abs((voltage - ZERO_CURRENT_VOLTAGE) / SENSITIVITY); bluetoothGauge.send(current); Serial.println("Current: " + String(current, 2) + " A"); } delay(10); }

    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)
    volatile unsigned long pulseCount = 0; const int ENCODER_PIN = 18; // D2 (GPIO18) const float PULSES_PER_REV = 20.0; const float WHEEL_CIRCUMFERENCE = 0.628; // meters (20cm diameter) DIYables_BluetoothAnalogGauge bluetoothGauge(0.0, 50.0, "km/h"); void IRAM_ATTR countPulse() { pulseCount++; } void setup() { Serial.begin(115200); pinMode(ENCODER_PIN, INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(ENCODER_PIN), countPulse, RISING); // ... Bluetooth setup ... } void loop() { bluetoothServer.loop(); static unsigned long lastCalc = 0; if (millis() - lastCalc >= 500) { unsigned long elapsed = millis() - lastCalc; lastCalc = millis(); noInterrupts(); unsigned long count = pulseCount; pulseCount = 0; interrupts(); float revPerSec = (count / PULSES_PER_REV) / (elapsed / 1000.0); float speedKmh = revPerSec * WHEEL_CIRCUMFERENCE * 3.6; bluetoothGauge.send(speedKmh); Serial.println("Speed: " + String(speedKmh, 1) + " km/h"); } delay(10); }

    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.

    float displayValue = 0; float targetValue = 0; const float SMOOTHING = 0.1; // 0.0-1.0, lower = smoother void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 50) { // 20 FPS lastUpdate = millis(); targetValue = readSensor(); displayValue += (targetValue - displayValue) * SMOOTHING; bluetoothGauge.send(displayValue); } delay(5); }

    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.

    float peakValue = 0; unsigned long peakTime = 0; const unsigned long PEAK_HOLD_MS = 3000; // Hold peak for 3 seconds void updateWithPeakHold(float value) { if (value > peakValue) { peakValue = value; peakTime = millis(); } if (millis() - peakTime > PEAK_HOLD_MS) { peakValue = value; // Reset peak } // Send the higher of current or peak bluetoothGauge.send(max(value, peakValue)); }

    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.

    float autoMin = 0; float autoMax = 100; void autoScale(float value) { bool changed = false; if (value < autoMin) { autoMin = value - 10; changed = true; } if (value > autoMax) { autoMax = value + 10; changed = true; } if (changed) { bluetoothGauge.setRange(autoMin, autoMax); } bluetoothGauge.send(value); }

    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.

    void debugGauge(float value) { Serial.println("=== Gauge Debug ==="); Serial.println("Value: " + String(value, 2) + " " + bluetoothGauge.getUnit()); Serial.println("Range: " + String(bluetoothGauge.getMin(), 1) + " - " + String(bluetoothGauge.getMax(), 1)); Serial.println("In Range: " + String(value >= bluetoothGauge.getMin() && value <= bluetoothGauge.getMax() ? "Yes" : "No")); float percentage = (value - bluetoothGauge.getMin()) / (bluetoothGauge.getMax() - bluetoothGauge.getMin()) * 100.0; Serial.println("Percentage: " + String(percentage, 1) + "%"); Serial.println("==================="); }

    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.

    // Gauge shows pressure bluetoothGauge.send(pressure); // Temperature shows temperature bluetoothTemperature.send(temperature);

    Combine with Bluetooth Table

    Use the gauge for a quick look and a table for the details.

    float speed = readSpeed(); bluetoothGauge.send(speed); bluetoothTable.sendValueUpdate("Speed", String(speed, 1) + " km/h"); bluetoothTable.sendValueUpdate("Distance", String(totalDistance, 2) + " km"); bluetoothTable.sendValueUpdate("Max Speed", String(maxSpeed, 1) + " km/h"); bluetoothTable.sendValueUpdate("Avg Speed", String(avgSpeed, 1) + " km/h");

    Next Steps

    Once the gauge works on your ESP32 S3 Uno, try these examples next:

    1. Bluetooth Temperature - a display made for temperature
    2. Bluetooth Plotter - to see how a value changes over time
    3. Bluetooth Table - to show many values in rows
    4. Multiple Bluetooth Apps - to combine the gauge with other screens

    Support

    If you get stuck, these places can help:

    1. The API reference that comes with the DIYables Bluetooth library
    2. 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

    ※ OUR MESSAGES

    • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
    • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!