In the Arduino IoT Cloud tutorial, I have explained how to set up a FREE Arduino IoT Cloud account to connect ESP8266 or ESP32 and control the appliances with Amazon Alexa and Arduino IoT Cloud web dashboard and mobile app.
Related Article:
Arduino IoT Cloud ESP8266 Project
Arduino IoT Cloud ESP32 Project
Table of Contents
Create an account in Arduino IoT Cloud
First, you have to create an account in Arduino IoT Cloud. To sign up click on the following link.
Now click on GET STARTED FOR FREE.
Now click on “Create your account” to sign up and enter the required details.
Now, you will receive a verification email from Arduino IoT Cloud
To verify the Arduino IoT cloud account go to your email inbox and open the email received by Arduino IoT Cloud.
Click on CONFIRM NOW to verify the account.
Then go to the Arduino IoT cloud account and refresh the screen.
Now, click on IoT Cloud.
Now first we have to create Things in Arduino IoT Cloud.
In the Arduino IoT Cloud, a “Thing” is a virtual representation of a connected device, encompassing its properties (variables like sensor data or control states), network connection details, and interaction methods.
Steps to Create Thing in Arduino IoT Cloud
After login, click “CREATE NEW” and select “Things“.
Then rename the Thing.
Now we have to configure the Smart Home integration.
Click on the “Configure” button under the Smart Home integration.
Now you can select either Alexa or Google Home as per your requirement.
Steps to Select Device for Thing
To add a Device in Thing, click on “Select Device“.
You can select any old device from here or click on the “SET UP NEW DEVICE” to create a new one.
For ESP32 or ESP8266 click on the “Third party device“.
In the Setup Device, for NodeMCU, select the device type as ESP8266 and the model as NodeMCU 1.0.
If you use ESP32 then select device type as ESP32 and related model.
You will get all the Arduino-compatible boards in the dropdown menu.
After that click on CONTINUE.
Now, enter a name for the device which you have just created. Then click on NEXT.
Now, you will get the Device ID and Secret Key for that device. Click on the “download the PDF” to save the details in your local system.
Then click on CONTINUE to add the device.
Steps to add Variable in Arduino IoT Cloud projects
to control any relay or to get the data from any sensor, you have to add variables in Arduino Cloud Thing.
Here I have added 4 variables to control 4 relays. In the FREE plan, you can add up to 5 variables.
To add a variable click on ADD in the setup tab.
Enter a name of the variable, and select the variable type as Google or Alexa-compatible Switch.
Select Variable Permission as “Read & Write” and Variable Update Policy as “On Change“.
Then click on “ADD VARIABLE“.
Similarly, I have added 4 variables to control 4 relays.
For the Temperature sensor select the Temperature Sensor type.
Then select the Variable Permission and Update Policy for the sensor.
As per the above configuration, it has Read Only permission, so it will only show the reading. And after every 8 seconds, it will fetch the data from the sensor.
Steps for Arduino IoT Cloud Web Dashboard Setup
Now, click on the Dashboard on the top. Then click on “BUILD DASHBOARD“
Now click on the EDIT icon. Then click on ADD and select the Switch widget.
Then enter a name for the Switch widget and click on the Link Variable button on the right.
Now, you have to link a variable that you have already created, with the Switch widget. After selecting the variable, click on “LINK VARIABLE“.
After that click on “DONE“.
Similarly, you have to add all the required widgets.
Here I have added 4 Switch widgets in the Arduino Cloud dashboard.
Now click on Things on the top to exit the dashboard.
Sketch for Arduino IoT Cloud projects
When you add any variable in Things, the Sketch will be automatically updated in the Sketch tab.
You can further update this sketch to add more features as per your requirements. Then click on “Open full editor” to download the sketch in your local system or program the microcontroller from Arduino Web editor.
For my project, I downloaded the sketch and then opened it in Arduino IDE to program the microcontroller.
After downloading the sketch, you will get these three files. You have to keep these 3 files in the same folder.
Install Arduino IoT Cloud Library in Arduino IDE
To program the ESP8266 or ESP32, you have to install the ArduinoIoTCloud library and all other dependencies.
Go to Sketch -> Include Libraries -> Manage Libraries in Arduino IDE.
When you try to install the ArduinoIoTCloud library, it will ask you to install all the dependencies. Then click on Install All.
Update the Arduino IoT project Sketch
Now open the .ino file in Arduino IDE. You have to enter the DEVICE ID, Wi-Fi credentials, and SECRET KEY.
You will get the Device ID and Secret Key from the PDF that you have downloaded.
Now copy the DEVICE ID and paste it into the thingProperties.h file in Arduino IDE. (refer to the following picture)
Then update the Wi-Fi credentials and Secret Key in the arduino_secrets.h file in Arduino IDE. (refer to the following picture)
Now you can upload the code to ESP8266 or ESP32 as per the device you have selected in Arduino Cloud.
PCBWay is celebrating its 10th anniversary with a range of exciting new features and a variety of discount coupons. This is a great opportunity to take advantage of special offers and explore everything they have to offer. Don’t miss out—visit the following link to discover more and start saving!
How to use Arduino IoT Cloud Remote App
1. Download and install the Arduino IoT Cloud Remote App from Google Play Store & App Store.
2. Tap on SIGN IN.
3. Enter the Email ID and Password of the Arduino IoT Cloud account, then tap on SIGN IN.
4. Tap on the Thing name (which you have created) to open the dashboard.
You can also connect Arduino IoT Cloud with Amazon Alexa to control the appliances with voice commands. Click on the following link for more details.
Connect Arduino IoT Cloud with Amazon Alexa
If you face any issues you can always let us know and please share your feedbacks with us.
Thank you for your time.