Level: Advanced Board: ESP32-C3 SuperMini Climate
⚠ SafetyLow voltage only.
What you need
Buy the parts kit · Estimated total: $10.30
ESP32-C3 SuperMini × 1
$2.50
BME280 I2C module (3.3V) × 1
$3.00
18650 Li-ion cell + holder × 1
$4.00
TP4056 USB-C Li-ion charger with protection × 1
$0.80
Some links are affiliate links: we may earn a commission at no extra cost to you.
Libraries
Arduino IDE → Tools → Manage Libraries, then install:
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
⚠ CautionBatteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.
A small outdoor station on a Li-ion cell and a solar panel that reports temperature, humidity and pressure trend every few minutes.
⚠ CautionBatteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.
A battery sensor that wakes up rarely and sends an alert when the temperature falls toward freezing.
⚠ CautionBatteries: watch polarity, use protected cells and a charger with protection, never charge damaged cells unattended.
Several battery nodes send readings over ESP-NOW without joining Wi-Fi, and one gateway forwards them to MQTT or Home Assistant.
Comments
No comments yet. Share your experience or ask a question.