Iot Lab Manual
Iot Lab Manual
Srikakulam
Uses of IoT:
IoT's utility extends across diverse sectors:
• Smart Home Automation: IoT empowers homeowners to remotely
manage appliances, lighting, security systems, and climate control.
• Industrial IoT (IoT): Industries leverage IoT for predictive maintenance,
real-time equipment monitoring, inventory tracking, and supply chain
optimization.
• Healthcare: IoT facilitates remote patient monitoring, smart medical
devices, medication adherence tracking, and personalized healthcare
solutions.
• Smart Cities: Urban landscapes benefit from IoT through enhanced
infrastructure, traffic management, waste management, environmental
monitoring, and public safety measures.
➢ EXPERIMENT DESCRIPTIONS:
✓ Getting Started with IoT Devices
o Overview: This experiment introduces configuring IoT devices,
gathering sensor data transmitting it to the cloud, and visualizing it
through a dashboard.
➢ Arduino:
• Arduino is an open-source electronics platform that allows you to create
interactive projects.
• It consists of a microcontroller (usually an ATMega chip) and a
development environment for writing and uploading code. With
Arduino, you can build various electronic devices, from simple LED
blinkers to complex robots.
➢ Wokwi:
• Wokwi is an online Arduino and ESP32 simulator.
• It’s designed for makers by makers and provides a virtual environment
where you can test your Arduino code without needing physical
hardware. Wokwi supports various Arduino boards, including Uno,
Mega, ESP32, and even Raspberry Pi Pico. You can create circuits,
connect components, and simulate interactions—all within your web
browser.
➢ Tinkercad:
• Tinkercad is another popular platform for electronics and 3D design.
• It’s user-friendly and offers a free, easy-to-use app for creating 3D
models, designing circuits, and coding.
➢ Windows:
Download the IDE:
9 RFID 50-54
1. Experiment Title
• Blinking an LED Using Arduino
2. Objective
• To learn how to interface an LED with an Arduino board and make it
blink using simple code.
3. Materials Required
Hardware Components
• Arduino Uno board
• LED
• Resistor (220Ω)-(optional)
• Breadboard
• Jumper wires
4. Circuit Diagram
Explanation of Connections
• Connect the anode (long leg) of the LED to digital pin 13 on the Arduino.
• Connect the cathode (short leg) of the LED to one end of the resistor.
• Connect the other end of the resistor to the GND pin on the Arduino.
5. Step-by-Step Instructions
//cpp
//Copy code
// Define the LED pin
const int LEDpin = 13;
void setup() {
// Initialize the digital pin as an output
void loop() {
digitalWrite(LEDpin, HIGH); // Turn the LED on
delay(1000); // Wait for a second
digitalWrite(LEDpin, LOW); // Turn the LED off
delay(1000); // Wait for a second
}
• Key Functions:
• pinMode(): Configures the specified pin to behave as an input or an
output.
• digitalWrite(): Writes a HIGH or LOW value to a digital pin.
• delay(): Pauses the program for the amount of time (in milliseconds)
specified as parameter.
Step 3: Uploading the Code
• Connect the Arduino to your computer using a USB cable.
• Open the Arduino IDE and paste the code.
• Select the correct board and port from the Tools menu.
• Click the Upload button to transfer the code to the Arduino.
7. Expected Results
• The LED will turn on for one second and then turn off for one second,
repeatedly.
8. Troubleshooting
10. Conclusion
• This experiment teaches the basics of interfacing an LED with an Arduino
and controlling it using simple code. It lays the foundation for more complex
projects involving sensors and actuators.
11.Applications
• Status Indicators:
Use LEDs to show the status of a process or system (e.g.,
power on/off, error states).
• Communication:
Implement simple visual communication between devices or
systems using blinking patterns.
12. References
• Robotics Backend - Arduino LED Tutorial
• Robocraze - Interfacing LED with Arduino Complete Guide
• GeeksforGeeks - LED Blinking Using Arduino
• Arduino Documentation - Blink
• Instructables - Blink an LED With Digital Output
• Srituhobby - How to Blink an LED Bulb Using Arduino
3. Materials Required
Hardware Components:
• Arduino Uno
• 3 LEDs (Red, Yellow, Green)
• Resistors (220 ohms)-(optional)
• Breadboard
• Jumper wires
• USB cable
Software Tools and Libraries:
• Arduino IDE
Connections:
Red LED:
• Anode (+) to Digital Pin 8 on Arduino
• Cathode (-) through 220-ohm resistor to GND
Yellow LED:
• Anode (+) to Digital Pin 9 on Arduino
• Cathode (-) through 220-ohm resistor to GND
Green LED:
• Anode (+) to Digital Pin 10 on Arduino
• Cathode (-) through 220-ohm resistor to GND
5. Step-by-Step Instructions
Step 1: Setting Up the Hardware
• Place the LEDs (Red, Yellow, Green) on the breadboard.
• Connect the anode (+) of the Red LED to Digital Pin 8, Yellow LED to
Digital Pin 9, and Green LED to Digital Pin 10 on the Arduino.
Experiment:3
Relay Interfaced with Arduino
Experiment:4
SERVO MOTOR Interfaced with Arduino
2. Objective
• Control a servo motor using Arduino to demonstrate motor rotation
based on input signals.
4. Circuit Diagram:
• Connect the control wire (usually orange or yellow) of the servo motor
to Arduino Digital Pin 9.
Experiment:5
Connections:
LDR:
• One leg to 5V on Arduino
• Other leg to A0 (analog pin) on Arduino through a 10k ohm resistor
• Connect the junction of LDR and resistor to GND on Arduino
Experiment:
• Soil Moisture Detection using Soil Moisture Sensor and Displaying in Serial
Monitor
1. Experiment Title
• Soil Moisture Detection using Soil Moisture Sensor and Displaying in Serial
Monitor
2. Objective
• Interface a soil moisture sensor with Arduino to measure soil moisture levels and
display the readings in the Serial Monitor.
3. Materials Required
Hardware Components:
• Arduino Uno
• Soil Moisture Sensor (e.g., FC-28)
• Jumper wires
• USB cable
Software Tools and Libraries:
• Arduino IDE
4. Circuit Diagram:
Visualization:
• Create graphs or charts using software like Excel for better data visualization.
10. Conclusion
Department Of Electronics and Communication Engineering 38
• Successfully interfaced a soil moisture sensor with Arduino to measure and
display soil moisture levels in the Serial Monitor.
• Understood the basics of analog sensor interfacing and serial communication
with Arduino.
• Explored potential applications in agriculture, gardening, and environmental
monitoring.
11. Applications
• Agricultural Monitoring: Monitor soil moisture levels to optimize irrigation
schedules.
• Research and Education: Use in educational projects to study plant growth and
water requirements.
• Environmental Monitoring: Implement in projects to monitor soil health and
water conservation efforts.
12. References
• Arduino Documentation and Resources
• Soil moisture sensor datasheets and relevant resources on sensor interfacing
with microcontrollers.
4. Circuit Diagram
3. Connect the positive leg of the LED to Arduino Digital Pin 3 through a 220-ohm
resistor. Connect the negative leg of the LED to GND.
5. Step-by-Step Instructions
Step 1: Setting Up the Hardware
• Connect the sound sensor and LED to the Arduino as per the circuit diagram.
• Ensure the connections are secure and the components are correctly oriented.
Step 2: Writing the Code
• Open Arduino IDE.
Copy code
// Define pins
const int soundSensorPin = 2; // Digital pin for sound sensor
const int ledPin = 3; // Digital pin for LED
void setup() {
pinMode(soundSensorPin, INPUT); // Set sound sensor pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
}
12. References
• Arduino Documentation and Resources
• Sound sensor module datasheets and relevant resources on sensor interfacing
with microcontrollers.
Experiment:
Distance Measurement with Ultrasonic Sensor and Display on LCD using Arduino
with I2C Interface
1. Experiment Title
• Distance Measurement with Ultrasonic Sensor and Display on LCD using Arduino
with I2C Interface
2. Objective
• Learn how to interface an ultrasonic sensor with Arduino to measure distance
and display it on a 16x2 LCD using an I2C module.
3. Materials Required
Hardware Components:
• Arduino Uno
• HC-SR04 Ultrasonic Sensor
• 16x2 LCD display with I2C backpack (e.g., PCF8574)
• I2C module
• Breadboard
• Jumper wires
• Data Logging:
Store distance measurements in an SD card module or transmit them wirelessly
using Wi-Fi or Bluetooth.
10. Conclusion
• Successfully interfaced an ultrasonic sensor with Arduino to measure and display
distances on a 16x2 LCD using an I2C module.
• Learned how to use the NewPing library for accurate distance measurements and
the LiquidCrystal_I2C library for simplified LCD control.
• Explored potential improvements and advanced features for distance
measurement projects.
11. Applications
Smart Parking Systems:
• Monitor vehicle distances in parking lots to assist drivers in parking.
Obstacle Avoidance:
• Integrate into robotic systems to detect and avoid obstacles.
Industrial Automation:
• Measure distances in manufacturing processes for quality control and safety.
12. References
Experiment:9
Arduino Interfacing with RFID
Experiment Outline
1. Experiment Title
• Arduino Interfacing with RFID Reader
2. Objective
• Use Arduino to read RFID tags and display tag information on the Serial
Monitor.
3. Materials Required
Hardware Components:
• Arduino Uno
• RFID Reader Module (e.g., MFRC522)
• RFID Tags (compatible with the reader)
• Jumper wires
4. Circuit Diagram
• Connect the MFRC522 RFID reader module to Arduino as per the datasheet or
module instructions.
• Typically, connections include SPI pins (MOSI, MISO, SCK, SS) and power (5V and
GND).
5. Step-by-Step Instructions
Step 1: Setting Up the Hardware
Experiment:10
Arduino Interfacing with Bluetooth Module
Experiment:
LED Control using Bluetooth Module with Arduino
1. Experiment Title
2. Objective
• Control an LED wirelessly via Bluetooth using a mobile app, demonstrating
basic Bluetooth communication with Arduino.
3. Materials Required
Hardware Components:
• Arduino Uno
• HC-05 Bluetooth Module
• LED
• Resistor (220 ohms)
• Breadboard
• Jumper wires
• USB cable
Software Tools Required:
• Arduino IDE
• Bluetooth Module Library
• Serial Communication Library
• Bluetooth Terminal App
4. Circuit Diagram
void setup() {
// Initialize serial communication for debugging
Serial.begin(9600);
pinMode(ledPin, OUTPUT); // Set LED pin as output
// Set up Bluetooth communication
bluetooth.begin(9600);
}
void loop() {
// Check if data is available to read from Bluetooth
if (bluetooth.available()) {
char command = bluetooth.read(); // Read the incoming data from
Bluetooth
Serial.print("Received command: ");
Serial.println(command)
// Perform action based on received command
if (command == '1') {
digitalWrite(ledPin, HIGH); // Turn LED ON
Serial.println("LED ON");
} else if (command == '0') {
11. Applications
• Home Automation: Control lights and appliances wirelessly.
• Robotics: Integrate into robotic systems for remote operation.
• IoT Projects: Enable remote monitoring and control of devices via Bluetooth
connectivity.
12. References
• Arduino Documentation and Resources
• HC-05 Bluetooth Module datasheet and related documentation on Bluetooth
communication protocols.
4. Circuit Diagram
Experiment:
LED Controlling with WiFi Module and Web Page Interface
1. Experiment Title
• LED Controlling with WiFi Module and Web Page Interface using Arduino
2. Objective
• To control an LED connected to an Arduino board through a web page interface
using a WiFi module.
3. Materials Required
Hardware Components:
• Arduino Uno
• ESP8266 WiFi Module
• LED
• Resistor (220 ohms)
• Breadboard
• Jumper wires
Department Of Electronics and Communication Engineering 65
• USB cable
Software Tools and Libraries:
• Arduino IDE
• ESP8266WiFi library
4. Circuit Diagram
LED:
• Anode (+) to digital pin 4 (through a 220-ohm resistor)
• Cathode (-) to GND
5. Step-by-Step Instructions
Step 1: Setting Up the Hardware
• Connect the LED to the Arduino as per the circuit diagram.
• Connect the ESP8266 WiFi module to the Arduino.
Step 2: Writing the Code
void setup() {
Serial.begin(115200);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
Serial.println("");
Serial.println("WiFi connected");
server.begin();
}
void loop() {
WiFiClient client = server.available();
if (client) {
Serial.println("New Client.");
String currentLine = "";
while (client.connected()) {
if (client.available()) {
char c = client.read();
Serial.write(c);
if (c == '\n') {
if (currentLine.length() == 0) {
client.println("HTTP/1.1 200 OK");
client.println("Content-type:text/html");
client.println();
client.println();
if (currentLine.endsWith("GET /H")) {
digitalWrite(ledPin, HIGH);
}
if (currentLine.endsWith("GET /L")) {
digitalWrite(ledPin, LOW);
}
}
}
client.stop();
Serial.println("Client Disconnected.");
}
}
Experiment:
Temperature and Humidity Monitoring with WiFi Module and Web Page
Interface
1. Experiment Title
• Temperature and Humidity Monitoring with WiFi Module and Web Page Interface
using Arduino
2. Objective
• To monitor temperature and humidity levels using a DHT11 sensor connected to
an Arduino board and display the data on a web page through a WiFi module.
3. Materials Required
Hardware Components:
• Arduino Uno
• ESP8266 WiFi Module
• DHT11 Sensor
• Breadboard
• Jumper wires
• USB cable
Software Tools and Libraries:
• Arduino IDE
• DHT sensor library
• ESP8266WiFi library
DHT11 Sensor:
• VCC to 5V
• GND to GND
• Data to digital pin 1
5. Step-by-Step Instructions
Step 1: Setting Up the Hardware
• Connect the DHT11 sensor to the Arduino as per the circuit diagram.
• Connect the ESP8266 WiFi module to the Arduino.
Step 2: Writing the Code
• Install the DHT sensor library from the Library Manager in Arduino IDE.
Copy code
#include <ESP8266WiFi.h>
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
WiFiServer server(80);
void setup() {
Serial.begin(115200);
dht.begin();
WiFi.begin(ssid, password);
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
}
client.print("Temperature: ");
client.print(t);
client.println(" ℃<br>");
client.print("Humidity: ");
client.print(h);
client.println(" %<br>");
client.println();
11. Applications
• Home Automation: Monitor home environment and control HVAC systems.
• Agriculture: Track temperature and humidity in greenhouses and farms.
• Industrial Monitoring: Monitor environmental conditions in factories and
warehouses.