Remote-controlled RGB mood light
Warm, cool, rainbow or breathing: cycle lighting moods from your sofa.
Shop by category
Shop all componentsThe pomodoro technique alternates focused work with short breaks. This timer counts down on an OLED, beeps three times when the period changes and starts the next one automatically. A single button starts and pauses it, and holding the button for two seconds resets it. The time is kept with time.ticks_ms so it stays accurate.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
USB power adapter or power bank.
main.pyimport time
from machine import Pin, I2C
from ssd1306 import SSD1306_I2C
i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=400000)
oled = SSD1306_I2C(128, 64, i2c)
btn = Pin(14, Pin.IN, Pin.PULL_UP)
buzzer = Pin(15, Pin.OUT)
WORK, BREAK = 25 * 60, 5 * 60
working, running = True, False
remaining = WORK
last_tick = time.ticks_ms()
pressed_at = None
def beep(n):
for _ in range(n):
buzzer.value(1); time.sleep_ms(150); buzzer.value(0); time.sleep_ms(150)
def draw():
oled.fill(0)
oled.text("WORK" if working else "BREAK", 0, 0)
oled.text("" if running else "(paused)", 56, 0)
oled.text("%02d:%02d" % (remaining // 60, remaining % 60), 32, 30)
oled.show()
draw()
while True:
down = btn.value() == 0
if down and pressed_at is None:
pressed_at = time.ticks_ms()
if not down and pressed_at is not None:
held = time.ticks_diff(time.ticks_ms(), pressed_at)
pressed_at = None
if held > 2000:
running, working, remaining = False, True, WORK
else:
running = not running
last_tick = time.ticks_ms()
draw()
if running and time.ticks_diff(time.ticks_ms(), last_tick) >= 1000:
last_tick = time.ticks_add(last_tick, 1000)
remaining -= 1
if remaining <= 0:
working = not working
remaining = WORK if working else BREAK
beep(3)
draw()
time.sleep_ms(20)
Wire it between GP14 and GND; the code uses the internal pull-up.
Check I2C wiring and the driver install.
Check the pin and whether it is active or passive.
Yes, WORK and BREAK at the top, in seconds.
Add a counter and show it on the screen.
Not here. Add a counter and use a longer break every fourth session.
6 parts: Raspberry Pi Pico, 0.96" OLED Display 128x64, 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 45 minutes. The build on this page has 6 steps.
No. This page has the complete, tested code (main.py).
About ₹639 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Counting down with ticks_ms; A two-state work and break machine; Telling a short press from a long hold.
Ideas that reuse this build: Pico countdown timer OLED. They are listed under Take it further on this page.
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.
Learning project. Check every circuit and the datasheet of each part before you power it up.