Pi Zero Transcriber Agent
A real-time speech transcription agent that runs on Raspberry Pi Zero 2 W hardware and displays transcribed text on a Pirate Audio display using LiveKit's voice agents.
Pi Zero Transcriber - A hardware-based voice agent that captures audio from a microphone, transcribes speech in real-time, and displays the text on a small LCD screen attached to a Raspberry Pi Zero 2 W.
- Hardware Integration: Runs directly on Raspberry Pi Zero 2 W
- LCD Display Output: Shows transcriptions on Pirate Audio ST7789 240x240 display
- Real-time Transcription: Displays both interim and final transcription results
- Automatic Text Wrapping: Wraps long text to fit the small screen
- Scrolling Display: Shows the most recent 9 lines of transcribed text
- Persistent Logging: Saves all transcriptions to a local text file
- Voice-Enabled: Built using LiveKit's voice capabilities with support for:
- Speech-to-Text (STT) using Deepgram
- Voice Activity Detection (VAD) using default settings
- Raspberry Pi Zero 2 W
- Pirate Audio board with ST7789 240x240 display
- USB or I2S microphone
- MicroSD card (8GB or larger)
- Power supply
- The agent starts and displays a startup screen on the LCD
- Connects to LiveKit room for audio processing
- Audio from the microphone is captured and sent to Deepgram STT
- As speech is detected, interim transcriptions appear on screen
- Final transcriptions are appended to the display and saved to file
- The display shows up to 9 lines of wrapped text at once
- Older text scrolls off as new transcriptions arrive
- Raspberry Pi OS (32-bit or 64-bit)
- Python 3.10+
- livekit-agents>=1.0
- Pirate Audio libraries installed
- LiveKit account and credentials
- API keys for:
- Deepgram (for speech-to-text)
-
Set up your Raspberry Pi Zero 2 W with Raspberry Pi OS
-
Install system dependencies:
sudo apt-get update
sudo apt-get install python3-pip python3-pil python3-numpy
sudo pip install st7789
-
Clone the repository and install Python dependencies:
pip install -r requirements.txt
-
Create a .env file in the parent directory with your API credentials:
LIVEKIT_URL=your_livekit_url
LIVEKIT_API_KEY=your_api_key
LIVEKIT_API_SECRET=your_api_secret
DEEPGRAM_API_KEY=your_deepgram_key
Run directly on the Raspberry Pi:
python pi_zero_transcriber.py dev
The LCD will show "LiveKit Transcription Starting..." and then begin displaying transcribed speech.
- Screen: ST7789 240x240 pixel color LCD
- Rotation: 90 degrees for proper Pirate Audio orientation
- SPI Speed: 20 MHz for responsive updates
- Fonts: DejaVu Sans for readability on small screen
- Title "Transcription" always shown at top
- Text wrapped to 26 characters per line
- Maximum 9 lines displayed (older lines scroll off)
- Interim results shown in real-time
- Final results appended to transcript history
All final transcriptions are saved to user_speech_log.txt with one utterance per line for later reference or processing.
- Startup screen shown during initialization
- Clean shutdown clears display on exit
- PIL (Python Imaging Library) used for text rendering
- Hardware SPI interface for fast display updates