Remote-controlled RGB mood light
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Shop by category
Shop all componentsCounting seconds with delay(1000) drifts, because the code itself takes time. This stopwatch uses millis(), the board's own millisecond clock, and works out minutes and seconds with division and modulo: 75 seconds is 75 / 60 = 1 minute and 75 % 60 = 15 seconds, shown as 01:15. The colon blinks every half second.
Every part for this build comes in the Geekobot Spark Kit box, a Geekobot exclusive, together with the parts for all 24 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 Spark Kit project
Female-to-female or male-to-female leads for the modules
Sensor Shield v5.0 from the kit: every pin has its own G, V, S header, so modules plug in with female jumpers
Follow the colours: red is power, dark grey is ground, blue is a signal.
spark_kit_23_stopwatch_timer.inoVerify & upload in Electrolark// Spark Kit 23: stopwatch MM:SS
#include <TM1637Display.h>
#define CLK 2
#define DIO 3
TM1637Display display(CLK, DIO);
unsigned long start;
void setup() {
display.setBrightness(5);
start = millis();
}
void loop() {
unsigned long ms = millis() - start;
unsigned long sec = ms / 1000;
int mm = (sec / 60) % 100;
int ss = sec % 60;
bool colon = (ms % 1000) < 500; // blink the colon
display.showNumberDecEx(mm * 100 + ss, colon ? 0b01000000 : 0, true);
delay(50);
}
Use the kit's USB cable (some phone cables carry power only), install the CH340 driver on Windows if the port does not appear, and pick Tools > Board > Arduino Uno.
Some modules have no colon wired; the time still reads correctly.
The board reset: check the USB cable is firmly in.
millis() is a running clock, so the stopwatch stays right however long the rest of loop() takes.
Add the push button from project 24 on D4 with INPUT_PULLUP and toggle a running flag on each press.
Yes. It is one of the 24 projects in the Geekobot Spark Kit, and every part on the list comes in the kit box. You can also buy the parts one by one from the list above.
No. Every Spark Kit project is wired on the breadboard or the Sensor Shield with jumper wires.
5 parts: Uno R3 CH340G ATmega328p Compatible Development Board, Arduino USB-A to USB-B Data Cable for UNO/MEGA, TM1637 4-Digit 7-Segment Display Module, Dupont Jumper Wires (40 pcs) and Arduino Sensor Shield V5 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 4 steps.
No. This page has the complete, tested code (spark_kit_23_stopwatch_timer.ino).
About ₹440 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Timing with millis(); Division and modulo; Formatting MM:SS on a display.
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.