GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsControl a set of simulated appliances from a phone, each with its own state and a running total of what is switched on. Remote GPIO control is the simple part; the interesting design work is in the command grammar. Named commands like light on read far better than single letters, and a scene command that sets several appliances at once is what turns a remote control into home automation. Each appliance carries a notional wattage, so the running total shows the consequence of a scene rather than just its state.
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
LEDs from the kit's red, green, yellow and blue packs
220 ohm resistors: one in series with every LED
HC-05 Bluetooth module: a serial link to your phone
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_089_bluetooth_home_appliance_s.inoVerify & upload in Electrolark#include <HardwareSerial.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define DEVICES 4
HardwareSerial bt(2); // UART2: RX on GPIO16, TX on GPIO17
Adafruit_SSD1306 display(128, 64, &Wire, -1);
int pins[DEVICES] = {14, 27, 26, 25};
String names[DEVICES] = {"light", "fan", "heater", "kettle"};
int watts[DEVICES] = {12, 60, 1200, 2000};
bool state[DEVICES] = {false, false, false, false};
String input = "";
String lastAction = "ready";
int totalWatts()
{
int total = 0;
for (int i = 0; i < DEVICES; i++)
{
if (state[i]) total = total + watts[i];
}
return total;
}
void applyState()
{
for (int i = 0; i < DEVICES; i++)
{
digitalWrite(pins[i], state[i]);
}
}
void report()
{
bt.println("--- Status ---");
for (int i = 0; i < DEVICES; i++)
{
bt.print(names[i]);
bt.print(": ");
bt.print(state[i] ? "ON " : "OFF ");
bt.print(watts[i]);
bt.println("W");
}
bt.print("Total draw: ");
bt.print(totalWatts());
bt.println("W");
}
void handle(String line)
{
line.trim();
line.toLowerCase();
if (line.length() == 0) return;
String device = line;
String action = "";
int space = line.indexOf(' ');
if (space > 0)
{
device = line.substring(0, space);
action = line.substring(space + 1);
}
if (device == "status") { report(); return; }
if (device == "all")
{
bool on = (action == "on");
for (int i = 0; i < DEVICES; i++) state[i] = on;
lastAction = on ? "all on" : "all off";
applyState();
bt.println(lastAction);
return;
}
if (device == "scene")
{
if (action == "evening")
{
state[0] = true; state[1] = true; state[2] = false; state[3] = false;
lastAction = "scene evening";
}
else if (action == "away")
{
for (int i = 0; i < DEVICES; i++) state[i] = false;
lastAction = "scene away";
}
else if (action == "morning")
{
state[0] = true; state[1] = false; state[2] = false; state[3] = true;
lastAction = "scene morning";
}
else
{
bt.println("Scenes: evening, morning, away");
return;
}
applyState();
bt.print("Applied ");
bt.println(lastAction);
return;
}
for (int i = 0; i < DEVICES; i++)
{
if (device == names[i])
{
if (action == "on") state[i] = true;
else if (action == "off") state[i] = false;
else state[i] = !state[i];
applyState();
lastAction = names[i] + " " + (state[i] ? "on" : "off");
bt.print(names[i]);
bt.println(state[i] ? " is on" : " is off");
return;
}
}
bt.println("Try: light on, fan off, all off, scene evening, status");
}
void setup()
{
for (int i = 0; i < DEVICES; i++)
{
pinMode(pins[i], OUTPUT);
}
bt.begin(9600, SERIAL_8N1, 16, 17);
Serial.begin(9600);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { while (true) { } }
display.setTextColor(SSD1306_WHITE);
display.setTextSize(1);
applyState();
bt.println("Home simulator ready. Send status for a list");
}
void loop()
{
while (bt.available())
{
char c = bt.read();
if (c == '\n') { handle(input); input = ""; }
else if (c != '\r') { input = input + c; }
}
display.clearDisplay();
display.setCursor(0, 0);
display.print("HOME SIMULATOR");
for (int i = 0; i < DEVICES; i++)
{
int y = 13 + i * 10;
display.setCursor(0, y);
display.print(names[i]);
display.setCursor(60, y);
display.print(state[i] ? "ON " : "OFF");
display.setCursor(90, y);
if (state[i])
{
display.print(watts[i]);
display.print("W");
}
}
display.drawLine(0, 52, 127, 52, SSD1306_WHITE);
display.setCursor(0, 55);
display.print("Total ");
display.print(totalWatts());
display.print("W ");
display.print(lastAction);
display.display();
}
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.
Turn it round: the long leg (anode) goes to the GPIO side through the 220 ohm resistor, the short leg to GND.
Check SDA on GPIO21 and SCL on GPIO22, power from 3V3, and that the sketch uses address 0x3C (some boards are 0x3D).
Pair with the HC-05 using PIN 1234 (or 0000), then connect in a Bluetooth serial terminal app. TXD goes to GPIO16 (RX2), RXD to GPIO17 (TX2).
Remote GPIO control is the simple part; the interesting design work is in the command grammar. Named commands like light on read far better than single letters, and a scene command that sets several appliances at once is what turns a remote control into home automation. Each appliance carries a notional wattage, so the running total shows the consequence of a scene rather than just its state.
A list of four appliances with their state and power draw. Send light on and the first LED lights, adding 12W to the total. Send scene evening to set several at once.
Yes. It is project 89 of 120 in the Geekobot Titan Kit, in level 13 (Bluetooth). 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 on the ESP32 expansion board and the breadboard with jumper wires.
9 parts: ESP32-WROOM-32 38-Pin Development Board, USB Cable, Solderless Breadboard, Dupont Jumper Wires (40 pcs), 4 × Through-Hole LED Pack (Pack of 10), Carbon Film Resistor 1/4W 5% (Pack of 10), 0.96" OLED Display 128x64, HC-05 6-Pin Bluetooth Serial Module with Button 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 6 steps.
No. This page has the complete, tested code (titan_kit_089_bluetooth_home_appliance_s.ino).
About ₹1,095 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Remote GPIO control; Designing a readable command grammar; Scenes that set several devices at once; Deriving a total from device states.
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.