In this example we will connect the Grove Pushbutton to your Arduino to detect movement. When the button is pushed, a notification is sent to your smartphone to tell you someone is at the door.
This example is part of the arduino-sdk and can be found in the examples folder. If you already ran the basic example on the previous page, you have everything installed to get started right away!
In your Arduino IDE under File > Examples > ATT_IOT open the smart-doorbell
example sketch
If you did the basic example on the previous page, you can re-use the same device and credentials.
If not, please check the create a device and enter credentials sections on that page.
Simply hit the upload icon in the Arduino IDE. This will save the sketch, compile it and upload it to your Arduino.
If all went well, a Doorbell asset is created under your device in AllThingsTalk Maker. Push the button and see if the value changes.
Alternatively, you can also open the Tools > Serial monitor of the Arduino IDE. This can be very useful when debugging your own sketches.
- Make sure you select the correct COM port to listen (under Tools > Port )
- When the monitor is open, make sure the Baud rate is set to 9600
As a final step, we will set up an automation rule to notify you on your smartphone when someone presses the Doorbell button.