Arduino is like the brain of the system and processes the data from the sensor. Arduino is an open-source hardware platform that is readily available for hobbyists and enthusiasts across the globe to build projects. It is embedded with an ATMEGA microcontroller that processes the data and facilitates the proper working of the IoT system. The best thing about Arduino is that it can be programmed ‘n’ a number of times. So we can build to build various types of IoT projects just by changing a simple code.
The Arduino IoT Cloud is designed to help people to create the application very easily. It is as simple as connecting a device, creating properties, and a dashboard to monitor it. Whenever we create an application, a sketch is automatically generated, and updates with all changes we make in the cloud!
According to our requirements, an IoT application will require a few basic components.
- Devices to collect data or control something;
- Software to define the behavior of the hardware (e.g., Arduino Sketch);
- Cloud application to store data, or remotely control the equipment.
Component of Arduino IoT Cloud
Devices are physical objects like a hardware board that can accommodate inside a product (eg, MKR WiFi 1010). These are the hardware that runs the software, reads sensors, controls actuators, and communicates with the Arduino IoT Cloud.
Things represent the inherent properties of the object, with as little reference to the actual hardware used to implement them. Each thing is represented by a collection of properties (e.g., temperature, light). In the cloud, when we create a thing we also need to link it to the device we are using. However, a device can only be connected to one thing at a time.
Properties are the qualities to explain the characteristics of a system. A property can be something like a ‘read-only setting to indicate the Arduino IoT Cloud can read the data, but cannot change the value of the property. A property might be designed as ‘read and write’ if the Arduino IoT Cloud can also remotely change the property’s value and send an event notification to the device.
For example, we want to create a device that can read a sensor, turn on or off something, and write an analog value. The below table shows the needed information to create these properties.
|dimmer||int||0 – 255||Read Only (RO)|
|sensor_data||int||0 – 1023||Read Only (RO)|
|power_switch||BOOLEAN||n/a||Read & Write (RW)|
For creating a property we have to do the following steps –
- Name it,
- Select a data type,
- Set value range,
- Choose permission, and
- Click the ADD button
Dashboards and Widgets
Dashboards are a very essential part of the cloud. In the Dashboard, we can create our control Panel to monitor and control the devices. We can build a unique dashboard for a unique thing, but we also have the possibility of monitoring several different things in the same dashboard.
If we have five active devices, each linked to a thing, we can create one dashboard to rule them all we can create different widgets inside the dashboard. There are over 15 different widgets that we can use properties we create. We can choose from gauges, switches, RGB controls, maps, sliders, and much more, to create powerful dashboards.
Arduino IoT Cloud Events
When Arduino receives an application message that shows something has happened so we say that the Arduino IoT cloud always becomes aware of events for eg. if someone is at door, it is informed through a face recognition application.
Software for Arduino IoT Cloud
The Arduino IoT Cloud will quickly and automatically generate a Sketch when setting up a new thing: this is one of its convenient features. Arduino IoT Cloud is an application that helps makers build connected objects in a quick, easy, and secure way.
You can connect multiple devices to each other and allow them to exchange real-time data. You can also monitor them from anywhere using a simple user interface. Arduino IoT Cloud is fully integrated into the Arduino Create ecosystem, you will be able to generate a template code in Arduino IoT Cloud and then edit and upload it to your board using the Arduino Web Editor.
Working Principle of Arduino-Bluetooth Module
The Ultra Sonic HC-SR04 emits ultrasound at 40,000HZ that travels in the air. If there is an object or obstacle in its path, then it collides and bounces back to the Ultra Sonic module.
The formula distance = speed * time is used to calculate the distance.
Suppose, an object is placed at a distance of 10 cm away from the sensor, the speed of sound in air is 340 m/s or 0.034 cm/µs. It means the sound wave needs to travel in 294 µs. But the Echo pin doubles the distance (forward and bounce backward distance). So, to get the distance in cm multiply the received travel time value with echo pin by 0.034 and divide it by 2.
The distance between Ultra Sonic HC-SR04 and an object is:
distance = (speed+ time) / 2.
Speed of sound:
speed = 340 m/s = 0.034 cm/µs
time = distance/speed
time = 10/0.034 µs = 294 µs
Distance = speed * time/2 = 0.034 * 294/2
For programming of Arduino devices, it requires Arduino software IDE.
Other IoT Tutorials