Introduction: Raspberri Personal Assistant.

Picture of Raspberri Personal Assistant.
Last summer, in a small store, I found half of a 1950s bakelite Televox intercom . I thought that it would make a nice cast for a project and I bought it as it only cost $9. It sat on a shelf until I bought my first raspberry pi. After I had played with the pi for some days, I was struck by the idea that the intercom would be ideal in combination with the pi, to build a voice controlled device.

Because of the intercom, the idea came that it would be funny to use the intercom for what it was intended: contacting your personal assistant to get information or to give him/her a task. The only difference is that this intercom isn't connected to its other half but to the raspberry pi. And that there is no real person on the other side, but a smart little computer that can do a lot of the same things as that real person.

In this instructable, I'll show you:
  • how to connect the pi to the intercom
  • how to set up the pi
  • how to install the voicecontrole software
  • how to add a speech script that will return the output of your own scripts as speech

Step 1: What Do You Need for This Project?

For this project we need:
  • A Raspberry pi model B with Raspian Wheezy installed.
  • A USB WIFI adaptor: I used a Delock Nano Stick 150MB/s. It cost about $18
  • A USB soundcard: it cost $3.21 at Deal Extreme.
  • A small 5V amplifier: I used a PAM8403 board. It cost $5.64 at Deal Extreme.
  • A 5V power supply: at least 2A.
  • A 5V DPDT relais: DPDT means Double Pole Double Throw. The relais is able to switch two different signals between two different outputs.
  • A tiny piece of vero board
  • Some wires
  • A USB keyboad and mouse + a tv with HDMI or video in connection for installing everything on the Pi

Step 2: Installing the Wifi.

Picture of Installing the Wifi.
In this step , I'll show you how to connect to the internet via the raspberry desktop. But before you do anything, update your raspberry. Make sure that your Pi is connected to the internet via a cable.

To update, start-up the raspberry and on the desktop, open the terminal. Enter the following commands in the terminal.

sudo apt-get update

sudo apt-get upgrade

Once this is done shut down the raspberry:

sudo poweroff
Now insert the USB WIFI adaptor and turn on the power again.

On the desktop, double click the Wifi Config Icon. A window will open.

Click the scan-button which will again open a new window.

In that window, select your SSID by double-clicking it.

A window appears and you should add the password where it says PSK. Then click Add.

You will be back in the first window. There you can see the status of the connection at the IP.

You should now have a Wifi connection.

You can shut the Pi down for now.


Step 3: Setting Up the Hardware.

Picture of Setting Up the Hardware.

Inside the intercom, there is not enough space to hide everything, when the whole setup is done with jacks to connect the audio. So to address this problem, I opened the plastic case of the USB sound card and desoldered the connectors. Then I soldered wires to the spots where the connectors were. The connection of these wires will be discussed later in this step.

Most intercoms use the speaker as microphone. So this means that we have to devise a method to connect the same speaker to the output and the microphone input of the USB sound card. There is a push button in the front that was used originally to switch between listen and speak, so that can be of use to us.

It has to be said that I didn't want to change anything on the outside of the intercom because it's such a nice thing in great condition. Drilling holes in it was no option. Otherwise I could simply have added a DPDT switch to switch between input and output. So I had to find the next simplest method.

This is where the 5V DPDT relais comes in. We can use the push button of the intercom to switch it. To do this, we connect 5V to the push button and the second wire of the button goes to one side of the relay coil. The other side of the coil goes directly to ground. So when you press the button, the coil is activated and the relay switches. It is good practice to add a diode in the opposite direction over the 2 pins of the coil.

The center-pins of the DPDT relays are connected to the + and - of the speaker. The NO (Normally Open) pins are connected to the microphone input of the USB soundcard. The NC (Normally Closed) pins need to be connected to the output of the sound-card. But the signal of that output is not loud enough for the speaker so we need to put an amplifier between them.

The Amplifier I used, is quite simple to hook up. Everything is clearly marked on the PCB. Connect the 5V pin to 5V and the GND pin to GND and you have power. Then connect the output and GND from the soundcard to Rin and GND and connect R+ and R- to the NC pins of the relay.

When this is done, everything can be placed into the case. Connect the sound-card to the pi.

It is not a very good idea to try to power everything from the raspberry pi. So I found a 5V 3A wall adaptor to power this project. I did cut of the connector and connected everything inside to it. To do so I had to cut a USB cord. That allowed me to connect to the pi without having to desolder the onboard USB connector.

When everything is hooked up this way, your hardware is set up and the case can be closed.

Step 4: Setting Up the USB Sound Card.

Picture of Setting Up the USB Sound Card.
The raspberry pi needs a little bit of preparation to use a USB sound-card. There is a very good adafruit tutorial for this.

I'll give you the short version here. My sound-card was a CM109 version so the only thing I had to do was to open the alsa config file:

sudo nano /etc/modprobe.d/alsa-base.conf

And change:

options snd-usb-audio index=-2

options snd-usb-audio index=0
And then reboot the pi:

sudo reboot

Step 5: Setting Up the Voicecommand Software.

I used Steven Hicksons voice command software. If you are looking for voice command software for your pi, stop looking and use this one. It is by far the easiest to setup and to use. It is also very well documented and it is quite reliable.
You can download it from his website and there are also some videos there that show you how you can set it up.

The voice-command software comes as a part of a whole suite of media related applications for the pi. I only installed the voice-command software, but if you like to use more of them for your project, then feel free to install them.

When the software is installed, you can enter the following command:

voicecommand -s
It will start an automatic setup process that guides you step-by-step through the setup of your device.
When this is done, you can enter:

voicecommand -e
This will open the config file and allow you to set the commando's and the related actions.
It has to be entered in the following format:

The command system is pretty simple. When you set the command to play, it will only react when you say nothing else but 'play'. When you set it to play music it will only react to 'play music' and not to 'play' or 'play chess'. But when you set it to ~play it will react to any sentence that contains 'play'.

The action can be any executable command.

When you are done editing the config file, save it and everything is ready.

To run the software just enter:

voicecommand -c
and enjoy your personal assistant. The good lady will now listen to your commands and perform the appropriate task. When she doesn't find a matching task to a command you gave, she will look it up on Google and she will try to give you a satisfying answer. You can finish the project now but in the next steps I will show you how to get more out of it.

Step 6: Make It Run on Startup.

Picture of Make It Run on Startup.
It is ofcourse nice if the voice-command starts to work on start up. To do this we need to add a little script.

In the home directory (home/pi), open the .config directory

cd .config

then create a new directory:

mkdir autostart

go into that directory:

cd autostart

and in that directory open a new file in nano:

sudo nano voicecommand.desktop

Write the following code in the file:
[Desktop Entry]
Exec=voicecommand -c

Save the file and reboot the Pi.


Step 7: Give Your Own Apps a Voice.

Picture of Give Your Own Apps a Voice.
It's all very nice that the device is able to start programs and return info from the internet, but sometimes you want to receive very specific data in a certain way. For instance the weather forecast for your area. One thing you can do(as I did) is to write your own python script that gets the data from the internet, filters out the data you want and returns it in a way that makes sense. The only problem is that those scripts return that data as written text and not as speech. So we need an extra script to do that for us.

I found a very nice script on Oscar Liang's blog. Just like voicecommand, it uses Google speech service to 'translate' the text into speech.

The first one you need is the script. (I'll copy it here but all credits go to Oscar Liang)

copy it into nano or the text editor on the graphic desktop


for key in "${!ary[@]}"

if [[ "$LENGTH" -lt "100" ]]; then

for key in "${!SHORT[@]}"
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "${SHORT[$key]}"; }
say $*

Once you have saved this script, make it executable with:

chmod +x

This script will be reusable for all applications that need conversion to speech.

The only thing we need now are scripts that run the python script and pump the output into thetext2speech script. We'll need one of these scripts for each python script.




Save this as and make it executable.

now you can enter this script into the config file of voicecommand and it will return speech whenever the right command is entered.


Dravindr (author)2017-10-15

Help needed:
I really want to do this project but I need to do this using Matlab with simulink on Raspberry pi kit. Can u please tell me whether it's possible?? If not , please suggest me where can I find projects which can be done using Matlab on Raspberry pi kit!!!

Thanks in advance,

Dravindr (author)2017-10-15

Help needed:

Hi ,, I really want to make this project but I need to do using Matlab with simulink on Raspberry pi kit. Can u please tell me whether we can do it?? If not please please suggest me how can I get or find info about projects which can be done using Matlab with simulink on Raspberry pi .

Dravindr (author)2017-10-15

I wanted to make a project using Matlab with simulink on Raspberry pi.. can this model be done using Matlab ??if not
Please suggest me how can I find projects which can be done using Matlab on Raspberry pi..
thanks in advance

Classified123 (author)2017-07-31

HELP: I followed everything step by step, but it doesn't speak or hear me when I talk into it or do the tests (Voicecommand -s). I am using the same sound card as shown and configured it but it doesn't recognize what I say and i can't hear anything.

aleaiyas. (author)2017-05-02

Hello help me on this: I'm trying to handle gpio ports with voice commands with Steven Hicksons but I can not get them to work only stays in: Opening config file ... Running in quiet mode Not querying for answer Running in continuous mode Verifying command as well Keyword duration is 2 and duration is 3 After that nothing happens I do not execute anything I speak and nothing happens my configuration that realizes is this: Light on == gpio write 7 on Light off == gpio write 7 off Thank you very much for your contribution

janw (author)aleaiyas.2017-05-02

it sounds like something is missing or wrong in the config file.

SebastianV49 (author)2017-03-28

Thank you for this! I have been working on my own project for a while to make something similar and this as very helpful!

janw (author)SebastianV492017-03-28


KrazyK4 (author)2016-02-14

is there any way you could programming it to speak like a friend. Maybe a bit of bantar?

SebastianV49 (author)KrazyK42017-03-28

You could use a different voice and preprogrammed quips and jokes that the device could use. For example, if it is going to rain, it could remind you to bring an umbrella. The only thing is you would have to put in every one of those lines and marks the exact situations it used them.

DevinM42 (author)2017-01-09

Will this project work with Raspberry Pi 3 with Raspian installed? I have a model B.

cgl236 (author)DevinM422017-01-10

It will, but the software that he recommends is outdated and not kept up very well. I recommend trying to use the Jasper software and documentation. There is a google group that can be found here.!forum/jasp... The downside to this is that you lose the push button functionality. Currently, I am trying to get the push to talk switch to function along with the jasper format. What are your thoughts @janw?

janw (author)cgl2362017-01-10

It will indeed work with a raspi3. But time has moved on and as you way, there are other and better was to building this now. The push button has nothing to do with the software. It only switches the speaker between the mic input and the audio output. It is an external relay that makes it work.

DevinM42 (author)janw2017-01-10

So I will be able to use raspian? Or will I have to download Raspian Wheezy?

cgl236 (author)DevinM422017-01-11

Raspian will work fine. Follow along the google group.

cgl236 (author)cgl2362017-01-10

Also, there are a multitude of other modules out there for Jasper to run on.

DevinM42 (author)2016-12-19

I would like to make this project and am wondering what kind of wires are needed. On the materials list, it says "some wires", this is not specific enough for my needs.

janw (author)DevinM422016-12-19

They are ordinary electrical wires that you can find in old computers and stuff. If you have to buy them then buy AWG 24. It is a good standard gauge wire for electronics.

cgl236 (author)2016-11-11


I know it's been sometime since someone has asked you a question here. I have attempted this build and currently, it's waiting to be turned on. I have a few questions.

1. Are the capacitors needed on the USB soundcard?

2. How can I check to see if my speaker is working and receiving sound?

3. Does burn damage to the soundcard make a difference? It was my first time with a soldering iron and those plastic pieces are so hard to remove.

4. Could I get a look at the XML code? You said that you were going to post it but I havent seen it in the comments. Thank you for replying, when you get a chance.

janw (author)cgl2362016-11-11

1. If there are capacitors on your USB soundcard, then they are ther with a reason so best to leave them om.

2. Easy way to check whether your speaker works is to connect your usb soundcard to your pc and play some audio. to see if the input works you can try to record something.

3. depends on what kind of burn damage.If traces are interrupted or components damaged then you card might not work properly anymore. If they are 'cosmetic' burn marks then it'll be fine.

4. I'll lookup the XML parsing script. It's made in Python and uses an XML parsing library. It's not that difficult to make if you are familiar with python.

hacker-cycle (author)2016-05-28

Can i use a USB mic and the built-in 3.5mm output instead of an external soundcard?

ColeN4 (author)2016-03-02

Will this work on Raspbian Jessie?

janw (author)ColeN42016-03-02

I made it on Wheezy but it should run on Jessie

RF_Craftsman (author)2015-08-16

This looks awesome! I curious if you happen to have a flowchart or a circuit diagram of your project. If not, I'm sure I can figure this out on my own. Thank you for such a fantastic idea!

janw (author)RF_Craftsman2015-08-17

I don't have a flowchart or diagram. The connections are very straight forward. Usb wifi adaptor, usb soundcard, mic in to soundcard and output soundcard via cheap amp to speaker. Install everything as described in the instructable and it should work. if it doesn't, then drop a comment and I'll look into it.

Good luck

hofungster (author)2015-05-10

thanks. I love it.

troyka (author)2015-02-27

Love it, especially the Bakelite enclosure so stylish well done.

mglovertx (author)2014-07-06

Great job and nice Instructable. I have everything functioning and have actually ordered several vintage bakelite intercom enclosures to build up a couple of these (will post pics once completed). I do have one question/request. Can you post the python script (weather) that you reference in the writeup for the text to speech extension? I would like to use your script as a reference. Again, awesome job.

janw (author)mglovertx2014-07-12

I'll post it. It does use an XML with data for The Netherlands so I don't know whether it will be usefull to you.

Tavis (author)2014-03-30

Hello there! My friend and I are currently trying to replicate your awesome device, but are running into some problems. We have all the parts needed, but cannot recognize the diode used on the relais. Also still very confused on how the power source is connected to everything. The button we are using has three wires, red, white, and blue. When released the white and red are connected, and when pressed the white and blue are connected. is this the correct button we need? we also have both a speaker and microphone connected to headphone jacks. Do we still need to de-solder the inputs on the soundcard? or can we plug the mic and headphones directly in? any help would be much appreciated, thank you for your time :). One more thing that i just thought of, can all speakers act as microphones? Because our intercom speaker was broken so we found another of the same size and were planning on using an external mic, but if our new speaker can also be a mic that would make things go much smoother.

janw (author)Tavis2014-04-01

hi there,

The diode is not very critical. You can use a 1N4001 or1N4007 of some of those between these, just don't use a smal signal one.

You need the white and blue wire on your button. leave the red one alone. Another option with your button is that you don't use the relais and connect the red wire to + of the amp output, blue to the mic input and white to the speaker.

you don't need to desolder the jacks if you don't want to. Thats up to you.

Any speaker can act as a microphone but some are better at it than others due to the way they are build. The good thing is that the voicecontrol program calibrates the mic so it will adjust to the input of your speaker. If you buy a similar one as in your intercom, you'll be ok.

I hope that everything works out ok for you guys. Post some pictures of the final product.

MoserLabs (author)2014-02-24

Don't let them beat you up over the language barrier. I WISH I could speak more languages!

Awesome instructable. It's going on my list of "to do before I get old and don't have respberry pi's anymore" list

janw (author)MoserLabs2014-02-24

I take these comments as constructive critisism and I have no problem at all with the fact that people correct me. I speak and write 4 languages and can read a few more, so I am aware that I often make some mistakes.

Fujo (author)2014-02-06

Nice instructable. I notice that English is not your native language. Just a grammar tip for you - the context that you are using "costed" isn't correct. There are some situations where you can used the word costed but in this and most cases you should just say cost as it is an irregular verb and is both the past and present tense. It also doesn't sound right. Keep up the good work.

janw (author)Fujo2014-02-06

You are right, English is only my thirth language. I'll edit it. Thanks for your help!

zwheel (author)janw2014-02-12

Interesting. Is your software multi-lingual or did you chose to build a device that speaks/understand your third language rather than your first?

janw (author)zwheel2014-02-12

I used English as the language because my projects are mostly shown on international websites. The software uses google to translate text to speech and you can easely change te code to get the speech in your own language with the correct pronounciation and accent.

Cabbages and Kings (author)Fujo2014-02-07

Is "costs" the present tense of the verb in this situation? "That item costs two dollars. Yesterday it only cost one dollar."

Anyway, brilliant instructable. It would be great to be able to have celebrity voices.

Or the voice of the computer from 2001 A Space Odyssey.

zwheel (author)2014-02-12

"hi there... can you play music?"

I so badly wanted to hear it answer "yes" and stop at that.

shizumadrive (author)2014-02-07

really cool idea

dworley (author)2014-02-06

Well this Instructable would have saved me a lot of trouble a few months ago. I was looking for a good voice command library for the pi and the best I found had at least two weeks of reading documentation to just understand how to install it properly. Great Instructable, too, thanks!

fazgard (author)2014-02-06

Well done. Looks like something I need to duplicate next week!

Helder4u (author)2014-02-06

Very beautiful band smart done!


NakanoYamato (author)2014-02-06

I had to favorite this!

janw (author)NakanoYamato2014-02-06

Thank you!

Renard_Bleu (author)2014-02-04

wow, very beautiful. It is reminiscent of the Post apocalyptic rpg game: Fallout (particularly her song selection). Nicely done!

About This Instructable




Bio: I'm mainly interested in music, food and electronics but I like to read and learn about a lot more than that.
More by janw:Pickled ChilliesExtra hot sriracha sauce (Mme Jeanette)Build a Nest Box for Bumblebees
Add instructable to: