Remote-controlled RGB mood light
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Shop by category
Shop all components0.91-inch OLEDs are 128x32 pixels and use the same SSD1306 driver as the bigger 0.96-inch ones, so the Adafruit library works with the height set to 32. This desk timer runs focus and rest periods, shows minutes and seconds with a progress bar, and beeps between them. One button starts and pauses.
Tick anything you already have and the total updates.
0.91-inch 128x32 I2C OLED
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB from a computer or charger.
focus_timer.inoVerify & upload in Electrolark#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 32, &Wire, -1);
const unsigned long WORK_MIN = 25, REST_MIN = 5;
bool running = false, work = true;
unsigned long left = WORK_MIN * 60000UL, last = 0;
void beep() { tone(8, 2000, 300); }
void setup() {
pinMode(2, INPUT_PULLUP);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
}
void loop() {
if (digitalRead(2) == LOW) { running = !running; last = millis(); delay(300); }
if (running) {
unsigned long now = millis();
unsigned long d = now - last; last = now;
if (d >= left) {
work = !work; left = (work ? WORK_MIN : REST_MIN) * 60000UL; beep();
} else left -= d;
}
unsigned long total = (work ? WORK_MIN : REST_MIN) * 60000UL;
oled.clearDisplay(); oled.setTextColor(WHITE);
oled.setTextSize(1); oled.setCursor(0, 0); oled.print(work ? "FOCUS" : "REST"); if (!running) oled.print(" paused");
oled.setTextSize(2); oled.setCursor(70, 0);
oled.printf("%02lu:%02lu", left / 60000, (left / 1000) % 60);
oled.drawRect(0, 22, 128, 10, WHITE);
oled.fillRect(0, 22, 128 - 128 * left / total, 10, WHITE);
oled.display();
}
The display was set to 64 pixels high; use 128, 32.
Try address 0x3D and check SDA/SCL.
The button is bouncing; increase the 300 ms delay.
Yes, a USB power bank runs it for days.
Add a long-break state after four focus periods.
Yes at desk distance; use text size 2 for the numbers.
6 parts: 0.91 inch 128x32 Blue OLED Display Module with I2C/IIC Serial Interface, Generic Nano CH340 Development Board (Soldered), Tactile Push Button Switch, Buzzer Module 3.3–5V, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 1 hour. The build on this page has 5 steps.
No. This page has the complete, tested code (focus_timer.ino).
About ₹474 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Using a 128x32 SSD1306 OLED; Non-blocking timing with millis(); Simple state machines.
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.