GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsUpdate a scrolling marquee from a phone, changing both the message and how fast it moves. Scrolling means drawing the same text at a decreasing x position each frame. The subtlety is knowing when to wrap: the text is fully off the left edge once x is less than minus its pixel width, and at size 2 each character is twelve pixels wide. Because the buffer holding the message can be replaced at any moment, the scroll position is reset whenever a new message arrives, otherwise a short message would start mid-air.
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
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_087_bluetooth_digital_name_boa.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);
String message = "WELCOME TO THE LAB";
String input = "";
int scrollX = 128;
int textSize = 2;
int speed = 2;
bool scrolling = true;
unsigned long lastFrame = 0;
void handle(String line)
{
line.trim();
if (line.length() == 0) return;
String lower = line;
lower.toLowerCase();
if (lower == "stop") { scrolling = false; bt.println("Scrolling stopped"); }
else if (lower == "start") { scrolling = true; bt.println("Scrolling started"); }
else if (lower == "fast") { speed = 4; bt.println("Speed: fast"); }
else if (lower == "slow") { speed = 1; bt.println("Speed: slow"); }
else if (lower == "big") { textSize = 3; scrollX = 128; bt.println("Size: big"); }
else if (lower == "normal") { textSize = 2; scrollX = 128; bt.println("Size: normal"); }
else
{
message = line;
scrollX = 128;
bt.print("Now showing: ");
bt.println(message);
Serial.println(message);
}
}
void setup()
{
bt.begin(9600, SERIAL_8N1, 16, 17);
Serial.begin(9600);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { while (true) { } }
display.setTextColor(SSD1306_WHITE);
bt.println("Send text to display, or stop start fast slow big normal");
}
void loop()
{
while (bt.available())
{
char c = bt.read();
if (c == '\n') { handle(input); input = ""; }
else if (c != '\r') { input = input + c; }
}
if (millis() - lastFrame > 30)
{
lastFrame = millis();
if (scrolling)
{
scrollX = scrollX - speed;
// Each character is 6 pixels wide per size step
int pixelWidth = message.length() * 6 * textSize;
if (scrollX < -pixelWidth)
{
scrollX = 128;
}
}
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.print("NAME BOARD");
display.setCursor(84, 0);
display.print(scrolling ? "SCROLL" : "STATIC");
display.setTextSize(textSize);
display.setCursor(scrolling ? scrollX : 0, 26);
display.print(message);
display.drawLine(0, 10, 127, 10, SSD1306_WHITE);
display.drawLine(0, 56, 127, 56, SSD1306_WHITE);
display.setTextSize(1);
display.setCursor(0, 58);
display.print(message.length());
display.print(" chars speed ");
display.print(speed);
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.
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).
Scrolling means drawing the same text at a decreasing x position each frame. The subtlety is knowing when to wrap: the text is fully off the left edge once x is less than minus its pixel width, and at size 2 each character is twelve pixels wide. Because the buffer holding the message can be replaced at any moment, the scroll position is reset whenever a new message arrives, otherwise a short message would start mid-air.
The default message scrolls right to left across the screen. Send any text from the phone and the board switches to it immediately. Send fast or slow to change the scroll speed.
Yes. It is project 87 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.
6 parts: ESP32-WROOM-32 38-Pin Development Board, USB Cable, Dupont Jumper Wires (40 pcs), 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 30 minutes. The build on this page has 5 steps.
No. This page has the complete, tested code (titan_kit_087_bluetooth_digital_name_boa.ino).
About ₹1,008 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Dynamic buffer updating; Calculating text width in pixels; Knowing when a scroll should wrap; Changing display parameters at run time.
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.