DEV Community

Cover image for Blueprint[1]: Arduino IoT Cloud x Blynk Cloud Integration
Mytx
Mytx

Posted on

Blueprint[1]: Arduino IoT Cloud x Blynk Cloud Integration

Introduction

Last year, I started an IoT project and explored two popular cloud platforms: Arduino Cloud and Blynk Cloud. Both have a common limitation—Arduino Cloud allows control of up to 5 variables, while Blynk Cloud provides 5 virtual datastreams. This means if you want to control 5 light bulbs, you can only do so one per variable or datastream.

Initially, I managed to fit all my needs into just 5 variables. However, I wondered: is it possible to combine both Arduino Cloud and Blynk Cloud on a single ESP32 microcontroller? After some experimentation, I got it working!

In this tutorial, I’ll guide you through setting up and using Arduino Cloud and Blynk Cloud individually, and then show you how to combine both platforms on the same ESP32 to enhance your IoT projects.

Please note, this is strictly an experiment. I’m sharing a method to take advantage of both platforms as a free-tier user. This tutorial is not a step-by-step guide for beginners starting with IoT but a resource for those with prior experience with these technologies. If you’re familiar with Arduino Cloud and Blynk Cloud, you’ll be able to apply what I’ve discovered effectively.

Blynk Cloud Setup

[Quickstart Method]

** - Prerequisites - **

  • An ESP32 microcontroller.
  • Blynk app installed on your smartphone (available on iOS and Android or you can just use web dashboard).
  • A Blynk account (sign up if you don’t have one).

  • Enter "blynk.cloud" on your web browser and log in or sign up.

Image description

  • Click on the circle symbol on the upper right conor of the screen and then click on quickstart.

Image description

  • Click "Let's go" and then on the next page choose your microcontroller board accordingly and connection type as WiFi

Image description

Image description

Image description

  • Now to install Blynk Libraries in Arduino IDE
  • First off on board manager tab search "esp 32" and install them
  • After that on library manager tab search "blynk" and installing the first one on the list should be suffice

Image description

Image description

  • Enter Your "Wifi SSID" and "password" on the blanks and then click "back" and once you are back to step 3 click "next" again, by doing this blynk website will generate a template code with your wifi SSID and password included, that way you can copy and paste the code to test the device rather quickly.

Image description

  • Now to compile and upload the codes to the esp32
  • I didn't have access to genuiene esp32 board so when choosing the board to upload in board manager i had to pick the one called "DOIT ESP32 DEVKIT V1"
  • Choose the correct board, port and click upload on upper left cornor of the screen
    Image description

    • Once uploading is done and everything went accordingly...your device should now be online and connected to blynk cloud server

Image description

Image description

  • This is the fastest way to setup blynk cloud service with esp32

Now that we got our esp32 board online with blynk cloud...let's move on to arduino cloud

Arduino IoT Cloud Setup

  • Enter "cloud.arduio.cc" on your web browser and log in or sign up.
  • After that click the cloud icon on upper right cornor of the screen.

Image description

  • Choose Things on the left and click on "CREATE THING".
    Image description

  • Firstly, let's choose our device, Click the chain icon under "Associated Device"
    Image description

  • click on "SET UP NEW DEVICE"
    Image description

  • Since we are using esp32 as our board, choose "Third party device"
    Image description

  • Select ESP32 and choose "DOIT ESP32 DEVKIT V1" if you use the same cloned board like me.
    Image description

  • Give your device a kickass name
    Image description

  • Definitely "DOWNLOAD PDF" and keep them to yourself, they are absolutely integral.
    Image description

  • Next, we’ll set up the network details that our board will connect to. Click the chain icon after "Network" section.
    Image description

  • Enter Your WiFi SSID, Password, and the secret Key from the pdf you previously downloaded.
    Image description

  • Click on "Sketch", There arduino website will generate a complete code foryou to get started.
    Image description

  • Click Download icon to download the file, extract the files, open .ino file and if asked to create a folder click yes, and copy files outside the recently created folder and paste it in the folder.
    Image description

  • Open up "LIBRRY MANAGER" type "arduino cloud", install everything just to be safe.
    Image description

  • After everything is done, your device should be online now.
    Image description

  • Now that we are done with both blynk cloud and arduino IoT cloud, Let's write the code so that both cloud platform works simultaneously on one microcontroller.

INTEGRATION SETUP

  • Create a new sketch. You’ll also need an additional file in the same sketch. Click New Tab, and name it "thingProperties.h".
    Image description

  • Let’s start by setting up thingProperties.h. This file will handle all the mandatory configurations for Arduino IoT Cloud.
    Image description

  • Next, we’ll configure Blynk Cloud and set up the rest. In the void setup, we’ll initialize Arduino Cloud, Blynk Cloud, and the serial monitor. Finally, we’ll sync both platforms in the void loop.
    Image description

  • Finally, you can compile and upload the program to your microcontroller. Warning: The compilation process may take a while, especially if it's your first time. Be patient and wait it out—don’t unplug the device just because it seems to be taking too long. Subsequent compilations will be faster!
    Image description

  • For simplicity's sake, I can't explain every detail, and I apologize for that. The inked parts are meant to be filled with your own private credentials. If everything goes right, your device should be connected to both cloud services simultaneously.
    Image description

Image description

Epilogue

That's a wrap! You've successfully integrated both Arduino Cloud and Blynk Cloud on a single ESP32 microcontroller—pretty cool, right? This experiment shows that even with some limitations, you can find creative ways to get the most out of your IoT projects.

As you dive deeper into IoT, keep experimenting and exploring. There’s always more to learn and discover, so don’t hesitate to try out new ideas. If you run into any challenges or have something to share, I’d love to hear about it!

Thanks for following along.

Sic itur ad astra!

Top comments (0)