Door sign
A small screen that works as my door sign. It says Good morning, Recording, Sleeping or any message I type on my Mac, and it says Claude needs you when Claude is waiting for me. The same Arduino still runs the status light.
- Parts
- From my starter kit
- Board
- Arduino Uno
- Screen
- 1602, 16 pins
- Builds on
- The status light
01What it does
A sign that changes by itself.
I film in my room, and when someone walks in I have to start the take again. Paper signs only work if you remember to change them. This screen picks its message by the time of day, or shows whatever I send it from my Mac.
MORNINGRECORDINGSLEEPBUSYWAIT
It isn't on my door yet. It needs its USB cable to the Mac, so for now it sits on my desk.
02Parts
From the kit I already had.
I bought nothing new for this one. It's built on top of the Claude status light, so the three LEDs stay where they are.
| Part | How many | Note |
|---|---|---|
| Arduino Uno and USB cable | 1 | Keyestudio, from the kit |
| 1602 LCD screenMine has 16 pins in one row and no small board on the back. | 1 | The sign |
| PotentiometerThe small blue knob. It sets the contrast. | 1 | |
| 220 Ω resistorFor the screen's backlight. | 1 | |
| Breadboard and jumper wires | 1 | A lot more wires than the status light |
| The status light partsRed, yellow and blue LED with a 220 Ω resistor each. | 1 | See that build |
03Wiring
Sixteen pins, twelve used.
The screen lies flat on the breadboard. USB cable out the whole time you wire. Pins 7 to 10 on the screen stay empty.
| Screen pin | Goes to |
|---|---|
| 1 VSS | GND |
| 2 VDD | 5V |
| 3 V0 | The knob's middle leg The knob's outer legs go to 5V and GND. |
| 4 RS | Pin 12 |
| 5 RW | GND |
| 6 E | Pin 8 |
| 7 to 10 | Empty |
| 11 D4 | Pin 2 |
| 12 D5 | Pin 6 |
| 13 D6 | Pin 5 |
| 14 D7 | Pin 4 |
| 15 A | 5V, through a 220 Ω resistor |
| 16 K | GND |
Pins 9, 10 and 11 are the status light (red, yellow, blue), so the screen uses other pins. One 5V wire and one GND wire from the Uno feed the breadboard's plus and minus lines, and everything that needs power or ground takes it from there.
- Count your pins first
The plan said to look for a small black board with four pins on the back of the screen. Mine had 16 pins in one row, so the whole plan changed. Look at the part you really have.
- Check the power lines
On my breadboard the plus and minus lines are cut in the middle. If a part sits on the other half, give that half its own wire.
- Check twice before power
I was about to put the power wire in the same column as the ground. With the USB in, that's a short circuit. Claude saw it before I did. Check before the power wire goes in, and again before the USB cable.
- If the screen stays dark
Turn the blue knob slowly. My text was there the whole time, just too faint. Also check that no pin that needs power is on the minus line.
04Code
The sketch and the Mac script.
The sketch uses the LiquidCrystal library that comes with the Arduino IDE, so there's nothing to install.
// Door sign + Claude status light, one sketch, one Uno. VERSION FOR THE 16-PIN LCD (no I2C board).
// Uses the LiquidCrystal library that ships with Arduino (nothing to install).
// LCD pins -> Uno: 1 VSS GND | 2 VDD 5V | 3 V0 potentiometer middle pin | 4 RS D12 | 5 RW GND | 6 E D8
// 11 D4 D2 | 12 D5 D6 | 13 D6 D5 | 14 D7 D4 | 15 A 5V via 220 ohm | 16 K GND (pins 7-10 unused)
// LEDs (same as claude_light_3led): red D9, yellow D10, blue D11, each through 220 ohm.
// The Mac sends one line per message over USB (9600 baud):
// IDLE / WORK / WAIT / DONE / FAIL -> status light (exactly as before). WAIT, DONE and FAIL
// also put a short line on the LCD; IDLE and WORK bring the door message back.
// "top text|bottom text" -> door message, 16 characters per row.
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 8, 2, 6, 5, 4); // RS, E, D4, D5, D6, D7
void showRow(uint8_t row, const String &s) {
lcd.setCursor(0, row);
for (uint8_t i = 0; i < 16; i++) lcd.write(i < s.length() ? s[i] : ' ');
}
void show(const String &top, const String &bottom) { showRow(0, top); showRow(1, bottom); }
const int PIN_R = 9, PIN_Y = 10, PIN_B = 11;
enum State { IDLE, WORK, WAIT, DONE, FAIL };
int state = IDLE;
unsigned long stateSince = 0;
String line = "";
String doorTop = "Hello Pep", doorBottom = "Door sign ready";
void setColor(int r, int y, int b) { analogWrite(PIN_R, r); analogWrite(PIN_Y, y); analogWrite(PIN_B, b); }
int triangle(unsigned long t, unsigned long periodMs) {
unsigned long p = t % periodMs, half = periodMs / 2;
if (p < half) return (int)(p * 255UL / half);
return (int)((periodMs - p) * 255UL / half);
}
void setState(int s) {
state = s;
stateSince = millis();
if (s == WAIT) show("Claude needs you", "");
else if (s == DONE) show("Claude: done", "");
else if (s == FAIL) show("Claude: error", "");
else show(doorTop, doorBottom); // IDLE or WORK: the door message
}
void handleLine(String cmd) {
cmd.trim();
int bar = cmd.indexOf('|');
if (bar >= 0) { // door message
doorTop = cmd.substring(0, bar); doorBottom = cmd.substring(bar + 1);
if (state == IDLE || state == WORK) show(doorTop, doorBottom);
Serial.println("OK DOOR");
return;
}
cmd.toUpperCase();
if (cmd == "IDLE") setState(IDLE);
else if (cmd == "WORK") setState(WORK);
else if (cmd == "WAIT") setState(WAIT);
else if (cmd == "DONE") setState(DONE);
else if (cmd == "FAIL") setState(FAIL);
else { Serial.println("?"); return; }
Serial.print("OK "); Serial.println(cmd);
}
void setup() {
pinMode(PIN_R, OUTPUT); pinMode(PIN_Y, OUTPUT); pinMode(PIN_B, OUTPUT);
Serial.begin(9600);
lcd.begin(16, 2);
setColor(0, 0, 80); // power-up flash, like before
show(doorTop, doorBottom);
delay(300);
setColor(0, 0, 0);
}
void loop() {
while (Serial.available() > 0) {
char c = (char)Serial.read();
if (c == '\n') { handleLine(line); line = ""; }
else if (c != '\r' && line.length() < 36) line += c;
}
unsigned long t = millis() - stateSince;
switch (state) {
case IDLE: setColor(0, 0, 0); break;
case WORK: setColor(0, 0, 10 + triangle(t, 2400) / 2); break;
case WAIT: if ((t / 300) % 2 == 0) setColor(0, 255, 0); else setColor(0, 0, 0); break;
case DONE: if (t < 8000UL) setColor(0, 0, 255); else setState(IDLE); break;
case FAIL: setColor(255, 0, 0); break;
}
}
#!/usr/bin/env python3
"""Send a message to the door sign (Arduino Uno + 1602 LCD).
Usage:
python3 door_sign.py rec on|rec off turn Recording mode on or off, then update the sign
python3 door_sign.py auto pick the message from the time of day / Recording Studio
python3 door_sign.py MORNING|RECORDING|SLEEP|BUSY
python3 door_sign.py "Back in|10 minutes" top|bottom text, 16 characters per row
python3 door_sign.py "Back in 10 minutes" one text, split over two rows for you
Standard library only. No Arduino plugged in: says so and exits 0.
Opening the port restarts the Uno once, so a call takes about 2 seconds.
"""
import datetime, fcntl, glob, json, os, sys, termios, textwrap, time
PRESETS = {
"MORNING": ("Good morning", "Have a great day"),
"RECORDING": ("RECORDING", "Do not disturb"),
"SLEEP": ("Sleeping", "Shh..."),
"BUSY": ("Studying", "Please knock"),
}
MORNING_FROM, MORNING_UNTIL = 7, 11 # morning message hours
SLEEP_FROM, SLEEP_UNTIL = 23, 7 # sleeping hours (wraps midnight)
# Recording mode is a flag file. "door_sign.py rec on" / "rec off" flips it.
# (The Recording Studio app being open does not mean it is recording, so we do not guess from that.
# Hooking the real record button to this flag comes later, with Pep's yes.)
FLAG = os.path.join(os.path.dirname(os.path.abspath(__file__)), "RECORDING.flag")
def find_port():
ports = sorted(glob.glob("/dev/cu.usbmodem*") + glob.glob("/dev/cu.usbserial*"))
return ports[0] if ports else None
HERE = os.path.dirname(os.path.abspath(__file__))
STATE = os.path.join(HERE, "state.json") # shared with ../claude-light/claude_light.py
LOCK = os.path.join(HERE, ".port.lock")
def load_state():
try:
return json.load(open(STATE))
except Exception:
return {}
def save_state(st):
try:
json.dump(st, open(STATE, "w"))
except Exception:
pass
def send(port, top, bottom):
"""Opens the port, sends, closes. A lock makes door_sign and claude_light take turns.
The Uno restarts on open, so we also re-send the last status word (WORK/WAIT/FAIL) afterwards."""
st = load_state()
st["top"], st["bottom"] = top[:16], bottom[:16]
lk = open(LOCK, "w")
fcntl.flock(lk, fcntl.LOCK_EX)
fd = os.open(port, os.O_RDWR | os.O_NOCTTY)
try:
a = termios.tcgetattr(fd)
a[0] = 0; a[1] = 0; a[2] = termios.CS8 | termios.CREAD | termios.CLOCAL; a[3] = 0
a[4] = termios.B9600; a[5] = termios.B9600
termios.tcsetattr(fd, termios.TCSANOW, a)
time.sleep(2.0) # Uno restarts when the port opens
os.write(fd, f"{top[:16]}|{bottom[:16]}\n".encode("ascii", "replace"))
if st.get("status") in ("WORK", "WAIT", "FAIL"):
time.sleep(0.1)
os.write(fd, (st["status"] + "\n").encode())
time.sleep(0.2)
finally:
os.close(fd)
fcntl.flock(lk, fcntl.LOCK_UN); lk.close()
save_state(st)
def recording_now():
return os.path.exists(FLAG)
def auto_preset():
if recording_now():
return "RECORDING"
h = datetime.datetime.now().hour
if h >= SLEEP_FROM or h < SLEEP_UNTIL:
return "SLEEP"
if MORNING_FROM <= h < MORNING_UNTIL:
return "MORNING"
return "BUSY"
def via_desk_brain(words):
"""If desk_brain.py is running it owns the USB port: hand the words to it. True if sent."""
import socket as _s
sock = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "desk-senses", ".desk_brain.sock")
try:
c = _s.socket(_s.AF_UNIX, _s.SOCK_DGRAM)
c.sendto(("\n".join(words) + "\n").encode(), sock)
c.close()
return True
except OSError:
return False
def main():
if len(sys.argv) < 2:
print(__doc__); return 2
arg = " ".join(sys.argv[1:]).strip()
if arg.lower() in ("rec on", "rec off"):
if arg.lower().endswith("on"): open(FLAG, "w").close()
elif os.path.exists(FLAG): os.remove(FLAG)
arg = "auto"
if arg.lower() == "auto":
arg = auto_preset()
if arg.upper() in PRESETS:
top, bottom = PRESETS[arg.upper()]
elif "|" in arg:
top, bottom = arg.split("|", 1)
else:
rows = textwrap.wrap(arg, 16)[:2] + ["", ""]
top, bottom = rows[0], rows[1]
if via_desk_brain([f"{top}|{bottom}"]):
try:
st = json.load(open(STATE))
except Exception:
st = {}
st["top"], st["bottom"] = top, bottom
json.dump(st, open(STATE, "w"))
print(f"door_sign: {top!r} / {bottom!r} -> desk brain"); return 0
port = find_port()
if not port:
print("door_sign: no Arduino plugged in, nothing sent"); return 0
try:
send(port, top, bottom)
except OSError as e:
print(f"door_sign: could not use {port}: {e}"); return 0
print(f"door_sign: {top!r} / {bottom!r} -> {port}")
return 0
if __name__ == "__main__":
sys.exit(main())
Try it in Terminal, in the folder with the script:
python3 door_sign.py "Back in|5 minutes"
The part before the bar goes on the top row, the rest on the bottom row, 16 letters each. python3 door_sign.py auto picks the message from the time of day. rec on and rec off switch the Recording sign. The Claude Code hooks from the status light page keep working, and the wait word also puts Claude needs you on the screen.
05What went wrong
Claude was wrong twice.
- Four pins, it said. My screen had 16. I only found out when I turned it over and counted.
- Stand it up, it said. The screen lies flat on the breadboard.
- A near short circuit. The power wire was going into the ground column. Claude caught that one before the USB went in.
- A dark screen with three causes. A pin that needs power was on the minus line, the power lines were cut in the middle, and the contrast was too low.
I put every wire in myself, one at a time, and checked with Claude Code before the USB cable went into my Mac.
More builds
Build another one.

Air theremin
An instrument I play without touching it. My hand picks the note, the Mac makes the sound, and Claude is my music teacher.

Lie detector
Two fingers on a plant sensor, a needle, two lights, and a separate Claude that guesses which of my answers were lies.

Desk senses
A motion sensor that knows when I sit down. After 15 minutes the light turns purple and the screen tells me to do 10 squats.
Stuck on a step? Email me with a photo of your wiring.


