“Ok Google, close the cover of trash can!”

Make things

Controlling a trash can by just saying “OK, Google, close the cover of the trash can!” with IFTTT.

Materials

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

Software

Connects Google Home and obniz Board through IFTTT. Like the image below, the program sends a message to the obniz Board through IFTTT if you say a specific word to Google Home. Then, the Servo Motor connected with the obniz Board is operated and the trash can’s lid is open.

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.

Program