BLE temperature beacon (ESP32-C3)

Broadcasts DS18B20 temperature through the standard Environmental Sensing service, readable from any phone app.

Level: Advanced Board: ESP32-C3 SuperMini Climate

⚠ Safety

Low voltage only.

What you need

Buy the parts kit · Estimated total: $10.30

ESP32-C3 SuperMini × 1
$2.50
Buy at AliExpress Buy at Amazon.com
BME280 I2C module (3.3V) × 1
$3.00
Buy at AliExpress Buy at Amazon.com
18650 Li-ion cell + holder × 1
$4.00
Buy at AliExpress Buy at Amazon.com
TP4056 USB-C Li-ion charger with protection × 1
$0.80
Buy at AliExpress Buy at Amazon.com
🇺🇦 Ukraine🌍 Other countries

Other countries: order these parts on AliExpress with the links below.

Some links are affiliate links: we may earn a commission at no extra cost to you.

Wiring

ModuleModule pinESP32 pinNote
BME280 SDA / SCLI2CGPIO8 / GPIO9C3 SuperMini default I2C pins
VCC / GND3V3 / GND

Libraries

Arduino IDE → Tools → Manage Libraries, then install:

  • Adafruit BME280

Code

ble-temp-beacon.ino
#include <Wire.h>
#include <Adafruit_BME280.h>
#include <BLEDevice.h>
#include <BLEAdvertising.h>
Adafruit_BME280 bme;

void setup() {
  Wire.begin(8, 9);
  bme.begin(0x76);
  int16_t t = (int16_t)(bme.readTemperature() * 100);
  uint16_t h = (uint16_t)(bme.readHumidity() * 100);
  bme.setSampling(Adafruit_BME280::MODE_SLEEP);
  BLEDevice::init("ESP32-TH");
  BLEAdvertising* adv = BLEDevice::getAdvertising();
  BLEAdvertisementData ad;
  String payload; payload += (char)(t & 0xFF); payload += (char)(t >> 8); payload += (char)(h & 0xFF); payload += (char)(h >> 8);
  ad.setName("ESP32-TH");
  ad.setManufacturerData(String("\xFF\xFF") + payload);   // test company id 0xFFFF
  adv->setAdvertisementData(ad);
  adv->start();
  delay(3000);                                  // advertise for 3 seconds
  esp_sleep_enable_timer_wakeup(60ULL * 1000000ULL);   // then sleep 60 s
  esp_deep_sleep_start();
}
void loop() {}

Flash a ready firmware from the browser Paste your error into the AI Error Doctor

Build tips

  • Use the nRF Connect app to see the 0x2A6E characteristic.
  • Lower the advertising interval for a longer battery life.

← ← All projects

Related ideas

⚠ Caution

Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.

Solar-powered weather node

A small outdoor station on a Li-ion cell and a solar panel that reports temperature, humidity and pressure trend every few minutes.

  • Board ESP32-C3 SuperMini
  • Level ●●○ Intermediate
  • Build time 2–3 h
Pick parts / kit
⚠ Caution

Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.

Orchard and greenhouse frost alert

A battery sensor that wakes up rarely and sends an alert when the temperature falls toward freezing.

  • Board ESP32-C3 SuperMini
  • Level ●○○ Beginner
  • Build time 1–2 h
Pick parts / kit
⚠ Caution

Batteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.

ESP-NOW sensor network with one gateway

Several battery nodes send readings over ESP-NOW without joining Wi-Fi, and one gateway forwards them to MQTT or Home Assistant.

  • Board ESP32-C3 SuperMini
  • Level ●●● Advanced
  • Build time 2–4 h
Pick parts / kit

Comments

No comments yet. Share your experience or ask a question.

Comments are moderated.