GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsThe ESP32 includes Bluetooth Low Energy. In this project it creates a BLE service with one characteristic that holds the temperature from a DHT22. A free app such as nRF Connect lets you connect and read or subscribe to the value, with no Wi-Fi router and no internet. This is the pattern behind every BLE sensor, so you can reuse it for humidity, battery level or any number.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB cable or a small power bank.
ble_temp.inoVerify & upload in Electrolark#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
#include <DHT.h>
#define SERVICE_UUID "181A" // Environmental Sensing
#define CHAR_UUID "2A6E" // Temperature
DHT dht(4, DHT22);
BLECharacteristic* tempChar;
void setup() {
Serial.begin(115200);
dht.begin();
BLEDevice::init("GB-Temp");
BLEServer* server = BLEDevice::createServer();
BLEService* service = server->createService(SERVICE_UUID);
tempChar = service->createCharacteristic(CHAR_UUID, BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_NOTIFY);
tempChar->addDescriptor(new BLE2902());
service->start();
BLEDevice::getAdvertising()->addServiceUUID(SERVICE_UUID);
BLEDevice::startAdvertising();
}
void loop() {
float t = dht.readTemperature();
if (!isnan(t)) {
String text = String(t, 1) + " C";
tempChar->setValue(text.c_str());
tempChar->notify();
Serial.println(text);
}
delay(3000);
}
Make sure Bluetooth and location are on, and that the sketch uploaded. Reset the ESP32 and scan again.
The app may show raw bytes. Switch the app's format to UTF-8 text.
Add a callback that calls startAdvertising again on disconnect, as many BLE examples do.
Yes. BLE needs no router or internet.
About 10 metres indoors, less through walls.
Yes. For long life use deep sleep between readings.
4 parts: ESP32-WROOM-32 38-Pin Development Board, DHT22 AM2302 Digital Temperature & Humidity Sensor, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 1.5 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (ble_temp.ino).
About ₹585 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
BLE services and characteristics; Notifying a phone when a value changes; Reading a DHT22.
Ideas that reuse this build: ESP32 OLED internet clock. They are listed under Take it further on this page.
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Records where you went every five seconds, ready to open on a map.
Two boards, two radios: press the button at the gate and it rings indoors.
Check temperature, humidity and pressure from any phone on your Wi-Fi.
Learning project. Check every circuit and the datasheet of each part before you power it up.