GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsRun a counter that can be reset remotely, with the reset protected by a confirmation step. Anything destructive deserves a confirmation, and a remote command is the easiest thing in the world to send by accident. Sending RESET only arms the operation; a second CONFIRM within ten seconds carries it out, and the window closes on its own. The previous total is kept afterwards so a mistaken reset can still be reported, which costs one variable and has saved a great many people.
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
HC-05 Bluetooth module: a serial link to your phone
IR obstacle sensor: OUT goes LOW when something is in front
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_088_bluetooth_wireless_counter.inoVerify & upload in Electrolark#include <HardwareSerial.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
HardwareSerial bt(2); // UART2: RX on GPIO16, TX on GPIO17
Adafruit_SSD1306 display(128, 64, &Wire, -1);
int sensorPin = 14;
int buzzer = 33;
long count = 0;
long previousTotal = 0;
int resets = 0;
bool lastState = HIGH;
unsigned long lastCount = 0;
bool resetArmed = false;
unsigned long armedAt = 0;
unsigned long armWindow = 10000;
String input = "";
void handle(String line)
{
line.trim();
line.toUpperCase();
if (line.length() == 0) return;
if (line == "RESET")
{
resetArmed = true;
armedAt = millis();
bt.print("Reset requested. Current count is ");
bt.println(count);
bt.println("Send CONFIRM within 10 seconds to proceed");
}
else if (line == "CONFIRM")
{
if (resetArmed && millis() - armedAt < armWindow)
{
previousTotal = count;
count = 0;
resets = resets + 1;
resetArmed = false;
tone(buzzer, 600, 400);
bt.print("Counter reset. Previous total was ");
bt.println(previousTotal);
Serial.println("Counter reset");
}
else
{
bt.println("Nothing to confirm. Send RESET first");
}
}
else if (line == "CANCEL")
{
resetArmed = false;
bt.println("Reset cancelled");
}
else if (line == "COUNT")
{
bt.print("Count is ");
bt.println(count);
}
else
{
bt.println("Commands: COUNT, RESET, CONFIRM, CANCEL");
}
}
void setup()
{
pinMode(sensorPin, INPUT);
pinMode(buzzer, 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);
bt.println("Counter running. Commands: COUNT RESET CONFIRM CANCEL");
}
void loop()
{
while (bt.available())
{
char c = bt.read();
if (c == '\n') { handle(input); input = ""; }
else if (c != '\r') { input = input + c; }
}
bool state = digitalRead(sensorPin);
if (state == LOW && lastState == HIGH && millis() - lastCount > 200)
{
count = count + 1;
lastCount = millis();
tone(buzzer, 1500, 40);
Serial.print("Count ");
Serial.println(count);
}
lastState = state;
if (resetArmed && millis() - armedAt > armWindow)
{
resetArmed = false;
bt.println("Reset window expired");
}
display.clearDisplay();
display.setCursor(0, 0);
display.print("REMOTE COUNTER");
display.setTextSize(3);
display.setCursor(0, 14);
display.print(count);
display.setTextSize(1);
display.setCursor(0, 42);
if (resetArmed)
{
display.print("RESET ARMED - ");
display.print((armWindow - (millis() - armedAt)) / 1000);
display.print("s");
display.setCursor(0, 52);
display.print("Send CONFIRM or CANCEL");
}
else
{
display.print("Previous total: ");
display.print(previousTotal);
display.setCursor(0, 52);
display.print("Resets: ");
display.print(resets);
}
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.
This project needs the passive buzzer (the one that plays notes), not the active one.
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).
Anything destructive deserves a confirmation, and a remote command is the easiest thing in the world to send by accident. Sending RESET only arms the operation; a second CONFIRM within ten seconds carries it out, and the window closes on its own. The previous total is kept afterwards so a mistaken reset can still be reported, which costs one variable and has saved a great many people.
Break the IR beam and the count rises by one with a short beep. Send RESET from the phone: the screen shows RESET ARMED with a countdown. Send CONFIRM and the counter zeroes, reporting the previous total.
Yes. It is project 88 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.
8 parts: ESP32-WROOM-32 38-Pin Development Board, USB Cable, Dupont Jumper Wires (40 pcs), Buzzer Module 3.3–5V, 0.96" OLED Display 128x64, HC-05 6-Pin Bluetooth Serial Module with Button, Generic Infrared Obstacle Avoidance Sensor Module (Active Low) – LM393 Comparator, 2-30cm Range 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 7 steps.
No. This page has the complete, tested code (titan_kit_088_bluetooth_wireless_counter.ino).
About ₹1,061 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Remote interrupt handling; Two-step confirmation for destructive commands; Arming windows that expire safely; Keeping the previous value after a reset.
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.