Arduino IoT Cloud tutorial

Arduino IoT Cloud tutorial for ESP8266 & ESP32

In the Arduino IoT Cloud tutorial, I have explained how to set up FREE Arduino IoT Cloud account to connect ESP8266 or ESP32 in details.

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

Create an account in Arduino IoT Cloud

Arduino Iot Cloud project Tutorial

First, you have to create an account in Arduino IoT Cloud. To sign up click on the following link.

https://cloud.arduino.cc

Now click on GET STARTED FOR FREE.

ArduinoIotCloud project tutorial p2

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

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.

arduino iot cloud tutorial

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

Steps to Create Things in Arduino IoT Cloud

After login, click “CREATE NEW” and select “Things“.

ArduinoIotCloud project tutorial p4

Then rename the Thing.

Now we have to configure the Smart Home integration.

ArduinoIotCloud project tutorial p5

Click on the “Configure” button under the Smart Home integration.

ArduinoIotCloud project tutorial p6

Now you can select either Alexa or Google Home as per your requirement.

Steps to Select Device for Thing

Steps to select Device for Thing

To add a Device in Thing, click on “Select Device“.

ArduinoIotCloud project tutorial p8

You can select any old device from here or click on the “SET UP NEW DEVICE” to create a new one.

ArduinoIotCloud project tutorial p9

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.

give a name to Device in Arduino Cloud

Now, enter a name for the device which you have just created. Then click on NEXT.

Device ID and secret key of Arduino cloud

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.

Add variables in Arduino Cloud project

To add a variable click on ADD in the setup tab.

ArduinoIotCloud project tutorial p16

Enter a name of the variable, and select the variable type as Google or Alexa-compatible Switch.

add Variables in Arduino IoT Cloud

Select Variable Permission as “Read & Write” and Variable Update Policy as “On Change“.

Then click on “ADD VARIABLE“.

Steps to add Variable in Arduino IoT Cloud projects

Similarly, I have added 4 variables to control 4 relays.

For the Temperature sensor select the Temperature Sensor type.

Arduino IoT Cloud tutorial p18

Then select the Variable Permission and Update Policy for the sensor.

Arduino IoT Cloud tutorial p19

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

Arduino IoT Cloud Web Dashboard set up

Now, click on the Dashboard on the top. Then click on “BUILD DASHBOARD

Arduino IoT Cloud Dashboard set up

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.

Arduino IoT Cloud Web Dashboard set up

Now, you have to link a variable that you have already created, with the Switch widget. After selecting the variable, click on “LINK VARIABLE“.

Set up switch widget in Arduino cloud dashboard

After that click on “DONE“.

arduino iot cloud dashboard

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

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.

downloaded Arduino IoT Cloud project sketch

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

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)

Arduino IoT Cloud tutorial p21

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 10th Anniversary

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!

https://www.pcbway.com/activity/anniversary10th.html

PCBWay 10th Anniversary

How to use Arduino IoT Cloud Remote App

Arduino IoT Cloud Remote App setup

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.