Chapter 7. The Arduino Cloud

 

The Arduino Cloud is an online service developed by Arduino which allows anybody to build and manage connected devices just using a browser. It’s main modules are:

  • The Web Editor, a fully functional Arduino IDE implemented as a website. You just need a web browser to write, compile and upload Arduino code.
  • IoT Cloud, a service that lets you create , program and manage connected devices with a minimal amount of code (what people nowadays call “Low Code”). For example you can easily build a device to water your plants and control it from your smartphone while you’re working on your tan at the beach.
  • Project Hub, a repository of literally thousands of projects and tutorials built by the community. This is a great place to start if you’re looking for a great project to start with.

Let’s have a closer look at each single module.

Arduino Cloud IDE

The Arduino Cloud IDE (previously known as Arduino Create) is a cloud based development environment for Arduino which can be used with any modern internet browser. Very simply, you can login from anywhere in the world to a fully functional Arduino IDE which stores your code in the cloud. This is particularly useful if you’re on a Chromebook or you use several different computers and you want to have the same setup everywhere. In an emergency, you can borrow somebody else’s computer and find all your files and libraries there. A special feature of the Cloud IDE is that the Arduino sketch folder can also accommodate schematic diagrams and layout diagrams. You just need to place a schematic.png and layout.png image in the folder and they will show up as tabs in your IDE. Easy! Another interesting advantage of the Cloud IDE is that every single Arduino library known to us (a few thousands!) are pre-installed so you don’t have to spend time looking for libraries and installing them. Just include them; they are there already. To get started you just need to go to https://cloud.arduino.cc and you’ll be asked to login or create an Arduino account. Once you’re in, you’ll see this screen where you can find your sketchbook and everything else you need.

Figure 7-1. Arduino Cloud IDE

If you use the new Arduino IDE 2.0 you can synchronise the sketchbook you see on the cloud with the one on your computer (more or less similar to what happens with Dropbox and similar services) If it’s the first time you’ve used the Cloud IDE, you’ll be asked to install a very small program, the Arduino Create Agent, which allows your browser to communicate with serial ports so that you can upload your sketches on actual boards.

If you’re using certain types of boards like the MKRs, Nano 33 IoT and similar, you can include a feature called OTA (Over the Air updates) which will allow you to upload new code to the board over an internet connection. Pretty neat eh? Providing a full and detailed description of how the Cloud IDE works is beyond the scope of this introductory book, but you can find more info at https://cloud.arduino.cc

Project Hub

One very powerful feature of the Arduino Cloud is “Project Hub”, a place where you can find literally thousands of tutorials and projects for any Arduino board, covering all sorts of topics: from music to installations, from home automation to gardening, from pet feeders to robots. Some of the projects are very sophisticated and very well documented, if you’re looking for a project to get started building with Arduino, that’s the place where to look!

Figure 7-2. The Arduino Project Hub

IoT Cloud

An IoT Cloud is an online service that can act as a bridge between your connected devices and, for example, a mobile app, a web dashboard or even other devices. If you have an IoT-compatible Arduino or similar board, the IoT Cloud service will detect when it is connected.

Figure 7-3. Connecting an Arduino to the IoT Cloud

However, if you are using a non-IoT-compatible board like a standard Uno, you’ll get the following message, so make sure you select the right board for your IoT project.

Figure 7-4. Non-compatible devices won’t work on IoT Cloud

Let’s say you just built a device that allows you to deliver a little treat for your dog and you want to control it with your smartphone. One thing you can do is use an Arduino with WiFi, develop a sketch that can implement a simple web server (you can find tons on the internet), and when the device connects to your home WiFi, you can control it with your phone or computer.

Now if you leave home and, say, go shopping, you’ll find that you can no longer connect to your device because any connection to it coming from outside is blocked by your firewall. The firewall is usually one of the bits of software that run on the internet router/access point provided by your internet provider. Its job is to let your devices (your computer, tablet, phone, smart thermostat, etc.) connect to the internet from inside your home while blocking any connection initiated from the outside. This is super important to protect your home, your devices and your personal life from malicious “hackers”.

While it’s technically possible to open a “hole” in the firewall to allow one specific connection to reach one specific device, it’s actually quite cumbersome and each “Access Point” does it in a different way, so the best way to solve this is to use an external service which receives connection from all of your devices spread across the world and lets them talk to each other. This is where the IoT Cloud comes in.

Features of the Arduino IoT Cloud

Beside “bridging” between devices, the Arduino IoT Cloud provides a lot of useful features:

  • Dashboard: A user interface to monitor and control multiple devices without writing a single line of code. You just drag and drop elements (like, for example, a slider, a button or a gauge indicator), select variables from different “things” and, in less than no time, you have a working dashboard.
  • Automatic code generation: When you define the basic characteristics of a “thing” through a web interface, you press a button and you get the whole sketch written for you with sophisticated logic to manage the connection to the cloud. What’s left to do is add the code that reads data from sensors and send data to actuators. The rest of the work of communicating with the cloud is managed automatically from the code Arduino generates for you. All of this is in the Arduino Cloud Web IDE where you edit your sketch without leaving the browser.
  • Data Logging: The Arduino Cloud has the ability to store the historical value of certain variables so you can check how some quantity changed over time and analyse the data further.
  • Mobile App: There is a free mobile app that lets you interact with your devices with your smartphone.
  • Node-RED Integration: Node-RED is a popular visual programming tool used by many people to automate their smart home. Arduino Cloud provides a free “node” that lets you use Node-RED to interact with your devices and integrate them in complex automations, connecting with hundreds of different APIs.
  • Webhooks: You can instruct the Arduino Cloud to send the current state of a device to a certain URL every time the data changes. This allows you to integrate the Cloud with services like IFTT, Zapier, or Google Apps
  • API: If you know how to program with languages like Python or Javascript, you can build applications that interact with the Arduino Cloud through its API.
  • Alexa Integration: the Arduino Cloud can talk to an Amazon Alexa smart speaker and lets you control your devices with voice commands.

You can find more detailed information at https://cloud.arduino.cc.

Arduino Cloud Plans

The Arduino Cloud is free for a lot of users but if you want to be able to control a lot of devices or share dashboards with somebody else you might need to purchase a plan. They start at $1.99 a month. You can see the different plans here https://store.arduino.cc/digital/create 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.43.192