Wireless Multi-Channel Voice-Controlled Electrical Outlets with Raspberry Pi

FeaturedContest Winner
Picture of Wireless Multi-Channel Voice-Controlled Electrical Outlets with Raspberry Pi
Update 2/11/2014: Thanks to everyone who voted for this project in the Raspberry Pi contest!

This project is a combination of several difference resources:

The end result is voice-activated control of up to three electrical outlets using the Raspberry Pi. Here's a video of the final product in action (read on for a detailed parts list, circuit diagram, and code):

A couple notes before you begin. This project is up-to-date as of December 2013, but Gordon and Steve may update their respective software in the future. If you notice any major changes to WiringPi or Voice Command that make my instructions obsolete, please leave a comment or send me a message. Also, while my previous Instructable was written to be super beginner friendly, this one is a little more advanced so it skips over a lot of the introductory material. I refer back to the single-channel version several times, instead of duplicating the content here.

Here is a list of the parts I used. Of course, if you know what you're doing you can make substitutes as needed, or shop around for cheaper suppliers. Quantities in parenthesis.

Materials & Tools

The cost of this project depends heavily on what you already have lying around. If you already have a Raspberry Pi, webcam/mic and basic electronics equipment (tools, breadboard, jumper wire etc) it will only be about $40 for the wireless remote, relays and MOSFETs, and the cost goes up from there.

*My Quickcam Pro is 5 years old and I'm not sure if this exact model has been discontinued, or if it is the same thing as the "Webcam Pro 9000", which pops up on Amazon. You may need to do some poking around online to find out if your webcam is compatible with the Raspberry Pi (keep in mind that you only need the mic, and don't care about video). This wiki has an extensive list of verified peripherals.
1-40 of 93Next »
NiKiToS3 months ago

Nice one. Why not use 433Mhz transmitters and receivers? You can get 433Mhz power outlets too, they cost approximately the same. Then get some 433 Mhz transmitters from ebay, which are very cheap and connect them with GPIO ports? This way you can save a lot of headache, or am I seeing it wrong?

Ben Finio (author)  NiKiToS3 months ago

In short...because I had never built anything with transmitters/receivers from scratch, and didn't know how. I like taking stuff apart, and that also allowed me to enter the Hardware Hacking contest at the time.

parth_bhat5 months ago


i have made this project for my college exhibition, now i am facing a problem that my raspberry pi is giving very very late reply and even turning on the things very late. can you help me with the " duration , threshold , " configuration stuff.


#This is the default config file

#These are the special options you can set (remove the #)





!response==yes boss






!improper==access denied


#Here are the commands


this is my setup . i am using the logitech camera same as yours . please please help



Ben Finio (author)  parth_bhat5 months ago

Hi - to be honest it has been quite a while since I did this project, and I was just using software written by someone else - Voice Command by Steven Hickson. The full documentation for his software is on his site:


If I remember correctly, those parameters (threshold, duration) have to do with the Pi LISTENING for the keyword (threshold is the loudness of the sound, duration is how many seconds it will listen). The problem with the delay is that the Pi is not actually processing the voice commands locally, it is connecting to a Google voice-to-text service. So, if you have a slow internet connection, or Google is particularly busy at the moment, there isn't much you can do. You can definitely see that there is a bit of a lag in my video. If any of the delays ARE actually due to slow processing on the Raspberry Pi, then it might be faster with a new Raspberry Pi 2 instead of an older model, but I'm really not sure.

well thanks a lot ben.

you said was actually right . it was the internet speed problem which i was facing. but really thanku



would this be strong enough for a power strip?

Ben Finio (author)  tracy.nguyen.3976 months ago

It should be fine. The wireless outlets are designed to control anything you would normally plug into an outlet. None of the high-voltage AC is actually going through the Raspberry Pi circuit itself. If you are plugging a TON of stuff into a power strip and you are really concerned about the rating of the wireless adapters, you'd have to look up the specs (I don't see them on the product page):


But I'm guessing at that point you'd trip the power strip instead.

are your first 2 jumper wire not m/f?

Ben Finio (author)  tracy.nguyen.3975 months ago

If you're referring to the red and black ones at the very top - correct, those are m/m wires used to connect the power and ground buses on opposite sides of the breadboard. The m/f wires are connected to the GPIO pins on the Pi.

TimL66 months ago

I created something similar and wrote a detailed blog post. Check it out:http://timleland.com/wireless-power-outlets/

pk.jimoc11 months ago

Your project is awsome!!

I have a question this project works without computer?


Ben Finio (author)  pk.jimoc11 months ago

I'm not quite sure what you're asking. The Raspberry Pi is a type of tiny computer, and this project requires a Raspberry Pi. You do not need a "regular" computer (PC or Mac) to do the project though. Is that what you meant?

puneethbr12 months ago
In first place, I would like to congratulate you for such an excellent instructable!! :)

I'm thinking to make a wired version of this instead of using remote. So I am thinking to use external relays connected to AC power and lights. Then control the external relays by the existing relays. Would that work?

Also please let me know which mic can I use as a substitute to your webcam. I need to design the project in less cost.

Note: I'm a beginner. I have not used Raspberry pi till now. This would be my first project.
Ben Finio (author)  puneethbr12 months ago

Thanks! To answer your questions - there are products that make it very easy to control an outlet with a hardwired connection to a microcontroller, no relays required, like this:


The problem with that one is that it's very expensive - $30 (USD) to control just one outlet. I'm sure SparkFun's shipping to India isn't cheap either, so I'd recommend looking for something similar from an Indian supplier (I'm not really familiar with electronics vendors over there).

The good thing about it is that it safely contains the high voltage wiring so you do not have to touch it at all, beyond just plugging in an appliance like you would normally. You just handle the logic-level wiring to your microcontroller like you would with any other Arduino or Raspberry Pi project, which is perfectly safe. If you are a beginner, you should NOT wire relays up to high-voltage AC yourself. It is dangerous and can kill you or burn your house down if you do not know what you are doing.

By saying I'm new to this means I'm new to programming controllers. I'm a Telecom Engineer. I have knowledge about electrical and electronic circuits. :)

Very thanks for the reply. :)

Glad to see your enthusiasm!!
Ben Finio (author)  puneethbr12 months ago

Ah, OK. Sometimes complete beginners think they can dive right into high-voltage wiring and of course that is not safe.

I forgot to mention - most USB webcams or mics should be compatible with the Raspberry Pi. My webcam was just plug-and-play, I didn't have to install any drivers. If you are going to buy something, I would just do a quick Google search first to see if you can find anything about compatibility with the Raspberry Pi, or if you need to install certain Linux drivers to get it to work.

Good luck!

vikas001 year ago

I am having trouble I have build everything and also edited the file with the code. But when I am putting the command of gpio write 0 1 it says not found and I have checked all my wires 5 times. Please help

Ben Finio (author)  vikas001 year ago

Can you type the EXACT error message that you get? The GPIO pins can be set high or low even if there is nothing attached to them, so I doubt this is a wiring issue, it is probably a software issue. I wrote this Instructable 8 months ago so I cannot promise that nothing has changed with either the WiringPi or VoiceCommand software, that might make this out of date.

I have set all the wires exact showen in the guide image and when I type in the terminal gpio write 0 1
I get the message command not found and I dont here the click sound of relay
Ben Finio (author)  vikas001 year ago

First you need to type

gpio mode 0 out

as described in Step 8, to initialize the GPIO pin. Then you type

gpio write 0 1

Did you do that?

I did typed gpio mode 0 out and it is showing me this
-bash: gpio command not found
I even tried typing sudo gpio mode 0 out but no luck give me the same error of command not found
Ben Finio (author)  vikas001 year ago

Did you install WiringPi as described in Step 5? If you are getting "command not found", my only guess is that WiringPi is not properly installed.

I reinstalled wiringPi the code is working now but I dont here realay clicking sound. I have seen in the instructions image its all same but I have noticed that, the pic you have put with the diagram has different wiring. I can follow the pic but I am un sure which wire is going in which spot which is hidden behind the relay so can u put the other side pic too so I can see the pic and follow it.
Ben Finio (author)  vikas001 year ago

Unfortunately I actually disassembled this project a while ago so can't take new pictures. If you tell me exactly which wires you think are wrong in the diagrams (refer to the color, give breadboard row/column info, be as specific as possible) I can check to see if I made an error.

I have set all the wires according to the digram but its not working.
Ben Finio (author)  vikas001 year ago

Hmm. As far as I can tell from the photos your wiring looks right. This is difficult to help solve over the internet, but next I would try troubleshooting individual things to try isolating the problem:

1. Make sure your Raspberry Pi's GPIO pins work. If you have LEDs, you can just use your code to drive LEDs instead of the same circuit. If you have a multimeter, you can measure the output voltage of each pin.

2. Make sure the relays work by applying 5V directly across the coil from the power and ground buses, instead of using the Pi's GPIO pins and the MOSFET. For example, for the first relay - remove the MOSFET, then use a jumper wire to connect hole J7 to the ground bus. This should apply 5V directly across the coil (since hole A7 is connected to +5V) and you should hear a click.

3. For the MOSFETs - did you order the exact part I recommended from SparkFun, or something else?

I ordered exact parts and same model of remote to make this.
Ben Finio (author)  vikas001 year ago

Ok. Please try the first two troubleshooting steps I listed then.

I tested it and found out my all relays are not working.
Ben Finio (author)  vikas001 year ago

If you're 100% sure you connected everything correctly and the relays are not working, I'd contact the supplier (SparkFun?) for a refund and see if you can get new parts. But, I would double and triple check that you are properly applying 5V across the relay coil (the two pins that are directly across from each other, not the three pins that sort of form a triangle - look at the relay's datasheet if that helps) before you tell them that they're broken.

in digram the remote ground is down near sixth relay but in real pic it is near the first relay.
Ben Finio (author)  vikas001 year ago

Ah, OK - that shouldn't matter because the ground buses run the entire length of the breadboard (the "buses" are the two long strips on each side, one with a red line and one with a black line, for power and ground respectively). You should be able to plug a wire anywhere into the bus and it won't make a difference. However, I found out recently that some of these breadboards have the buses broken into halves, somewhere around row 30. This could be the case with your breadboard. If you have extra jumper wires, try using them to connect the "top half" of your breadboard's ground bus (somewhere in rows 1-30) to the "bottom half" (rows 31-60), and see if that solves your problem.

Also, if you have a multimeter with a "continuity test" mode, you could use that to confirm whether the entire ground bus is connected, or if it is broken in half.

rp gpio pins
you were right that bus was split in every 30 places and I have connected them but still no luck to make it work. I have tested there is power in breadboard. I have attached some pic of my work in different angles so u can see the wiring.
vikas001 year ago

hi i want to know dose raspberry pi listens to you every time without going to sleep ?

Ben Finio (author)  vikas001 year ago

The Raspberry Pi does stay on continuously. You have to say the keyword first ("Pi" in my video) for it to process a voice command, but it does not go to sleep in between commands.

thanks and where can i change the word pi because i dont want to use pi word for it to listening i want to use different word like computer etc.

Ben Finio (author)  vikas001 year ago

In the configuration file there should be a line something like


change "pi" to whatever you want to use a different keyword.

See Steven Hickson's website for the full documentation:


1-40 of 93Next »