Overview:
This article is to show how to connect your Arduino IoT device cloud and get the data you want to collect from the cloud to your personal mail.
Hardware Requirements:
- Mkr Wifi 1010
- Mkr ENV shield
- USB cable 2.0
Software Requirements:
- Arduino Create account.
- IFTTT - If This Then That
Steps
1 - IoT CLOUD setup:
-
Mount MKR ENV Shield onto an MKR WIFI 1010 board.
-
Connect it to your computer using a USB cable.
-
Add your MKR 1010 board to the create Device Manager
-
Go to the Arduino IOT cloud in Arduino Create.
-
Select the option New Thing.
-
Then, provide a name for your new thing and inside select the board drop-down menu, choose to configure a new device.
-
Later, the page redirects you to setup and configure a new device into the IoT cloud.
-
Once the board configuration is done, we should set up the new thing.
-
Select the ADD Properties option on the right side of the page.
-
Inside the properties page, add all the properties required for the project and save it.
-
Click on the Edit sketch option on the top right side corner.
-
In order to activate the ENV shield, you must add the below code inside the Void setup.
while (!Serial); if (!ENV.begin()) { Serial.println("Failed to initialize MKR ENV shield!"); while (1); }
-
In the Secret tab, provide the SSID and Password.
-
Now, upload and run the sketch.
-
Open the serial monitor and check if it is connected to the internet and also if the values are changing to the given variables.
-
Once the process is done, click on the IoT cloud tab and go to the dashboard to see the property values.
2 - IFTTT setup:
-
Go to the link create IFTTT page here and create a new applet.
-
Select the option if +this and choose webhooks
-
Add a trigger inside your webhooks.
-
Select ‘receive a web request´ option and give your event name which should be the same name given to thing in IoT Cloud.
-
And then create the trigger.
-
Now, click on +that, choose email, enter the details
-
Enter the received pin and select connect.
-
In the ‘complete action field’ press save creating an applet
-
Go to my services page, click on Documentation on upper right
Note: Inside complete action field ‘eventname’ refers to the thing name to be triggered from IoT, val1 refers to the variable name, val2 refers to the reading or value and val3 refers to the timestamp. And you don’t have to fill it up.
- Copy the link until ‘event’ copies it on the webhooks section of the IoT cloud and put the name of the thing to be published over IFTTT.
- Copy the rest of the link from the Documentation page.
- Click on test it.
- You should start receiving emails.
Checkpoint!
- If you don't start receiving emails, we recommend you to check the following instructions:
- Check the link provided in the webhooks section (step 10 in IFTTT steps).
- Make sure you have assigned the correct event name (event name should be the same as the thing name inside the trigger).
- Check the mail Id you have provided (step 6 in IFTTT steps).