Remote-controlled RGB mood light
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Shop by category
Shop all componentsType a message in the Serial Monitor and have the board flash and beep it out in correct International Morse code. Morse timing is defined entirely in terms of one base unit. A dot is one unit, a dash is three, the gap inside a letter is one, between letters three, and between words seven. Because every duration is a multiple of that single unit, changing one variable changes the whole sending speed, that is why unit is the only timing number in the sketch. The letters themselves live in a lookup table indexed by position in the alphabet, so finding a character's pattern is simple subtraction.
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
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_034_morse_code_message_generat.inoVerify & upload in Electrolarkint led = 33;
int buzzer = 32;
int unit = 120; // Length of one dot in milliseconds
int toneHz = 700;
// A-Z then 0-9
const char* morse[36] =
{
".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....",
"..", ".---", "-.-", ".-..", "--", "-.", "---", ".--.",
"--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-",
"-.--", "--..",
"-----", ".----", "..---", "...--", "....-",
".....", "-....", "--...", "---..", "----."
};
void signal(int lengthUnits)
{
digitalWrite(led, HIGH);
tone(buzzer, toneHz);
delay(unit * lengthUnits);
digitalWrite(led, LOW);
noTone(buzzer);
delay(unit); // Gap inside a letter
}
void sendCharacter(char c)
{
c = toupper(c);
if (c == ' ')
{
delay(unit * 7); // Word gap
Serial.print(" / ");
return;
}
int index = -1;
if (c >= 'A' && c <= 'Z') index = c - 'A';
else if (c >= '0' && c <= '9') index = 26 + (c - '0');
if (index < 0)
{
return; // Ignore anything we cannot send
}
String pattern = morse[index];
Serial.print(pattern);
Serial.print(" ");
for (int i = 0; i < pattern.length(); i++)
{
if (pattern.charAt(i) == '.')
{
signal(1);
}
else
{
signal(3);
}
}
delay(unit * 2); // Letter gap (1 already spent above)
}
void setup()
{
pinMode(led, OUTPUT);
pinMode(buzzer, OUTPUT);
Serial.begin(9600);
Serial.println("Type a message and press Enter");
}
void loop()
{
if (!Serial.available())
{
return;
}
String message = Serial.readStringUntil('\n');
message.trim();
if (message.length() == 0)
{
return;
}
Serial.print("Sending: ");
Serial.println(message);
for (int i = 0; i < message.length(); i++)
{
sendCharacter(message.charAt(i));
}
Serial.println();
Serial.println("Message sent");
}
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.
This project needs the passive buzzer (the one that plays notes), not the active one.
Morse timing is defined entirely in terms of one base unit. A dot is one unit, a dash is three, the gap inside a letter is one, between letters three, and between words seven. Because every duration is a multiple of that single unit, changing one variable changes the whole sending speed, that is why unit is the only timing number in the sketch. The letters themselves live in a lookup table indexed by position in the alphabet, so finding a character's pattern is simple subtraction.
Type SOS and press Enter. The LED flashes three short, three long, three short with matching tones. Serial Monitor echoes... ---... as it sends.
Yes. It is project 34 of 120 in the Geekobot Titan Kit, in level 7 (Binary and code). 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, Solderless Breadboard, Dupont Jumper Wires (40 pcs), Through-Hole LED Pack (Pack of 10), Carbon Film Resistor 1/4W 5% (Pack of 10), Buzzer Module 3.3–5V 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 20 minutes. The build on this page has 5 steps.
About ₹729 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
String to timing conversion; Morse timing as multiples of one base unit; Lookup tables indexed by character arithmetic; Reading a whole line from Serial with readStringUntil().
The ESP32 is a 3.3V board: never connect a 5V signal straight to a GPIO pin.
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Press to roll: the pips tumble and slow down before landing on a number.
Wait for the light, hit the button: how many milliseconds can you beat?
A bright 4-digit clock that keeps time through power cuts.
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.