Need Help for connecting ESP32 to any cloud or Arduino Cloud

Hey Folks, I need help for connecting ESP32 to Arduino cloud .Which I want to show Serial taken data (to ESP32) to Arduino cloud. So how to take ?

Step 1: Prepare Arduino IDE for ESP32

First, you need to make sure your Arduino IDE can work with the ESP32. Here’s how:

  • Open Arduino IDE, go to File > Preferences.
  • In the “Additional Board Manager URLs” field, add the following URL to get the ESP32 board definitions:

  • Click “OK,” then go to Tools > Board > Boards Manager.
  • Search for “ESP32” and install the package by Espressif Systems.

Step 2: Connect ESP32 to Your Computer

  • Use the USB cable to connect your ESP32 board to your computer.

Step 3: Arduino Cloud Configuration

  • Go to the Arduino Cloud website and log in.
  • Navigate to the “Things” section and create a new “Thing.”
  • In your Thing, create a new variable (e.g., serialData) that will store the data you want to send from the ESP32. Choose the appropriate type for the data you’ll be sending.

Step 4: Install Arduino Create Agent

  • Make sure you have the Arduino Create Agent installed on your computer to allow the Arduino Cloud to communicate with your ESP32 board. You can download it from the Arduino website if you haven’t installed it yet.

Step 5: Write the Sketch

  • Open Arduino IDE and start a new sketch.
  • Include the necessary libraries for connecting to WiFi and Arduino Cloud. You’ll typically need #include <WiFi.h> and the library for Arduino IoT Cloud.
  • Set up your WiFi credentials and the Arduino Cloud properties, including the variable you created for the serial data.
  • In the setup() function, initialize the serial communication using Serial.begin(115200); and set up the WiFi and cloud connection.
  • In the loop() function, read the data from the serial port using or Serial.readString() and update the cloud variable with this data.

Here’s a simplified example sketch:

#include <WiFi.h>
#include <ArduinoIoTCloud.h>

const char WIFI_SSID[] = "YourWiFiSSID";
const char WIFI_PASSWORD[] = "YourWiFiPassword";

// Replace with your generated thing properties
CloudTemperature sensorData;

void setup() {

  // Connect to WiFi and Arduino Cloud

void loop() {
  // Example of reading serial data and sending it to the cloud
  if (Serial.available()) {
    String data = Serial.readString();
    sensorData = data.toFloat(); // Assuming you're sending temperature data

Step 6: Upload Your Sketch

  • Select the correct board (ESP32) and port in the Arduino IDE.
  • Upload the sketch to your ESP32.

Step 7: Monitor and Test

  • Open the Serial Monitor in the Arduino IDE to see debug messages and ensure your ESP32 connects to WiFi and the Arduino Cloud successfully.
  • Send data to your ESP32 using the Serial Monitor or another device, and check the Arduino Cloud dashboard to see if the data appears there.

Thanks for Your reply.

Could you provide an idea or share the code for receiving serial data on an ESP32? I am currently transferring data from four different sensors to the ESP32 from an 8051 microcontroller via UART2. Additionally, I would like to display this serial taken data from the ESP32 on the Arduino Cloud with different screen

Hope this helps:

#include "HardwareSerial.h"

HardwareSerial Serial2(2); // Use UART2

void setup() {
  // Initialize Serial for debugging

  // Initialize Serial2 (UART2) with custom baud rate
  Serial2.begin(9600, SERIAL_8N1, 16, 17); // RX, TX pins: 16 (RX2), 17 (TX2)

void loop() {
  if (Serial2.available()) {
    // Read incoming byte from UART2
    char incomingByte =;
    // For demonstration, we're just printing the byte to the Serial Monitor
    Serial.print("Received: ");

Thanks for your reply ,This logic is given you ,is for data Receives through UART2. I need program which ESP32 can take Data Serially and transfer it to Arduino cloud.

I think this code will work for you. Please check and confirm if its working.

#include "ArduinoIoTCloud.h"
#include "WiFiNINA.h"
#include "thingProperties.h" // This file is generated when you set up your thing

void setup() {
  // Initialize serial and wait for the port to open:
  // Defined in thingProperties.h

  // Connect to the internet via Wi-Fi
  WiFi.begin(SSID, PASS);
  while (WiFi.status() != WL_CONNECTED) {

  // Initialize Arduino IoT Cloud properties

  // Set a function to be called when the value changes

void loop() {
  // Your code to read sensors and update variables
  float temperature = readTemperature(); // Assume this is a function you've defined to read temperature
  temperature = temperature; // Update the cloud variable, triggers sync
  delay(60000); // Wait a minute before sending the next value

void onChange() {
  // This function is called when cloud properties are changed
  Serial.print("Property changed: ");

float readTemperature() {
  // Placeholder function for reading temperature from a sensor
  return 25.0; // Return a dummy temperature value