IoT Lab Manual BEC657C
IoT Lab Manual BEC657C
Prepared by-
Prof. Vaibhav Kakade
Assistant Professor
MARATHA MANDAL’S
ENGINEERING COLLEGE,
BELAGAVI
has satisfactorily completed the course the course of experiments in Internet of things (IoT)
th
(BEC657C) laboratory as partial fulfilment of the requirement of the 6 Semester
Bachelor of Engineering Degree prescribed by the Visvesvaraya Technological University
(V.T.U) Belagavi during the academic year 2024-25.
Total
(100M)
INDEX
S.No Experiment Page Date Marks Staff
No Sign
1 (i) To interface LED/Buzzer with Arduino
/Raspberry Pi and write a program to „turn ON‟
LED for 1 sec after every 2 seconds.
1 (ii) To interface the Push button/Digital sensor
(IR/LDR) with Arduino /Raspberry Pi and write
a program to „turn ON‟ LED when a push button
is pressed or at sensor detection.
2 (i) To interface the DHT11 sensor with Arduino
/Raspberry Pi and write a program to print
temperature and humidity readings.
2 (ii) To interface OLED with Arduino /Raspberry Pi
and write a program to print its temperature and
humidity readings.
3 To interface the motor using a relay with
Arduino /Raspberry Pi and write a program to
„turn ON‟ the motor when a push button is
pressed.
4 (i) Write an Arduino/Raspberry Pi program to
interface the Soil Moisture Sensor.
4 (ii) Write an Arduino/Raspberry Pi program to
interface the LDR/Photo Sensor.
5 Write a program to interface an Ultrasonic
Sensor with Arduino /Raspberry Pi.
6 Write a program on Arduino/Raspberry Pi to
upload temperature and humidity data to
thingspeak cloud.
7 Write a program on Arduino/Raspberry Pi to
retrieve temperature and humidity data from
thingspeak cloud.
8 Write a program to interface LED using
Telegram App.
9 Write a program on Arduino/Raspberry Pi to
publish temperature data to the MQTT broker.
10 Write a program to create a UDP server on
Arduino/Raspberry Pi and respond with
humidity data to the UDP client when requested.
11 Write a program to create a TCP server on
Arduino /Raspberry Pi and respond with
humidity data to the TCP client when requested.
12 Write a program on Arduino / Raspberry Pi to
subscribe to the MQTT broker for temperature
data and print it.
Introduction to Arduino
Arduino UNO:
Arduino Uno is an open-source microcontroller board based on the ATmega328P
microcontroller. It is designed to be easy to use and is a popular choice for beginners in the
field of electronics and programming. The board has 14 digital input/output pins (of which 6
can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB
connection, a power jack, an ICSP header and a reset button. It contains everything needed to
support the microcontroller; simply connect it to a computer with a USB cable or power it
with a AC-to-DC adapter or battery to get started.
Arduino IDE
The Arduino IDE is an open-source software, which is used to write and upload
code to the Arduino boards. The IDE application is suitable for different operating
systems such as Windows, Mac OS X, and Linux. It supports the programming
languages C and C++. Here, IDE stands for Integrated Development Environment.
The program or code written in the Arduino IDE is often called as sketching. We
need to connect the Genuino and Arduino board with the IDE to upload the sketch written
in the Arduino IDE software. The sketch is saved with the extension '.ino.'
4. Result
Node MCU ESP8266
The NodeMCU (Node Micro-Controller Unit) is an open-source software and hardware
development environment built around an inexpensive System-on-a-Chip (SoC) called the
ESP8266. The ESP8266, designed and manufactured by Espressif Systems, contains the
crucial elements of a computer: CPU, RAM, networking (WiFi), and even a modern
operating system and SDK. That makes it an excellent choice for Internet of Things (IoT)
projects of all kinds.
PIN CODE
A0 A0
GPIO 16 D0
GPIO 5 D1
GPIO 4 D2
GPIO 0 D3
GPIO 2 D4
GPIO14 D5
GPIO 12 D6
GPIO 13 D7
GPIO 15 D8
GPIO 9 SD2
GPIO10 SD3
GPIO3 Rx
GPIO1 Tx
Steps to install Node MCU
1. Download and install Arduino IDE
2. Open the IDE and follow this path. File -> preferences -> Additional board
manager URL.
3. Now paste the URL in the dialog box :
http://arduino.esp8266.com/stable/package_esp8266com_index.json
4. Then, click the “OK” button.
5. Now follow this path. Tools -> Board -> Boards Manager
6. Search for ESP8266 and install the “ESP8266 by ESP8266 Community“
7. After this, restart your Arduino IDE.
8. Then, go to Tools > Board and check that you have ESP8266 boards available.
9. First, make sure you have an ESP8266 selected in Tools > Board. If you‟re using the
ESP8266-12E NodeMCU Kit as shown in previous pictures, select the NodeMCU 1.0
(ESP-12E Module) option.