My local AI assistant shows what it's doing with 2 LEDs and a servo (one-byte serial protocol, no delay())
Small side project: I run a local AI assistant on my PC (Python + Ollama) and wanted to see when it's busy without watching a terminal. So the Python side sends a single character over USB serial whenever its state changes, and an Uno shows it:
Bresearching: blue LED pulses, servo sweeps back and forthYdebating: yellow LED pulses faster, servo keeps sweepingWdone: LEDs off, servo parks at 90°0idle
The sketch never uses delay(). The LED pulse and the servo sweep both run off millis(), so the board keeps reading serial while it animates and a new state takes effect right away:
void pulse(int pin, unsigned long intervalMs) {
unsigned long now = millis();
if (now - lastLedToggle >= intervalMs) {
pulseOn = !pulseOn;
lastLedToggle = now;
}
digitalWrite(pin, pulseOn ? HIGH : LOW);
}
Wiring is simple: blue LED on pin 12, yellow on pin 13 (220-330Ω each), servo signal on pin 8.
Two gotchas worth knowing:
- An SG90 off the Uno's 5V pin is fine, but anything bigger can brown out the board mid-sweep (LEDs flicker, board resets). Give it its own 5V supply with a shared ground.
- On the Python side,
pip install serialis not pyserial. If you getmodule 'serial' has no attribute 'Serial', uninstall both and reinstall only pyserial.
Sketch and Python code: https://github.com/PrimeEmre/Jarvis-Hardware-Program--local
Write-up with the full wiring steps: https://blog.emreguzel.ca/2026/07/19/architecting-autonomous-ai-agents-with-hardware-integration/
If anyone has a better idea for a "busy" indicator than a sweeping servo, I'm all ears.