ESP32 S3 UNO - DIYables Bluetooth App Temperature

Overview

This ESP32 S3 Uno Bluetooth temperature tutorial shows you how to send temperature readings from the ESP32 S3 Uno form board to a thermometer gauge on your smartphone. The gauge is part of the DIYables Bluetooth STEM app, and it talks to the board over BLE (Bluetooth Low Energy). You pick the range and the unit, so this BLE thermometer fits a room monitor, a weather station or a fridge alarm.

In this tutorial, you will:

  1. Install the DIYables Bluetooth library in Arduino IDE
  2. Upload a BLE temperature sketch to the ESP32 S3 Uno
  3. Connect the DIYables Bluetooth app on Android or iOS and watch the temperature gauge
  4. Change the temperature range and unit (°C, °F or K)
  5. Read a real sensor like the DHT22, DS18B20 or an NTC thermistor
ESP32 S3 Uno Bluetooth temperature

※ 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, and this page shows only the BLE version. 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 temperature app gives you a ready-made thermometer screen. Your sketch only has to send numbers.

Thermometer-style gauge

A visual gauge shows the reading, and a number under it shows the exact value.

Your own range and unit

You choose the minimum, the maximum and the unit text, such as °C, °F or K. You can change them while the sketch is running.

Live updates and requests

The sketch pushes a new reading every 2 seconds. The app can also ask the board for the current temperature 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×Optionally, DS18B20 Temperature Sensor
1×Optionally, DHT11 Temperature Humidity Sensor Module
1×Alternatively, DHT11 Sensor
1×Optionally, DHT22 Temperature Humidity Sensor Module
1×Alternatively, DHT22 Sensor
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 .

Buy Note: Many DS18B20 sensors available in the market are unreliable. We strongly recommend buying the sensor from the DIYables brand using the link provided above. We tested it, and it worked reliably.

ESP32 S3 Uno Code

The main sketch does not need a sensor. It makes a slowly changing value around 25°C 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_Temp" and adds the temperature app with a -10 to 50 °C range. When a phone connects, it sends a reading every 2 seconds and prints it to the Serial Monitor. The readTemperature() function is the only place you need to change when you add a real sensor.

  1. Load the code: in Arduino IDE go to File Examples DIYables Bluetooth Esp32BLE_Temperature, 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-temperature */ /* * DIYables Bluetooth Library - ESP32 S3 Uno BLE Temperature Example * Works with DIYables Bluetooth STEM app on Android and iOS * * This example demonstrates the Bluetooth Temperature feature: * - Display temperature sensor readings * - Configurable temperature range and unit * - Real-time temperature updates * * 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: Temperature sensor (DHT22, DS18B20, or analog thermistor) * * 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 temperature * * Tutorial: https://diyables.io/bluetooth-app * Author: DIYables */ #include <DIYables_BluetoothServer.h> #include <DIYables_BluetoothTemperature.h> #include <platforms/DIYables_Esp32BLE.h> // BLE Configuration const char* DEVICE_NAME = "ESP32BLE_Temp"; 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 Temperature app instance (min=-10°C, max=50°C, unit="°C") DIYables_BluetoothTemperature bluetoothTemperature(-10.0, 50.0, "°C"); // Variables for temperature simulation float currentTemperature = 25.0; unsigned long lastTempUpdate = 0; const unsigned long TEMP_UPDATE_INTERVAL = 2000; // Simulated temperature sensor reading float readTemperature() { // TODO: Replace with actual sensor reading static float offset = 0; offset += random(-10, 11) / 10.0; if (offset > 5.0) offset = 5.0; if (offset < -5.0) offset = -5.0; return 25.0 + offset; } void setup() { Serial.begin(115200); delay(1000); Serial.println("DIYables Bluetooth - ESP32 S3 Uno BLE Temperature Example"); // Initialize Bluetooth server with platform-specific implementation bluetoothServer.begin(); // Add temperature app to server bluetoothServer.addApp(&bluetoothTemperature); // Set up connection event callbacks bluetoothServer.setOnConnected([]() { Serial.println("Bluetooth connected!"); float temp = readTemperature(); bluetoothTemperature.send(temp); Serial.print("Initial temperature sent: "); Serial.print(temp); Serial.println("°C"); }); bluetoothServer.setOnDisconnected([]() { Serial.println("Bluetooth disconnected!"); }); bluetoothTemperature.onTemperatureRequest([]() { float temp = readTemperature(); bluetoothTemperature.send(temp); Serial.print("Temperature requested - Sent: "); Serial.print(temp); Serial.println("°C"); }); Serial.println("Waiting for Bluetooth connection..."); } void loop() { bluetoothServer.loop(); if (bluetooth.isConnected() && millis() - lastTempUpdate >= TEMP_UPDATE_INTERVAL) { lastTempUpdate = millis(); currentTemperature = readTemperature(); bluetoothTemperature.send(currentTemperature); Serial.print("Temperature: "); Serial.print(currentTemperature); Serial.println("°C"); } 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 Temperature Example Waiting for Bluetooth connection...
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 reading that goes to the gauge.

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_Temp" in the scan results. The app goes back to the home screen when the link is ready.
    2. Open the thermometer: select the Temperature app from the menu.
    DIYables Bluetooth App - Home Screen with Temperature App
    1. Watch the gauge: it shows the current reading and moves as new values arrive.
    DIYables Bluetooth App - Temperature 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 temperature sent: 24.90°C Temperature: 24.50°C Temperature: 24.80°C Temperature: 25.10°C
    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 make the gauge match your sensor and your project.

    Configure Temperature 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 Celsius to Fahrenheit.

    // Constructor: DIYables_BluetoothTemperature(min, max, unit) DIYables_BluetoothTemperature bluetoothTemperature(-10.0, 50.0, "°C"); // Change range at runtime bluetoothTemperature.setRange(-20.0, 60.0); // Change unit bluetoothTemperature.setUnit("°F"); // Read current configuration float minTemp = bluetoothTemperature.getMin(); // Returns -10.0 float maxTemp = bluetoothTemperature.getMax(); // Returns 50.0 String unit = bluetoothTemperature.getUnit(); // Returns "°C"

    Send Temperature Value

    Call send() with a number to update the gauge. You can also send a short text, which is useful when the sensor fails.

    // Send current temperature reading float temperature = 25.3; bluetoothTemperature.send(temperature); // Send text message bluetoothTemperature.send("Sensor error");

    Handle Temperature Requests from App

    The app can ask for the latest reading, for example right after the temperature screen opens. This callback reads the sensor and answers at once.

    bluetoothTemperature.onTemperatureRequest([]() { float temp = readTemperature(); bluetoothTemperature.send(temp); Serial.println("App requested temperature: " + String(temp)); });

    Handle Connection Events

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

    bluetoothServer.setOnConnected([]() { Serial.println("Bluetooth connected!"); // Send current temperature immediately bluetoothTemperature.send(currentTemperature); }); bluetoothServer.setOnDisconnected([]() { Serial.println("Bluetooth disconnected!"); });

    How to Use the Temperature Display

    It helps to know what each part of the screen means, so you can pick a good range and unit.

    App Interface

    The temperature screen has a thermometer gauge that fills up with the current reading. A number shows the exact value next to the unit text you set in the code. The ends of the scale show the minimum and maximum of your range.

    Temperature Units

    Unit Constructor
    Celsius DIYables_BluetoothTemperature(-10.0, 50.0, "°C")
    Fahrenheit DIYables_BluetoothTemperature(14.0, 122.0, "°F")
    Kelvin DIYables_BluetoothTemperature(263.0, 323.0, "K")

    ESP32 S3 Uno Pinout

    The examples below connect real sensors to the board. The image shows the ESP32 S3 Uno form board pinout, so you can find the Uno header pins (D2, A0) 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.

    DHT22 Sensor Reading

    The DHT22 data pin goes to D2 (GPIO18). Power the module from 3.3V, so its data signal stays safe for the ESP32 S3 Uno. Most DHT modules already have a pull-up resistor on the data line. With a bare sensor, add a 4.7k to 10k resistor between DATA and 3.3V.

    DHT22 Pin ESP32 S3 Uno Pin
    VCC 3.3V
    GND GND
    DATA D2 (GPIO18)
    #include <DHT.h> #define DHT_PIN 18 // D2 (GPIO18) #define DHT_TYPE DHT22 DHT dht(DHT_PIN, DHT_TYPE); void setup() { Serial.begin(115200); dht.begin(); // ... Bluetooth setup ... bluetoothTemperature.onTemperatureRequest([]() { float temp = dht.readTemperature(); if (!isnan(temp)) { bluetoothTemperature.send(temp); } }); } void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 2000) { lastUpdate = millis(); float temp = dht.readTemperature(); if (!isnan(temp)) { bluetoothTemperature.send(temp); Serial.println("Temperature: " + String(temp, 1) + " °C"); } } delay(10); }

    For a DHT11, change DHT_TYPE to DHT11. The wiring stays the same.

    DS18B20 One-Wire Sensor

    The DS18B20 uses one data wire on D2 (GPIO18). It needs a 4.7k pull-up resistor between DATA and 3.3V. Its range is -55°C to +125°C, so you can set a wide gauge range for it.

    DS18B20 Pin ESP32 S3 Uno Pin
    VCC (red) 3.3V
    GND (black) GND
    DATA (yellow) D2 (GPIO18), plus 4.7k resistor to 3.3V
    #include <OneWire.h> #include <DallasTemperature.h> #define ONE_WIRE_PIN 18 // D2 (GPIO18) OneWire oneWire(ONE_WIRE_PIN); DallasTemperature sensors(&oneWire); void setup() { Serial.begin(115200); sensors.begin(); // ... Bluetooth setup with range matching sensor capability ... // DS18B20 range: -55°C to +125°C bluetoothTemperature.onTemperatureRequest([]() { sensors.requestTemperatures(); float temp = sensors.getTempCByIndex(0); if (temp != DEVICE_DISCONNECTED_C) { bluetoothTemperature.send(temp); } }); } void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 1000) { lastUpdate = millis(); sensors.requestTemperatures(); float temp = sensors.getTempCByIndex(0); if (temp != DEVICE_DISCONNECTED_C) { bluetoothTemperature.send(temp); Serial.println("Temperature: " + String(temp, 1) + " °C"); } else { Serial.println("Sensor disconnected!"); } } delay(10); }

    NTC Thermistor Reading

    A 10k NTC thermistor and a 10k fixed resistor make a voltage divider. Feed the divider from 3.3V and connect the middle point to A0 (GPIO2). The code uses the Steinhart-Hart (B value) formula to turn the 12-bit reading (0 to 4095) into °C.

    Divider Point ESP32 S3 Uno Pin
    Top of 10k series resistor 3.3V
    Middle point (resistor and thermistor) A0 (GPIO2)
    Bottom of thermistor GND
    const int THERMISTOR_PIN = 2; // A0 (GPIO2) const float SERIES_RESISTOR = 10000.0; const float NOMINAL_RESISTANCE = 10000.0; const float NOMINAL_TEMP = 25.0; const float B_COEFFICIENT = 3950.0; float readThermistor() { int raw = analogRead(THERMISTOR_PIN); float resistance = SERIES_RESISTOR / (4095.0 / raw - 1.0); float steinhart = log(resistance / NOMINAL_RESISTANCE) / B_COEFFICIENT; steinhart += 1.0 / (NOMINAL_TEMP + 273.15); float temperature = 1.0 / steinhart - 273.15; return temperature; } void setup() { Serial.begin(115200); // set the ADC attenuation to 11 dB (up to ~3.3V input) analogSetAttenuation(ADC_11db); // ... Bluetooth setup ... } void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 1000) { lastUpdate = millis(); float temp = readThermistor(); bluetoothTemperature.send(temp); Serial.println("Temperature: " + String(temp, 1) + " °C"); } delay(10); }

    The setup() function calls analogSetAttenuation(ADC_11db). By default, the ESP32 S3 Uno ADC can only measure a small voltage. With 11 dB attenuation, A0 (GPIO2) reads the full range from 0V up to about 3.3V, so the divider uses the whole 0 to 4095 scale. Without it, readings hit 4095 too early and the temperature looks wrong.

    Fahrenheit Display

    This version reads the DHT sensor in Celsius, converts the value and shows it in °F.

    // Configure for Fahrenheit display DIYables_BluetoothTemperature bluetoothTemperature(32.0, 122.0, "°F"); float celsiusToFahrenheit(float celsius) { return celsius * 9.0 / 5.0 + 32.0; } void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 2000) { lastUpdate = millis(); float tempC = dht.readTemperature(); if (!isnan(tempC)) { float tempF = celsiusToFahrenheit(tempC); bluetoothTemperature.send(tempF); Serial.println("Temperature: " + String(tempF, 1) + " °F"); } } delay(10); }

    Advanced Programming Techniques

    Raw sensor values can jump a little. These small helpers make the display calmer and more useful.

    Temperature Averaging / Smoothing

    This code keeps the last 10 readings and sends their average. Small jumps disappear, and real changes still show after a few seconds.

    const int NUM_SAMPLES = 10; float samples[NUM_SAMPLES]; int sampleIndex = 0; bool bufferFull = false; float getSmoothedTemperature(float newReading) { samples[sampleIndex] = newReading; sampleIndex = (sampleIndex + 1) % NUM_SAMPLES; if (sampleIndex == 0) bufferFull = true; int count = bufferFull ? NUM_SAMPLES : sampleIndex; float sum = 0; for (int i = 0; i < count; i++) { sum += samples[i]; } return sum / count; } void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 1000) { lastUpdate = millis(); float rawTemp = readTemperature(); float smoothed = getSmoothedTemperature(rawTemp); bluetoothTemperature.send(smoothed); Serial.println("Raw: " + String(rawTemp, 2) + " Smoothed: " + String(smoothed, 2) + " °C"); } delay(10); }

    Alert Threshold Detection

    This function sends a text alert to the app when the temperature goes above 35°C or below 5°C. The alert is sent only once, until the value comes back into the normal band.

    const float HIGH_THRESHOLD = 35.0; const float LOW_THRESHOLD = 5.0; bool alertActive = false; void checkTemperatureAlerts(float temp) { if (temp > HIGH_THRESHOLD && !alertActive) { alertActive = true; bluetoothTemperature.send("HIGH TEMP ALERT!"); Serial.println("High temperature alert: " + String(temp, 1) + " °C"); // Activate cooling fan, buzzer, etc. } else if (temp < LOW_THRESHOLD && !alertActive) { alertActive = true; bluetoothTemperature.send("LOW TEMP ALERT!"); Serial.println("Low temperature alert: " + String(temp, 1) + " °C"); // Activate heater, etc. } else if (temp > LOW_THRESHOLD && temp < HIGH_THRESHOLD) { alertActive = false; } }

    Hardware Integration Ideas

    Many temperature sensors can drive the gauge. Keep every signal that goes into the ESP32 S3 Uno at 3.3V or less.

    DHT22 / DHT11

    These connect to one digital pin and also give humidity. They are a popular choice for indoor monitoring.

    DS18B20 waterproof probe

    It uses the OneWire bus and comes in a waterproof version. It is great for water, soil and outdoor use.

    BME280 / BMP280

    These I2C sensors measure temperature, humidity (BME280) and air pressure with good accuracy. On the ESP32 S3 Uno, wire them to the SDA (GPIO8) and SCL (GPIO9) header pins, not A4 and A5.

    NTC thermistor

    A cheap analog sensor that works in a voltage divider on an analog pin such as A0 (GPIO2).

    Thermocouple (MAX6675 / MAX31855)

    These measure very high temperatures, up to 1000°C and more, for ovens and kilns. They use SPI, and D10 to D13 on the ESP32 S3 Uno match the default SPI pins.

    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 (Esp32Bluetooth_Temperature) does not work here. The table shows what BLE gives you.

    Feature ESP32 S3 Uno (BLE, Esp32BLE_Temperature)
    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 gauge shows something odd, print the value and the range. This small function puts everything in the Serial Monitor so you can compare it with the app.

    void debugTemperature(float temp) { Serial.println("=== Temperature Debug ==="); Serial.println("Value: " + String(temp, 2) + " " + bluetoothTemperature.getUnit()); Serial.println("Range: " + String(bluetoothTemperature.getMin(), 1) + " - " + String(bluetoothTemperature.getMax(), 1)); Serial.println("In Range: " + String(temp >= bluetoothTemperature.getMin() && temp <= bluetoothTemperature.getMax() ? "Yes" : "No")); Serial.println("========================="); }

    Project Ideas

    Need some inspiration? These projects all fit the temperature gauge well.

    Home and environment

    An indoor room thermometer, an outdoor weather station, a fridge or freezer monitor, or a greenhouse climate monitor.

    Kitchen and food

    A cooking thermometer, a sous vide display, a fermentation tracker or an oven thermometer.

    Industrial and lab

    A server room alert, a chemical process monitor, an incubator display or a soldering iron readout.

    Water and aquatics

    An aquarium thermometer, a pool or spa display, a hot water heater monitor or a hydroponics water sensor.

    Integration with Other Bluetooth Apps

    The temperature gauge works well next to other DIYables Bluetooth apps. One server can run several apps at once.

    Combine with Bluetooth Plotter

    Show the current reading on the gauge and draw the trend on the plotter.

    void loop() { bluetoothServer.loop(); static unsigned long lastUpdate = 0; if (millis() - lastUpdate >= 2000) { lastUpdate = millis(); float temp = readTemperature(); // Show on temperature gauge bluetoothTemperature.send(temp); // Plot trend over time bluetoothPlotter.send(temp); } delay(10); }

    Combine with Bluetooth Table

    Use the gauge for a quick look and a table for the details, such as the daily minimum, maximum and average.

    // Temperature gauge for primary reading bluetoothTemperature.send(temp); // Table for detailed breakdown bluetoothTable.sendValueUpdate("Current", String(temp, 1) + " °C"); bluetoothTable.sendValueUpdate("Min Today", String(minTemp, 1) + " °C"); bluetoothTable.sendValueUpdate("Max Today", String(maxTemp, 1) + " °C"); bluetoothTable.sendValueUpdate("Average", String(avgTemp, 1) + " °C");

    Next Steps

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

    1. Bluetooth Analog Gauge - a general dial for pressure, speed and more
    2. Bluetooth Plotter - to see how the temperature changes over time
    3. Bluetooth Table - to show many sensor values in rows
    4. Multiple Bluetooth Apps - to combine the temperature 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_Temperature example. It works with the app on Android and iOS.

    Do I need a sensor to try the ESP32 S3 Uno Bluetooth thermometer?

    No. The main sketch makes a value that drifts between 20°C and 30°C, so the gauge moves without any wiring. When you are ready, put your sensor code inside readTemperature() and connect the sensor, for example a DHT22 or DS18B20 on D2 (GPIO18).

    Can I power a DHT22 or DS18B20 from 5V on the ESP32 S3 Uno?

    It is safer to use 3.3V. The ESP32 S3 Uno pins are 3.3V logic and are not 5V tolerant, and the data line is pulled up to the supply voltage. Both the DHT22 and the DS18B20 work well at 3.3V. If you must use 5V, add a level shifter on the data line.

    Why does the code call analogSetAttenuation(ADC_11db)?

    It is used in the NTC thermistor example. It sets the ESP32 S3 Uno ADC input range to about 0 to 3.3V, so the full divider 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.

    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 thermistor, GPIO15 or GPIO16 is the best choice; for more DHT or DS18B20 sensors, use GPIO35 to GPIO42, not GPIO47 or GPIO48, because those are output only. 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_Temp 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_Temperature instead of the BluetoothSerial one
    Reading is NaN or -127 Sensor wiring wrong or pull-up resistor missing Check the data wire on D2 (GPIO18), power the sensor from 3.3V, and add a 4.7k pull-up for the DS18B20
    Gauge shows a wrong range Min, max or unit in the constructor do not fit the sensor Change the constructor values or call setRange() and setUnit()
    Thermistor reads far too low or high Divider wired wrong or no ADC attenuation Feed the divider from 3.3V, check A0 (GPIO2), and keep analogSetAttenuation(ADC_11db) in setup()
    Temperature does not update bluetoothServer.loop() missing or send() not called Call bluetoothServer.loop() in every loop() run and send a new value at a fixed interval

    ※ 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!