A voice-activated nighttime note recorder for Raspberry Pi. Record your thoughts at night without grabbing your phone. Transcriptions are delivered to your phone the next morning.
- Wake word activation - Say "Porcupine" or "Jarvis" to start recording
- Automatic transcription - Uses OpenAI Whisper API
- Phone delivery - Sends notes via Telegram or Email
- Hands-free operation - No screens, no phones, just voice
- Local storage - All recordings saved on the Pi
- Raspberry Pi 4 Model B
- Microphone (USB mic recommended, or headphones with inline mic)
- microSD card (8GB+)
- Power supply
- Raspberry Pi OS (Bullseye or later)
- Python 3.8+
- Internet connection
cd ~
mkdir voice-nightlight
cd voice-nightlight
# Copy all project files herechmod +x install.sh
./install.shEdit the .env file with your credentials:
nano .envRequired API Keys:
- Go to https://console.picovoice.ai/
- Sign up for free account
- Create an access key
- Copy key to
PICOVOICE_ACCESS_KEYin.env
- Go to https://platform.openai.com/api-keys
- Create new API key
- Copy key to
OPENAI_API_KEYin.env - Cost: ~$0.006 per minute of audio
- Open Telegram and message @BotFather
- Send:
/newbot - Follow instructions, copy your bot token
- Add to
TELEGRAM_BOT_TOKENin.env - Message @userinfobot to get your chat ID
- Add to
TELEGRAM_CHAT_IDin.env - Start a chat with your new bot
For Gmail:
- Enable 2FA on your Google account
- Create App Password: https://support.google.com/accounts/answer/185833
- Use app password in
SMTP_PASSWORD
# List audio devices
arecord -l
# Record 5 second test
arecord -d 5 -f cd test.wav
# Play it back
aplay test.wavIf your microphone isn't working:
# Check audio configuration
alsamixer
# Select the right input device
sudo nano /etc/asound.confsource venv/bin/activate
python3 voice_nightlight.pyYou should see:
π VOICE NIGHTLIGHT - Ready for bedtime notes
π Listening for wake word: 'porcupine'...
- Say: "Porcupine" (wait for beep/confirmation)
- Speak your note
- Say: "Stop recording" or press Ctrl+C
- Wait for transcription and delivery
- Check your Telegram or email!
To make it run automatically when Pi boots:
chmod +x setup_autostart.sh
sudo ./setup_autostart.shControl the service:
sudo systemctl start voice-nightlight # Start
sudo systemctl stop voice-nightlight # Stop
sudo systemctl status voice-nightlight # Check status
sudo journalctl -u voice-nightlight -f # View logs- β Instant notifications
- β Easy setup
- β Works everywhere
- β Free
- β Universal
β οΈ May be delayedβ οΈ Might go to spam
Wake Words:
- "Porcupine" (easier)
- "Jarvis" (sounds cooler)
Recording:
- Speak naturally, 1-2 feet from mic
- USB mic works better than headphone mic
- Quiet room = better transcription
Stopping:
- Say "stop recording"
- Or just press Ctrl+C on the Pi
- Auto-stops after 5 minutes
voice-nightlight/
βββ voice_nightlight.py # Main application
βββ requirements.txt # Python dependencies
βββ .env # Your API keys (DO NOT COMMIT)
βββ .env.example # Template
βββ install.sh # Setup script
βββ setup_autostart.sh # Autostart configuration
βββ recordings/ # Audio files (created automatically)
β βββ recording_20240108_235959.wav
β βββ recording_20240108_235959.txt
βββ README.md # This file
# Check if mic is detected
arecord -l
# If using USB mic, try:
sudo nano /boot/config.txt
# Add: dtparam=audio=on
# Reboot
sudo reboot- Check your API key in
.env - Make sure there are no extra spaces
- Get new key at https://console.picovoice.ai/
- Verify your API key
- Check you have credits: https://platform.openai.com/usage
- First $5 is free for new accounts
- Make sure you started a chat with your bot
- Verify chat ID with @userinfobot
- Check bot token is correct
- Use a better microphone (USB recommended)
- Reduce background noise
- Speak clearly, not too fast
- Try changing language in code (
language="en")
- Raspberry Pi 4: ~β¬50 (one-time)
- USB Microphone: ~β¬15 (one-time)
- OpenAI Whisper: ~β¬0.006/minute
- Picovoice: Free tier (1 wake word)
- Telegram: Free
Example: 5 minutes of recording per night = β¬0.03/night = β¬1/month
For mass production, consider:
-
Hardware:
- ESP32-S3 with built-in WiFi (~β¬5)
- I2S MEMS microphone (~β¬2)
- LED nightlight PCB
- 3D printed enclosure
- USB-C power
-
Software:
- Edge ML for wake word (no API cost)
- Cloud backend for transcription
- Mobile app for setup & delivery
- OTA updates
-
Features:
- Multiple user profiles
- Smart scheduling (only active at night)
- Voice activity detection
- Better stop word detection
- Data encryption
MIT License - Feel free to use for personal or commercial projects!
This is an MVP. Ideas for improvement:
- Better stop phrase detection (Vosk)
- Local Whisper (faster-whisper)
- iOS Shortcuts integration
- Multi-language support
- Voice activity detection
- Cloud sync
- Mobile app
- LED status indicators
- Place the device 1-2 meters from your bed
- Use a soft nightlight (not bright)
- Speak at normal volume
- Don't stress about perfect transcription
- Review notes in the morning, not immediately
Made with π for better sleep and captured ideas
Questions? Issues? Open an issue or contribute!