There's no way that I've found to interact with a computer via Amazon Echo. I wanted the ability to pause Netflix and Hulu using an Echo. That is the pretext to this project. I also wanted to use parts I already had and make it as easy as possible. Here are the steps from how I did it. I will try to walk you through it as simply as possible for everyone who has never used a Particle Photon. I will also explain how to set up and code the Photon to do what you want it to do.
Here are the parts required to do this project.
- USB Wired keyboard ---- I had several sitting around
- Project box --- Amazon --$6.51
- Misc wire
- 2 Micro USB Cables -- one to set up the particle and one to cut in half to power it in the project box
You will also need to have an Amazon Echo/Dot (I would think that would be obvious), and you need to have a wireless network (also needed by the Amazon Echo). I didn't think I would need to state these, but just in case, lol.
To prepare the keyboard, start by taking it apart and finding the circuit board as seen in the photos. The keys are registered by the keyboard by shorting two of the contacts on the board. We want the space bar and any other random key. Alternatively, you could just use two random keys and then change it to a space bar in software. As you can see in the photos, the two plastic sheets with the copper traces on it focus on either end of the board, so we will solder several wires to points on either end of the board as shown, and test on a computer to see what keys we can find.
The circuit board on my keyboard had an epoxy coating the contacts so I used sandpaper to make it easier to solder to. Even after sanding, I was having a hard time getting the wires to stick to the solder points. I used a fine drill bit and drilled holes at the solder points for me to push wires through. Then I could solder the wires easily.
I soldered three wires to the right side and three wires to the left side, and then plugged the keyboard into a computer and opened Notepad. By touching the wires together, I found the space bar, left arrow, Q, Z and scroll lock keys. For our purposes, we will use the space bar and the Z keys.
Now take a micro USB cable and cut it, leaving about 6 to 8 inches from the micro USB end. Strip the outer coating leaving you with 4 inner wires (usually red, black, white, and green). Cut off the white and green leaving you with the red and black wires. Strip and tin the red and black wires, and solder them to the keyboard circuit board as seen in the pictures. This will allow us to borrow 5v to power the Photon. I also added a zip tie to provide strain relief.
For anyone who has never used a Particle Photon, I took screenshots of the setup. It is a remarkable micro controller that is flashed over WiFi. Here are the steps as shown in the pictures to set up the particle to your network:
- Plug the Particle Photon into a powered USB either on a computer or AC/USB plug.
- On a cell phone, download and open / sign up the Particle app.
- Connect to the Photon-XXXX wireless connection.
- Tell the program what wireless connection you want to connect to.
That is it, your done, your Photon is connected to your wireless network. You can now go to build.particle.io and program/flash your Photon from anywhere in the world.
Since we have the Photon connected to our network, we can start hooking it up. Connect the 5v to 5v on the relay, D7 and D6 to signal on the relay, and Gnd to Gnd on the relay.
Once this is connected, you can test it using the "Tinker" in the Particle app on your cell phone/tablet. Just click on D7 and select digitalwrite, and you should hear the relay fire.
Go to build.particle.io and log in; copy the code provided and flash it to your Particle Photon.
IFTTT is a website that allows you to create "recipes" that automate things. We will make a recipe to make it so when we tell Alexa "trigger Netflix pause," it will tell Particle to trigger the function we created. Sign up / go to www.ifttt.com and follow the steps in the photos if you are not sure how to create a recipe on the website.
Make sure when you are creating the recipe and it asks for the function for the Particle, you type "ENABLE" and then the pin #, so for D7 type "ENABLE7", and for D6 type "ENABLE6" . Remember, you will have to create two separate recipes for each digital pin.
Test everything and make sure that it works.
Trim the wires, get rid of (or use a smaller) the breadboard. Cram it all into a project box and put a cool sticker on it.
OK, so all is said and done and you should have an extra key that can be fired from the relay. You can make that launch Netflix by using the program I included. It is an extinct program, but I have not found another that will not confuse different keyboards. In our example, we can use this program to make the Z key open www.netflix.com. But in reality you could make it open whatever you want.
I hope you enjoyed my tutorial. Don't forget to vote for me in a contest.