Build it step by step
0 of 6 doneWire the radar
5V, GND and OUT to D2. Point it at the chair from about 1 metre.
Wire the ring and buzzer
DIN to D6 through 330 Ω, buzzer to D8.
Test with short times
Set SIT_MS to 20 seconds and BREAK_MS to 5 seconds and upload.
Sit and watch
After 20 seconds the buzzer chirps and the ring glows cyan and shrinks as the break counts down.
Check leaving
Walk away for 30 seconds and the cycle resets.
Set the real times
Restore 20 minutes and 20 seconds, and put the box beside your screen.
How do you build a screen break reminder?
A desk gadget sees when you sit at your screen and reminds you every 20 minutes to look away for 20 seconds. You need Arduino Nano, LD2410 24 GHz human presence radar, WS2812B ring 16 LEDs, Active buzzer 5 V, Resistor 330 Ω, USB A to micro-USB cable (data) and Jumper wires male to male (40 pcs, 20 cm). It takes 6 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 7
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- OptoelectronicsBuy
- Motors & ActuatorsBuy
- PassivesBuyResistor 330 Ω × 1
- Cables & WiresBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| LD2410 VCC and GND | Nano 5V and GND | Radar supply |
| LD2410 OUT | Nano D2 | High when someone is present, even sitting still |
| Ring DIN | Nano D6 through 330 Ω | Data line |
| Ring 5V and GND | Nano 5V and GND | Ring supply (low brightness only) |
| Buzzer + | Nano D8 | Soft chirp |
| Buzzer - | Nano GND | Return |
Code
Arduino IDE, board "Arduino Nano" (processor ATmega328P, or ATmega328P (Old Bootloader) for clones). Install "Adafruit NeoPixel". For testing, change SIT_MS to 20 seconds and BREAK_MS to 5 seconds. The LD2410's OUT pin goes high for moving and for stationary people, so it still works when you sit still at a keyboard.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
#include <Adafruit_NeoPixel.h>
const byte OUT = 2, BUZZ = 8, RING = 6;
Adafruit_NeoPixel ring(16, RING, NEO_GRB + NEO_KHZ800);
const unsigned long SIT_MS = 20UL * 60UL * 1000UL; // 20 minutes of sitting
const unsigned long BREAK_MS = 20UL * 1000UL; // 20 seconds to look away
const unsigned long AWAY_MS = 30UL * 1000UL; // gone this long: start again
enum State { WAITING, SITTING, BREAK_TIME } state = WAITING;
unsigned long sitStart = 0, breakStart = 0, lastSeen = 0;
void fill(uint32_t c) { for (byte i = 0; i < 16; i++) ring.setPixelColor(i, c); ring.show(); }
void setup() {
pinMode(OUT, INPUT); pinMode(BUZZ, OUTPUT);
ring.begin(); ring.setBrightness(30); fill(0);
}
void loop() {
bool present = digitalRead(OUT) == HIGH;
if (present) lastSeen = millis();
bool away = millis() - lastSeen > AWAY_MS;
switch (state) {
case WAITING:
if (present) { state = SITTING; sitStart = millis(); }
break;
case SITTING:
if (away) { state = WAITING; break; }
if (millis() - sitStart > SIT_MS) {
state = BREAK_TIME; breakStart = millis();
tone(BUZZ, 1500, 120); delay(250); tone(BUZZ, 1800, 120);
}
break;
case BREAK_TIME: {
unsigned long e = millis() - breakStart;
byte leds = 16 - (e * 16 / BREAK_MS); // the glow shrinks as the break counts down
for (byte i = 0; i < 16; i++) ring.setPixelColor(i, i < leds ? ring.Color(0, 80, 120) : 0);
ring.show();
if (e > BREAK_MS) { fill(0); tone(BUZZ, 2000, 200); state = SITTING; sitStart = millis(); }
if (away) { fill(0); state = WAITING; }
break;
}
}
delay(100);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Sit still at the desk | State moves from waiting to sitting |
| After the sit time | Chirp and the ring glows |
| After the break | Second chirp and the ring turns off |
| Leave for over 30 s | Timer resets |
If it does not work
Never detects
The radar needs a few seconds to start and 5 V supply. Check OUT is wired to D2.
Detects an empty chair
The radar sees moving fans or curtains. Reduce range with the LD2410 phone app or aim away.
Ring shows odd colours
Check DIN is on D6 and that the colour order is GRB.
Ring resets the Nano
Too bright. Keep brightness at about 30 and use a good USB supply.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the screen break reminder?
Arduino Nano, LD2410 24 GHz human presence radar, WS2812B ring 16 LEDs, Active buzzer 5 V, Resistor 330 Ω, USB A to micro-USB cable (data) and Jumper wires male to male (40 pcs, 20 cm).
How long does the screen break reminder take to build?
About 60 minutes for a beginner maker, in 6 steps.
How do I know the screen break reminder works?
Sit still at the desk: State moves from waiting to sitting. After the sit time: Chirp and the ring glows. After the break: Second chirp and the ring turns off.
Never detects: what should I check?
The radar needs a few seconds to start and 5 V supply. Check OUT is wired to D2.
Detects an empty chair: what should I check?
The radar sees moving fans or curtains. Reduce range with the LD2410 phone app or aim away.
Ring shows odd colours: what should I check?
Check DIN is on D6 and that the colour order is GRB.
Ring resets the Nano: what should I check?
Too bright. Keep brightness at about 30 and use a good USB supply.
