About: Hello, the author of the project is an Application Engineer of Seeed Studio. It's great to share this project with the Hackster maker community. I hope you like Seeed Studio, a hardware enabler for IoT applications, which provides services that enable IoT developers to quickly prototype... More information about Seeed Studio »
In our latest project named DIY your ReSpeaker Adapter(Voice Control), we introduced how to control adapter using your voice, but it can only control switch-signal appliances, such as table lamp fan and so on.
This time I’ll show you how to use your voice to control some complex household appliances like smart TV and air conditioner using the new thing ReSpeaker, which can allow you to interact with the world using your voice. In this case, we need to use Infrared remote controller to control them. Fortunately, the ReSpeaker has a coprocessor ATmega 32U4 which makes it compatible with Arduino Leonardo, So I use the Arduino side to learn IR Command code as well as send the IR Commands to control the complex appliances.
Step 1: What Do We NeedHardware Part:
- ReSpeaker
- ReSpeaker Grove Extension Board
- Grove – Infrared Emitter
- Grove - Infrared Receiver
- Speaker (8Ω 0.5W)
- Micro SD Card(larger than 4GB)
Enclosure Part:
- M3*10 Pillars —— 4 PCS
- M3*20 Pillars —— 4 PCS
- M3*35 Pillars —— 4 PCS
- M3*12 Screws —— 8 PCS
- M2*10 Pillars —— 3 PCS
- M2*8 Swcews —— 3 PCS
- M2 Nuts —— 3 PCS
- WoodPaperScrew driver
Add TipAsk QuestionCommentDownload
Step 2: WiringNow, we should connect the Grove Modules to the Grove Extension Board for ReSpeaker.
And connect the speaker to the ReSpeaker.
Add TipAsk QuestionCommentDownload
Step 3: Setup the ReSpeakerThe software work of the social artifact consists of 2 parts, the code running on Arduino side and the python script running on the MT7688 side. The communication between the two chips are UART and SPI.
Connect ReSpeaker to your PC using micro USB cable, if your computer can’t recognize it as a USB device, you can download the driver from here.
Connect ReSpeaker
Now, using your favourite SSH Tools connect to ReSpeaker.
Baud rate: 57600
Terminal App: For windows, putty is recommend. For Linux/Mac, use screen /dev/xxx 57600
Connect MT7688 to the Internet
Modify the configure file to change MT7688 into station mode and connect to the internet.
vi /etc/config/wireless
Change the configure file as below shows.
Change the ssid and key to your own on the red box as the picture shows.
Option disabled ‘0’
option ssid‘your ssid’
option key‘your key’
Then reboot your ReSpeaker.
reboot
To have a try ping a website to ensure your ReSpeaker have connected the internet well.
ping seeed.cc
Add TipAsk QuestionCommentDownload
Step 4: Upload the Arduino Code1. Download demo code at GitHub.
2. Click “Download zip” button on right side of webpage to download all codes.
3. Decompress the downloaded zip files to“C:\Users\Administrator\Documents\Arduino\” and remove “-master” in decompressed file name.
4. Launch Arduino IDE.
5. Click Sketch>Add file to add irLearning.ino file from“C:\Users\Administrator\Documents\Arduino\IRLearning_ReSpeaker\Arduino_IRLearning\irLearning\”
6. Click Tools -> Board and select “Arduino Leonardo” and chose the right port, as shown in the picture below.
7. Press CTRL +U to upload codes to your board. Wait a while, there will be saying “Done uploading”.
8. Congratulations, you have already completed the whole of the work.
Add TipAsk QuestionCommentDownload
Step 5: Download the CodeInsert the micro SD card to the ReSpeaker SD slot. Now, we should download the code from Github to your micro SD card.
root@mylinkit:/# cd /Media/SD-P1
root@mylinkit:/tmp/run/mountd/mmcblk0p1#
When navigating to /Media/SD-P1, the system will mount the SD card to /tmp/run/mountd/mmcblk0p1 automaticlly. And then execute the following commands.
git clone https://github.com/Lee-Kevin/IRLearning_ReSpeaker
Add TipAsk QuestionCommentDownload
Step 6: Change the CodeAfter download the code, you can use vi editor to change the code, in this project, we use Microsoft cognitive services, You can get the API Key from here.
And then, change the BING_KEY to your own.
vi creds.py
Add TipAsk QuestionCommentDownload
Step 7: Setup the Startup ScriptNavigate to /tmp/run/mountd/mmcblk0p1 by execute following commands:
root@mylinkit:/# cd /Media/SD-P1
Then create a file named autorun
vi autorun
And add the following code.
#!/bin/shamixer sset Capture 90%
cd /tmp/run/mountd/mmcblk0p1/IRLearning_ReSpeaker/IRLearning
python demo.py &> /dev/console &
At last, reboot your ReSpeaker.
reboot
Add TipAsk QuestionCommentDownload
Step 8: Laser CuttingHere we can use M2*10 pillars and M2 nuts Fixed ReSpeaker, *then use M2*12 fixed it to the wood.
Add TipAsk QuestionCommentDownload
Step 10: Fixed the Speaker on WoodHere fixed speaker and paper on wood by two M3*10 pillars, Note this, Only use 2 pillars to fixed it now. then connect speaker and ReSpeaker.
Add TipAsk QuestionCommentDownload
Step 11: Fixed Grove – Infrared Emitter and Grove - Infrared Receiver2 More Images
- Here we need make the cables through the hole, then use M2 screws and M2 nuts fixed grove - infrared emitter and grove - infrared receiver on wood.(Image 1-2)
- Then put the PCB on ReSpeaker and fixed the M3*35 pillars on wood.(Image 3-4).
- Fixed the wood by M3*20 pillars.(Image 5)
Add TipAsk QuestionCommentDownload
Step 12: Fixed the PaperRemember the holes we only used two~ Now at other holes we can fixed on paper and wood. then we can use double-sided adhesive to fixed the paper to wood.
Add TipAsk QuestionCommentDownload
Step 13: Drawing on PaperOnly white paper too boring, so here I draw some of my favorite things to make this remote controler more interesting~
Add TipAsk QuestionCommentDownload
Step 14: The ResultNow, you can ask the ReSpeaker to learn your IR commands.
Me: “ReSpeaker”
ReSpeaker: “Hi”
Me: “Start learning IR command”
ReSpeaker: “Okay, start learning”
And now you can send IR command to Grove - IR Receiver using appliance ir remote controller. Then you can say.
Me: “ReSpeaker”
ReSpeaker: “Hi”
Me: “Stop learning”
ReSpeaker: “Okay, stop learning”
Then you can ask ReSpeaker to control the appliance that you let it learn to.
Me: “ReSpeaker”
ReSpeaker : “Hi”
Me: “Control the air conditioner”
ReSpeaker: “Okay, send IR command ”
And you’ll find the air conditioner will change according to the IR command.
Make. Invent. Do.This project is made as an Open Source Project. It's a starting point. Let your creativity go wild with the mechanical, electrical and software design. Make the demo your own. Decorate it. Improve the work. No matter what, write a recipe about it.
To share and progress together.
Comments