GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsRead temperature, humidity and air pressure and show them on a web page that any phone or laptop on your Wi-Fi can open. The DHT11 measures temperature and humidity and the BMP280 measures air pressure. The ESP32 joins your home or school Wi-Fi and runs a web server: the home page shows the latest readings and refreshes itself every five seconds, and /data returns the same numbers as JSON for a spreadsheet or app.
The ESP32 is a 3.3V board: never connect a 5V signal straight to a GPIO pin.
Every part for this build comes in the Geekobot Titan Kit box, a Geekobot exclusive, together with the parts for all 120 projects, from a first blinking LED to a smart fan and a reaction game. The wiring below is the kit's own wiring.
Tick anything you already have and the total updates.
ESP32 DevKit V1 (38-pin): the brain of every Titan Kit project, with Wi-Fi and Bluetooth
Male-to-female and female-to-female leads for the modules
DHT11 temperature and humidity sensor
BMP280 pressure and temperature sensor on I2C (3.3V board)
ESP32 expansion board from the kit: every GPIO has its own S, V, G header
Follow the colours: red is power, dark grey is ground, blue is a signal.
titan_kit_107_wifi_weather_station.inoVerify & upload in Electrolark#include <WiFi.h>
#include <WebServer.h>
#include <Wire.h>
#include <Adafruit_BMP280.h>
#include <DHT.h>
const char* ssid = "YOUR_WIFI_NAME"; // your 2.4 GHz Wi-Fi
const char* password = "YOUR_WIFI_PASSWORD";
DHT dht(4, DHT11);
Adafruit_BMP280 bmp;
WebServer server(80);
float temp = 0, hum = 0, pres = 0;
unsigned long lastRead = 0;
void readSensors()
{
float t = dht.readTemperature();
float h = dht.readHumidity();
if (!isnan(t)) temp = t; // keep the last good reading if one read fails
if (!isnan(h)) hum = h;
pres = bmp.readPressure() / 100.0; // pascals to hPa
}
void handleRoot()
{
String h = "<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width, initial-scale=1'>";
h += "<meta http-equiv='refresh' content='5'><title>Titan Weather</title>";
h += "<style>body{font-family:sans-serif;text-align:center}div{font-size:28px;margin:14px}</style></head><body>";
h += "<h2>Titan Weather Station</h2>";
h += "<div>Temperature: " + String(temp, 1) + " °C</div>";
h += "<div>Humidity: " + String(hum, 0) + " %</div>";
h += "<div>Pressure: " + String(pres, 1) + " hPa</div>";
h += "<p>Refreshes every 5 seconds</p></body></html>";
server.send(200, "text/html", h);
}
void handleData()
{
String j = "{\"temperature\":" + String(temp, 1) + ",\"humidity\":" + String(hum, 0) + ",\"pressure\":" + String(pres, 1) + "}";
server.send(200, "application/json", j);
}
void setup()
{
Serial.begin(9600);
dht.begin();
if (!bmp.begin(0x76))
{
Serial.println("BMP280 not found: check SDA and SCL, or try address 0x77");
}
WiFi.begin(ssid, password);
Serial.print("Connecting to Wi-Fi");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("Open http://");
Serial.println(WiFi.localIP());
server.on("/", handleRoot);
server.on("/data", handleData);
server.begin();
readSensors();
}
void loop()
{
server.handleClient();
if (millis() - lastRead > 2000) // the DHT11 needs 2 seconds between reads
{
lastRead = millis();
readSensors();
}
}
Use a micro-USB data cable (some cables only charge), install the CP210x or CH340 driver if no port appears, pick Tools > Board > ESP32 Dev Module and hold the BOOT button on the board until the upload starts.
Type your Wi-Fi name and password into the sketch exactly, and use a 2.4 GHz network: the ESP32 cannot join 5 GHz-only Wi-Fi.
The BMP280 was not found. Check SDA on GPIO21 and SCL on GPIO22, power it from 3V3, and try 0x77 in bmp.begin().
Check that DATA goes to the GPIO in the sketch, and wait two seconds between reads: the DHT11 is slow.
The DHT11 measures temperature and humidity and the BMP280 measures air pressure. The ESP32 joins your home or school Wi-Fi and runs a web server: the home page shows the latest readings and refreshes itself every five seconds, and /data returns the same numbers as JSON for a spreadsheet or app.
The Serial Monitor prints the board's address on your network, for example http://192.168.1.42. Open it on a phone on the same Wi-Fi: temperature, humidity and pressure appear. The numbers update by themselves every five seconds.
Yes. It is project 107 of 120 in the Geekobot Titan Kit, in level 16 (Wi-Fi, IoT and new sensors). Every part on the list comes in the kit box, and you can also buy the parts one by one from the list above.
No. Every Titan Kit project is wired with jumper wires on the ESP32 expansion board and the breadboard.
Weather reports give sea-level pressure. The BMP280 measures the pressure where you are, which is lower the higher you live.
6 parts: ESP32-WROOM-32 38-Pin Development Board, USB Cable, Dupont Jumper Wires (40 pcs), Generic DHT11 Digital Temperature & Humidity Sensor Module, GY-BMP280-3.3 Precision Altimeter Atmospheric Pressure Sensor Module and ESP32 38-Pin Expansion Board. 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 45 minutes. The build on this page has 5 steps.
No. This page has the complete, tested code (titan_kit_107_wifi_weather_station.ino).
About ₹770 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Joining a Wi-Fi network with WiFi.begin(); Reading two sensors and keeping the last good value; Serving HTML and JSON from the same sketch; Converting pascals to hectopascals.
The ESP32 is a 3.3V board: never connect a 5V signal straight to a GPIO pin.
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.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.