“Ok Google, close the cover of trash can!”
Contents
Make things
Controlling a trash can by just saying “OK, Google, close the cover of the trash can!” with IFTTT.
Materials
- obniz Board
- Servo Motor
- power supply for obniz
- Trash can with lid
- Google Home
- IFTTT account
How to make
Body
Put an obniz Board and a Servo Motor on the trash can and supply power to the obniz Board. Adjust the position of the Servo Motor to open and close the trash can’s lid.
Hardware connection
Connect parts to an obniz Board like the table and the image below by referring to Servo Motor Library.
obniz | Servo Motor |
---|---|
0 | GND |
1 | Vcc |
2 | signal |
Make a recipe like the image below with IFTTT. The trigger is to say “close the trash” to Google Home. If it is triggered, it will call a webhook with a message of "GoogolehomeClose."
The program receives messages at this part. it makes Servo Motor moved if the message is "googlehomeClose."
obniz.onmessage = (message, from) => { if (message === "googlehomeOpen") { ... } ... }
You can also open trash can’s lid if you send a "googlehomeOpen"
message.
Please read Message – obniz Docs for details about messaging API.