DIY Voice Assistant based on the GLaDOS character from Portal video game series. ## Featured on: 🛠 [Hackday](https://hackaday.com/2021/09/13/glados-voice-assistant-passive-aggressively-automates-home/) - Tech blog 🛠 [Tom's Hardware](https://www.tomshardware.com/news/raspberry-pi-glados-voice-assistant-head) - Technology news 🎮 [PCGamer](https://www.pcgamer.com/this-guy-decided-to-mock-our-future-ai-overlords-with-a-glados-smart-assistant/) - Online magazine 🇫🇮 [Ilta-Sanomat](https://www.is.fi/digitoday/art-2000008642371.html) - The second largest newspaper in Finland 🇫🇮 [Muropaketti](https://muropaketti.com/tietotekniikka/tietotekniikkauutiset/onpas-hieno-suomalainen-youtube-kayttaja-teki-portal-pelin-glados-tekoalyrobotista-huiman-hienon-aaniavustajan/) - Finnish computing website 📺 [YouTube](https://www.youtube.com/playlist?list=PLs-qfwv3feinbxvTzFtmrHJrGSMrR09-t) - GLaDOS Voice Assistant playlist |
📄 GLaDOS Voice Assistant - henrirantanen.fi
❗ New versions of the voice assistant will not work on Raspberry Pi due to missing CPU instruction sets needed by some AI scripts. If you are looking to play along with the old version on your Raspberry Pi, check the raspberry branch.
Tight integration with Home Assistant's local API:
Note: The code is provided as reference only.
Voice Assistant pipeline overview
sudo apt-get update
sudo apt-get upgrade
sudo apt install python3-pip
PyAudio is needed to play audio files.
sudo apt-get install portaudio19-dev
Used for trigger word detection for now.
sudo apt-get install -y build-essential swig libpulse-dev libasound2-dev
Used to turn audio into text for now.
sudo apt-get install flac
Install python modules from requirements.txt file
cd ~/glados-voice-assistant
sudo pip3 install -r requirements.txt
See here: https://pytorch.org/get-started/locally/#start-locally
cd ~
This will download GLaDOS Voice Assistant and the TTS submodule.
git clone --recurse-submodules https://github.com/nerdaxic/glados-voice-assistant/
After this you can play around with the TTS, this works as stand-alone.
cd ~/glados-voice-assistant/glados_tts/
python3 glados.py
Find the sound card ID:
python3 -m sounddevice
Generate and edit the settings.env file:
cp ~/glados-voice-assistant/settings.env.sample ~/glados-voice-assistant/settings.env && nano ~/glados-voice-assistant/settings.env
Launch the voice assistant:
python3 ~/glados-voice-assistant/glados.py
You can add glados.py to your crontab file or run it manually.
crontab -e
@reboot python3 /home/username/glados-voice-assistant/glados.py
To make Home Assistant integration work, you need to enable the API in the home assistant configuration file and generate a long-lived access token. Add access token and IP-address of the home assistant server into the settings.env file.
# This will enable rest api
api:
# This will add GLaDOS as a notification provider. Replace with correct IP of GLaDOS.
notify:
- name: glados
platform: rest
resource: http://192.168.1.XXX:5000/notify
List of reference hardware what nerdaxic is developing on, models might not need to be exact. Not a full bill of materials. | Item | Description |
---|---|---|
Main board | Basic i7 laptop with 16 gigs of RAM | |
Operating system | ubuntu-20.04.3-desktop-amd64 | |
Microcontroller | Teensy 4, to control the eye LCD and NeoPixels | |
Eye lights | Adafruit NeoPixel Diffused 5mm Through-Hole for the "REC" light | |
Eye lights | Adafruit 16 x 5050 NeoPixel Ring | |
Eye LCD | 1.28 Inch TFT LCD Display Module Round, GC9A01 Driver SPI Interface 240 x 240 |
Audio amp is powered from Raspberry GPIO 5V line and ReSpeaker board from USB to avoid ground loops and noise issues. | Item | Description |
---|---|---|
Audio amplifier | Adafruit Stereo 3.7W Class D Audio Amplifier | |
Speakers | Visaton FRS 7 | |
Microphone & Audio interface | ReSpeaker Mic Array V2.0 |
Mechanics are powered from their own power supply to allow more power for the servos and prevent brown-outs. | Item | Description |
---|---|---|
Power supply | MeanWell LRS-50-5 5V | |
Servo controller | Pololu Micro Maestro | |
Servo: Eye movement | 35 kg DS3235 (Control Angle 180) | |
Servo: Eyelids | 25 kg DS3225 (Control Angle 180) | |
Screws | Various M3 and M4 screws | |
Jumper wires | 0.32 mm²/22 AWG assortment |