GPS speedometer and clock
A bike or car speedometer that needs no wheel sensor: satellites do the measuring.
Shop by category
Shop all componentsSend a colour to the board as text, like 255,80,0, and have the RGB LED mix it instantly. Earlier sketches read one character at a time. A colour needs three numbers, so this one collects characters into a String until a newline arrives, then splits that String at the commas using indexOf() and substring(). toInt() converts each piece to a number. This collect-then-parse pattern is how almost all text protocols work, and it is worth understanding properly, it reappears in the notice board and the sensor dashboard.
Every part for this build comes in the Geekobot Explorer Kit box, a Geekobot exclusive, together with the parts for all 61 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.
The brain of every Explorer Kit project
Male-to-female and female-to-female leads for the modules
220 ohm resistors: one in series with every LED segment
HC-05 Bluetooth module: a serial link to your phone
1k and 2.2k resistors: drop the Nano's 5V TX signal to the 3.3V the HC-05 RXD pin expects
Nano I/O shield from the kit: every pin has its own S, V, G header, so modules plug in with jumpers
Follow the colours: red is power, dark grey is ground, blue is a signal.
explorer_kit_47_wireless_rgb.inoVerify & upload in Electrolark#include <SoftwareSerial.h>
SoftwareSerial bt(2, 3);
int redPin = 9;
int greenPin = 10;
int bluePin = 11;
String input = "";
void showColour(int r, int g, int b)
{
r = constrain(r, 0, 255);
g = constrain(g, 0, 255);
b = constrain(b, 0, 255);
analogWrite(redPin, r);
analogWrite(greenPin, g);
analogWrite(bluePin, b);
bt.print("Colour set to ");
bt.print(r); bt.print(",");
bt.print(g); bt.print(",");
bt.println(b);
}
void handleLine(String line)
{
line.trim();
if (line == "off")
{
showColour(0, 0, 0);
return;
}
if (line == "red") { showColour(255, 0, 0); return; }
if (line == "green") { showColour(0, 255, 0); return; }
if (line == "blue") { showColour(0, 0, 255); return; }
if (line == "white") { showColour(255, 255, 255); return; }
int firstComma = line.indexOf(',');
int secondComma = line.indexOf(',', firstComma + 1);
if (firstComma < 0 || secondComma < 0)
{
bt.println("Send R,G,B for example 255,80,0");
return;
}
int r = line.substring(0, firstComma).toInt();
int g = line.substring(firstComma + 1, secondComma).toInt();
int b = line.substring(secondComma + 1).toInt();
showColour(r, g, b);
}
void setup()
{
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
bt.begin(9600);
Serial.begin(9600);
showColour(0, 0, 0);
bt.println("Send R,G,B or red green blue white off");
}
void loop()
{
while (bt.available())
{
char c = bt.read();
if (c == '\n')
{
handleLine(input);
input = "";
}
else if (c != '\r')
{
input = input + c;
}
}
}
Use the kit's mini-USB cable, install the CH340 driver on Windows if no port appears, pick Tools > Board > Arduino Nano and try Tools > Processor > ATmega328P (Old Bootloader) if the upload times out.
Check that it is the common-cathode type with the longest leg to GND, and that red, green and blue go to D9, D10 and D11 in that order.
Pair with the HC-05 using PIN 1234 (or 0000), then connect in a Bluetooth serial terminal app. Unplug TXD and RXD while uploading.
Earlier sketches read one character at a time. A colour needs three numbers, so this one collects characters into a String until a newline arrives, then splits that String at the commas using indexOf() and substring(). toInt() converts each piece to a number. This collect-then-parse pattern is how almost all text protocols work, and it is worth understanding properly, it reappears in the notice board and the sensor dashboard.
Send 255,0,0 and the LED glows red. Send 255,80,0 for a warm orange. Send green or white to use a named colour.
Yes. It is project 47 of 61 in the Geekobot Explorer Kit, in level 8 (Wireless control). 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 Explorer Kit project is wired on the Nano I/O shield and the breadboard with jumper wires.
9 parts: Generic Nano CH340 Development Board (Soldered), USB Cable, Solderless Breadboard, Dupont Jumper Wires (40 pcs), 5mm RGB LED (Pack of 10), Carbon Film Resistor 1/4W 5% (Pack of 10), HC-05 6-Pin Bluetooth Serial Module with Button, Carbon Film Resistor 1/4W 5% (Pack of 10) and Arduino Nano IO Expansion Shield (328P Compatible). 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 (explorer_kit_47_wireless_rgb.ino).
About ₹686 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
App-based colour value parsing; Building a String until a newline arrives; Splitting text with indexOf() and substring(); Accepting both named and numeric commands.
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.