Wireless Multi-Channel Voice-Controlled Electrical Outlets

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):

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

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

Cost

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

Step 1: Open the Remote and Remove the Circuit Board

The first thing you'll need to do is open the plastic case of the remote to expose the circuit board.

1. Remove the battery cover and take the battery out for now.
2. Use a small Phillips head screwdriver to remove the single screw holding the front and back halves of the plastic case together.
3. Use needle nose pliers to bend off the keychain ring.

This exposes the underside of the circuit board, which you can remove from the case entirely to get a look at the top half. However, I find it easier to work with the circuit board attached to the front half of the case. This way, you can easily push the buttons when you're testing the circuit (next step). The battery also tends to stay in better when it's in the case. There was an unoccupied hole in the case that lined up with a hole in the circuit board – I used the small screw to attach the circuit board to the front half of the case (see the last two pictures above).

Step 2: Reverse-Engineer the Remote

This step will assume you already have basic knowledge of how a single-channel remote works. You can find a detailed explanation of that in my previous Instructable.

The basic idea here is the same – but instead of two buttons controlling a single channel (one ON and one OFF), you have six buttons controlling three channels (three ON and three OFF). Each of these buttons is connected to a pin on a chip on the circuit board (the black rectangle). Normally, these pins sit at 0V (a logical LOW). When the respective button is pressed, the pin goes up to 5V (a logical HIGH). Your ultimate goal is to “trick” the remote into thinking buttons are being pressed by sending a 5V signal from a circuit controlled by the Raspberry Pi (more on that later). In order to do that, you need to figure out which pins on the chip are connected to the pushbuttons, so you can solder jumper wires to them.

 

There are two complementary ways to do this. One is to just look at the traces on the back of the circuit board, and figure out which ones connect the pushbuttons to pins on the chip. You can also test this with a multimeter by testing to see which pin changes from 0V to 5V when you push each button (make sure the battery is in, or that won't work!). The latter can be a little difficult to do with just two hands, and is definitely easier if you have alligator clip attachments for your multimeter.

If you're using the exact same remote I linked to from Amazon, you should be able to follow my diagrams exactly. If not, you'll need to do some tinkering on your own to figure out which pins to solder to in the next step.

Step 3: Solder Jumper Wires to the Remote

Note: I opted for economy shipping from SparkFun for my multi-colored jumper wire. The good news is I got free shipping. The bad news is I only had red and black jumper wire available before that. The connections in this project are a little easier to keep track of if you have 8 different colors available. So, for the circuit diagrams (expertly drawn in Powerpoint), I'll use the following convention:
+5V: red
GND: black
ON1: blue
OFF1: gray
ON2: yellow
OFF2: brown
ON3: green

OFF3: white

In the photos of my actual build, you will only see red and black wire. Of course you can use whatever colors you prefer – my intent is that the color-coding scheme in the diagrams will be easier to follow, and I apologize that it doesn't match up to my photos exactly (it was this, or miss the deadline for the Hardware Hacking contest).

Anyway – now you need to solder jumper wir

es to the six pins identified in the previous step, plus the negative terminal of the battery connection (this will make sure your whole circuit has a common ground later). Seven connections total, as shown in the pictures above (a “fake” photo with the color-coded wires drawn in, as well as a photo of the real thing).

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

Optionally, if you'd like to protect the circuit board a little better, you can drill holes in the back of the remote's original case to feed the jumper wires through. Just make sure you can keep track of which wire is which. I used a label maker since I didn't have properly color-coded wire.

Step 4: Build the Circuit

Assemble the circuit on the breadboard. If you're good at following breadboard diagrams, you can just go ahead and use the first image above. If that seems a little overwhelming, try doing it one step at a time (following the pictures in order):

1. Insert the relays and MOSFETS (six of each). Important – I didn't realize until after I made all of these diagrams that the packaging on the relays is slightly too bulky for them to occupy adjacent breadboard rows, as pictured here. You will actually need one blank row in between each relay, adding five rows of total space to the build (which shouldn't be an issue if you're already using a big 60+ row breadboard).
2. Use jumper wires to make all the +5V (red) and ground (black) connections on the breadboard.
3. Connect the breadboard to the Raspberry Pi's +5V and GND pins, and to the negative battery terminal (-) on the remote. Important: do NOT connect the positive power rail on the breadboard to the (+) battery terminal on the remote. The remote battery is 12 volts, so if you short that to your Raspberry Pi's 5V pin, bad things will happen.
4. Connect the Raspberry Pi's GPIO pins (17, 18, 22, 23, 24, and 25) to the gates (left-most pin when facing the side with the writing) of the respective MOSFETs as shown. See the color-coded table above, which matches the wire colors I used in the breadboard diagrams, for help keeping track of everything. See this page for more information about the GPIO pins and the numbering scheme (which can be confusing if you're new to Raspberry Pi, especially if you're used to Arduino).
5. Connect the wires you previously soldered onto the remote to the breadboard. I use the same color-coding convention for these wires in the diagrams above.

For an explanation of how the circuit works, see this step of my previous Instructable.

Step 5: Install WiringPi

WiringPi is a very convenient way to control the Raspberry Pi's GPIO pins, especially if you are used to Arduino. It was created by Gordon Henderson and you can find download and installation instructions here. Follow the directions on his site to download and install WiringPi on your Raspberry Pi (using the command line in a terminal).Note: I originally found out about WiringPi through this tutorial on controlling a single LED with the GPIO pins, hosted on projects.drogon.net. It links to these download and installation instructions. WiringPi has since been moved to its own site, wiringpi.com. According to this post I believe wiringpi.com will contain the most recent updates – so in the future make sure you follow download and installation instructions from wiringpi.com and not projects.drogon.net, in case anything changes (as of December 2013, the instructions are still the same).

Step 6: Install Voice Command

In short, Voice Command is a C++ program included as part of a package called PiAUISuite (Pi Alternative User Interface Suite) written by Steven Hickson. It uses a microphone connected to your Pi to record audio, then connects to a Google speech-to-text service to convert the sounds to text that can be used to execute commands. Steve has some very helpful and extensive tutorials and YouTube videos that I highly recommend checking out before you dive into this part, and he already has it set up to do some neat things like open and play videos, Google stuff, or connect to Wolfram Alpha to try and answer questions. So, all of the credit for this goes entirely to Steve – I just took his setup and put a couple lines in the config file to control GPIO pins (using WiringPi, and of course the credit for that goes to Gordon Henderson). 

 

For more detail: Wireless Multi-Channel Voice-Controlled Electrical Outlets with Raspberry Pi


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top