IOT Practical
IOT Practical
IOT Practical
Practical: 1
Aim: Prepare brief report on Arduino tool and brief about its utility. Write a basic program on Arduino
that show case the various programming features of c. take example of operators, conditional statements,
loop etc
1
IOT(3160716) 200210107023
Example:
int ledPin = 2;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH); //turn on an LED
digitalWrite(LED, LOW);
}
void setup() - this function executes only once, when the Arduino is powered on. Here we define things such as
the mode of a pin (input or output), the baud rate of serial communication or the initialization of a library.
void loop() - this is where we write the code that we want to execute over and over again, such as turning on/off
a lamp based on an input, or to conduct a sensor reading every X second.
2
IOT(3160716) 200210107023
Practical: 2
Aim:To study about basic operations of Arduino 1. Blinking of inbuilt LED 2. Blinking of external LED
attaching registers to control the flow of current i.e. intensity of light.
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
delay(1000); // wait for 1 second
digitalWrite(LED_BUILTIN, LOW);
delay(1000); // wait for 1 second
}
int pwmPin = 5;
int pwmValue = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(pwmPin, OUTPUT);
}
void loop() {
pwmValue = analogRead(A0) / 4;
analogWrite(pwmPin, pwmValue);
delay(10); // wait for 10 milliseconds
}
3
IOT(3160716) 200210107023
4
IOT(3160716) 200210107023
Practical: 3
Aim: To study about breadboard in Arduino and implement practical 2 with help of breadboard.
A breadboard (sometimes called protoboard) is essentially the foundation to construct and prototype electronics.
A breadboard allows for easy and quick creation of temporary electronic circuits or to carry out experiments
with circuit design.
void setup(){
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
}
void loop(){
digitalWrite(12, HIGH);
delay(500); // Wait for 500 millisecond(s)
digitalWrite(12, LOW);
delay(500); // Wait for 500 millisecond(s)
digitalWrite(11, HIGH);
delay(500); // Wait for 500 millisecond(s)
digitalWrite(11, LOW);
delay(500); // Wait for 500 millisecond(s)
digitalWrite(10, HIGH);
delay(500); // Wait for 500 millisecond(s)
digitalWrite(10, LOW);
delay(500); // Wait for 500 millisecond(s)
}
5
IOT(3160716) 200210107023
Practical: 4
Aim: Write a Arduino Code to Measure the Temperature data in Serial Monitor. Use DTH11 for the
same.
float pin =A0;
double temp, tempCel;
void setup(){
pinMode(A3,INPUT);
Serial.begin(9600);
}
void loop(){
temp = analogRead(pin);
float v =(temp/965.00)*5.0;
tempCel = (v - 0.5)*100;
Serial.println(tempCel);
Serial.println(temp);
delay(1000);
if(temp<0){
Serial.println("very low");
}
else if(temp>0 && temp<35){
Serial.println("Very Moderate");
}
else {
Serial.println("Very High");}
}
6
IOT(3160716) 200210107023
Practical:5
Aim: Implement a flame detector using Arduino. If there is any presence of flame buzzer should be
enabled
int a;
void setup() {
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT);
pinMode(2, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
a=digitalRead(2);
if(a == HIGH)
{
tone(LED_BUILTIN, 400);
}
else
{
noTone(LED_BUILTIN);
}
7
IOT(3160716) 200210107023
8
IOT(3160716) 200210107023
Practical: 6
Study about various tools for IoT development and prepare a document that describes the study of IoT
Application tools and Node MCU Micro controller
1. OpenRemote
OpenRemote is a platform you can use to create and manage IoT monitoring applications. The primary domains
leveraging the tool are smart city and mobility, energy management and asset management.
OpenRemote is offered under an open-source or a commercial license. The team behind it also provides a range
of services from concept development to implementation and product maintenance.
2. ThingsBoard
The ThingsBoard IoT platform uses MQTT, CoAP and HTTP protocols to connect devices and handle data
from them. Out-of-the-box configurable dashboards, charts, maps and widgets provide you with robust real-time
visualization of your data, which you can share with partners. In addition, you can create custom widgets using
the built-in editor.
ThingsBoard Rule Engine allows you to create rule chains and event-based workflows for the perfect match
with your use case requirements.
The platform can support multiple tenants and millions of devices. Cloud and on-prem deployment is available.
You can choose a monolithic architecture for a small project or a microservices architecture for a highly scalable
project.
3. Flutter
Another hardware product for IoT solutions is Flutter — a programmable processor core. The board is based on
Arduino, has a powerful ARM processor, built-in battery charging and a security chip. A long-range wireless
transmitter makes this board the perfect fit for wireless networks of sensors.
Flutter offers:
the Basic control module
the Pro control module
complete kits (Quick Start Kit, Vehicle Control Kits)
accessory boards (the Bluetooth adapter, the Breakout, the Remote Control, the Explorer)
a solar panel, a cylindrical battery and other accessories
3D-printed parts for your device.
4. Zetta
Zetta is a platform for designing APIs for IoT devices. The platform is based on Node.js and combines reactive
programming, WebSockets and REST APIs. A Zetta server can run in the cloud or locally on hardware such as
Raspberry Pi or Intel Edison.
The development process is simplified due to abstractions and direct access to protocols and conventions.
Visualization tools ensure the continuous monitoring of device behavior and timely reaction to abnormalities.
With Zetta, you can create data-intensive mobile, device and cloud applications and integrate smaller systems
into one coherent system.
5. Home Assistant
Home Assistant is a comprehensive home automation software system. This single center integrates smart home
devices, providing local control and security. Home Assistant offers convenient mobile applications that enable
the remote management of your devices and send notifications if something goes wrong. You can also extend
the functionality of this tool by integrating it with additional apps.
6. DeviceHive
The DeviceHive platform covers end-to-end IoT services, including:
prototyping and production at scale
connection of any devices via MQTT, REST API, WebSockets
integration with cloud platforms and third-party systems
real-time data analytics using the best data solutions such as Apache Spark and Kafka.
DeviceHive offers public, private, or hybrid cloud deployment models, a container-based architecture managed
by Kubernetes, and support to libraries written in various languages. You can use this scalable and device-
agnostic platform for implementing IoT projects of any complexity.
9
IOT(3160716) 200210107023
7. Node-RED
Node-RED is a free programming tool based on Node.js and designed to integrate distributed IoT hardware and
software systems and automate their interaction. It works primarily in Linux environments but can be installed
on Android and Windows as well (you’ll only need a Linux subsystem for WIndows). Node-RED offers out-of-
the-box repositories, interfaces for connecting to MQTT, logic sets and format parsers, as well as the ability to
write custom components.
You can extend Node-RED capabilities by integrating it with cloud platforms (Azure, AWS, IBM) and other
third-party systems.
8. Arduino
Arduino is the leading company on the IoT market that produces electronic devices and software for
them. Arduino hardware offerings include microcontroller boards, modules, shields and kits. Hardware
specifications are suitable for creating various projects, such as robotics and home automation.
Software products are represented by:
Arduino IDE — an open-source prototyping platform, which can be used to easily write code compatible with
any Arduino board.
Arduino Cloud — a single platform that enables the wireless communication of IoT devices, as well as their
remote control and data collection.
IoT Cloud Remote — an application for creating dashboards to control cloud-connected devices.
Web Editor — an application for coding from a browser.
9. Kinoma
A group of software engineers from Marvell Technology, Inc., a leading manufacturer of memory devices,
microcontrollers, telecom equipment and semiconductor devices, has developed a line of open-
source Kinoma software and hardware products for the Internet of Things and embedded solutions.
Kinoma Create — a hardware platform for prototyping IoT devices. It’s powered by and has an
integrated SD card, speaker, microphone, Bluetooth and Wi-Fi. It enables the interaction of devices with cloud
platforms via the WebSocket internet protocol.
Kinoma Studio — an integrated development environment (IDE) that provides the hardware simulator and
sensor library, allowing developers to create robust applications.
Kinoma Connect — an application for Android and iOS supporting IoT devices.
About NodeMCU
NodeMCU stands for Node Microcontroller Unit. It is an open-source Lua-based firmware that is designed for
IoT(Internet of Things) applications. The module that runs this firmware is ESP-12E and that module is based
on 32-bit ESP8266 MCU. It has 2.4 GHz Wi-Fi that supports WPA/WP2. The ESP-12E comes with a
programmer and a 3.3v SMPS unit. So, you do not need any external programmer to program this board and you
can easily run this board directly on 5V from USB.
Features of NodeMCU ESP-12E development board
Operating Voltage: 3.0-3.6 V
Operating Current: 80mA
Operating temperature: -40 to 125 degree Celsius
32-bit MCU
Integrated 10-bit ADC
802.11 b/g/n
Integrated TCP/IP protocol
2.4 GHz Wi-Fi that supports WPA/WPA2
It supports UART, SPI, I2C, IR remote, PWM, SDIO 2.0
It has 20 I/O ports
Applications of NodeMCU ESP-12E development board
IP cameras
Home security
Home Automation
Wireless Control Systems
Mesh network
10