0% found this document useful (0 votes)
14 views10 pages

IoT 1 2 3 Final

The document outlines three experiments focused on familiarizing users with Arduino Uno, programming an LED blinking application, and identifying various sensors used in IoT applications. It covers the hardware and software aspects of Arduino, basic programming functions, and the significance of different sensors like temperature, proximity, and gas sensors in practical applications. Additionally, it includes a viva-voce section with questions and answers related to the experiments.

Uploaded by

aakshargarg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

IoT 1 2 3 Final

The document outlines three experiments focused on familiarizing users with Arduino Uno, programming an LED blinking application, and identifying various sensors used in IoT applications. It covers the hardware and software aspects of Arduino, basic programming functions, and the significance of different sensors like temperature, proximity, and gas sensors in practical applications. Additionally, it includes a viva-voce section with questions and answers related to the experiments.

Uploaded by

aakshargarg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

EXPERIMENT-1

Aim:

Familiarize with Arduino Uno and perform necessary software installation.

Objectives:

1) To Study hardware and software related to IoT.

2) To understand the function of Node MCU and Arduino Uno.

Theory:

Arduino is an open-source electronics platform based on easy-to-use hardware and software. It’s designed for
anyone making interactive projects, from beginners to professionals. The key feature of Arduino is its
simplicity, which allows users to create projects that can sense and control the physical world through sensors
and actuators.

Uses and Applications of Arduino

1. Prototyping:

● Arduino is widely used in developing prototypes for electronic products. Its versatility and ease of
programming make it an ideal choice for engineers and designers to test and refine ideas.

2. Automation:

● Arduino is used in various automation projects, including home automation (controlling lights, fans,
and appliances remotely) and industrial automation (monitoring and controlling machinery).

3. Robotics:

● Arduino serves as the control unit in many robotics projects, handling tasks like motor control, sensor
integration, and decision-making algorithms. It can be used to build simple robots, drones, and robotic
arms.

4. IoT (Internet of Things):

● Arduino is often used in IoT projects, where it collects data from sensors and sends it to the cloud or
other devices over the internet. Arduino boards like the Arduino MKR series and the NodeMCU (which
is Arduino-compatible) have built-in Wi-Fi or Bluetooth modules for connectivity.

5. Wearable Electronics:

● Arduino is used to develop wearable technology like fitness trackers, smart clothing, and health
monitoring devices. Its small size and low power consumption make it suitable for integration into
portable devices.
6. Art Installations:

● Artists use Arduino to create interactive art installations that respond to environmental inputs
like light, sound, or motion. Arduino can control lights, motors, and sound to bring artworks to
life.

Components of Arduino Uno:

● Microcontroller: The brain of the Arduino, typically an Atmel AVR microcontroller like the
ATmega328 (found in Arduino Uno). It executes the code and controls the inputs and outputs.
● Digital and Analog I/O Pins: Used to connect sensors, actuators, and other components. Digital
pins can read or write high/low (on/off) signals, while analog pins can read variable voltages
(e.g., from sensors).
● USB Port: Used to upload code from the computer to the Arduino and to power the board.
● Power Jack: Allows the Arduino to be powered from an external source, like a battery.
● Reset Button: Resets the microcontroller, restarting the program from the beginning.
● Clock Crystal: A clock crystal is a component that provides a precise oscillating signal to help
control the timing and synchronization of operations within a microcontroller or other digital
circuits.
● Voltage Regulator: A voltage regulator is an electronic component that maintains a constant
output voltage level, ensuring that the microcontroller or circuit receives stable power,
regardless of input voltage fluctuations.
● TxRx LED: Tx (Transmit) and Rx (Receive) LEDs indicate data transmission and reception in
a communication system, such as in serial communication. The Tx LED lights up when data is
sent, and the Rx LED lights up when data is received.
● Analog Pin: An analog pin on a microcontroller is used to read analog signals, typically in the
range of 0 to 5V, and convert them to a digital value using an Analog-to-Digital Converter.
● Ground Pins: Ground pins are connection points on a microcontroller that provide a common
reference voltage for the circuit, usually 0V, completing the electrical circuit and allowing
current to return to the power source.

Steps to program an Arduino:-


1. Programs written in Arduino are known as sketches. A basic sketch consists of 3 parts a.

Declaration of Variables

b. Initialization: It is written in the setup () function.

c. Control code: It is written in the loop () function.

2. The sketch is saved with the .ino extension. Any operations like verifying, opening a sketch, saving a sketch
can be done using the buttons on the toolbar or using the tool menu.

3. The sketch should be stored in the sketchbook directory.

4. Choose the proper board from the tools menu and the serial port numbers.

5. Click on the upload button or choose upload from the tools menu. Thus the code is uploaded by the boot
loader onto the microcontroller.

Basic Arduino functions are:

1. digitalRead(pin): Reads the digital value at the given pin.


2. digital.Write(pin, value): Writes the digital value to the given pin.

3. pin.Mode(pin, mode): Sets the pin to input or output mode.

4. analog.Read(pin): Reads and returns the value.

5. analogWrite(pin, value): Writes the value to that pin.

6. serial.begin(baud rate): Sets the beginning of serial communication by setting the bit rate.

Installing theArduino IDE:

Step 1: Visit the official Arduino website at http://www.arduino.cc/en/main/software to download the latest
version of the Arduino IDE. The website offers versions for Windows, Mac, and Linux operating systems.

Step 2: On the download page, choose the appropriate version for your operating system. For Windows, select
the “Windows Installer” option for the simplest installation process.

Step 3: Once the installer is downloaded, locate the file in your Downloads folder (or wherever it was saved)
and double-click it to start the installation process.

Step 4: Follow the on-screen instructions in the installation wizard. You'll be prompted to agree to the terms
and conditions, select installation options, and choose the installation directory.

Step 5: After completing the installation steps, click "Finish" to close the installer. The Arduino IDE should
now be installed on your computer.

Step 6: To verify the installation, open the Arduino IDE by clicking the shortcut on your desktop or searching
for it in your start menu. The IDE should launch, and you'll see the main interface where you can start coding
and uploading programs to your Arduino board.
Viva-voce:
1. What is Arduino Uno, and how is it different from other microcontrollers?

Arduino Uno is an open-source microcontroller board based on the ATmega328P microcontroller. It's different
from other microcontrollers because it comes with a user-friendly development environment (Arduino IDE)
and a wide range of libraries, making it easier to program and interface with various sensors and actuators.

2. What are the main components of the Arduino Uno board?

The main components of the Arduino Uno board include the ATmega328P microcontroller, digital and analog
I/O pins, USB port, power jack, reset button, and an onboard LED connected to pin 13.

3. How do you upload a program to the Arduino Uno, and what software is required?

To upload a program to the Arduino Uno, you need to use the Arduino IDE software. After writing the code in
the IDE, you select the correct board and port, then click the "Upload" button to transfer the program to the
microcontroller via the USB connection.

4. Can you explain the difference between digital and analog pins on the Arduino Uno?

Digital pins on the Arduino Uno can read or write binary values (HIGH or LOW), used for tasks like turning
an LED on or off. Analog pins, on the other hand, can read a range of voltage values (typically 0 to 5V) and
are used for inputs like sensors that provide variable outputs (e.g., temperature sensors).

5. What are the key differences between Arduino Uno and NodeMCU?

Arduino Uno is a basic microcontroller board with no built-in connectivity, making it ideal for simple projects.
NodeMCU, however, is based on the ESP8266 or ESP32 microcontroller, which includes built-in Wi-Fi,
making it more suitable for IoT projects that require wireless communication. NodeMCU also has more
processing power and memory compared to the Arduino Uno.
EXPERIMENT-2

Aim:
To write a program to interface the Arduino with an LED and create a blinking application.

Theory:
1. Introduction to LEDs:

● LED (Light Emitting Diode): An LED is a semiconductor device that emits light when current flows
through it. It is polarized, meaning it has a positive (anode) and a negative (cathode) terminal. When
connected correctly, it lights up when a sufficient voltage is applied.

2. Interfacing an LED with Arduino:

● Circuit Connection:
○ The anode (longer leg) of the LED is connected to one of the digital output pins on the Arduino
(e.g., pin 13).
○ The cathode (shorter leg) is connected to the ground (GND) through a current-limiting resistor
(typically 220Ω or 330Ω). This resistor prevents excessive current from damaging the LED. ●
Basic Circuit:
○ The simplest LED circuit involves connecting the LED in series with a resistor between a digital
output pin and ground. The resistor limits the current to protect the LED and the Arduino pin.

3. Arduino Programming for LED Blinking:

● Digital I/O Control:


○ The Arduino Uno has 14 digital I/O pins that can be set to HIGH (5V) or LOW (0V) using the
digitalWrite() function. This function is used to turn the LED on and off.
● Code Explanation:
○ The program typically involves setting the digital pin connected to the LED as an output using
the pinMode() function.
○ The LED is turned on by setting the pin HIGH and turned off by setting it LOW.
○ The delay() function is used to create a visible blinking effect by pausing the program for a
specified amount of time (in milliseconds).

4. The Blinking Process:

● Blinking Sequence:
○ The Arduino program will continuously alternate between turning the LED on and off with
equal intervals. This cycle creates a blinking effect that is visible to the human eye.
● Practical Applications:
○ This basic blinking application is a fundamental concept in learning how to control outputs
with a microcontroller. It is often the first step before moving on to more complex projects like
traffic lights, alarms, or interactive displays.
Viva Voce

Question: What is the purpose of using a resistor in the LED circuit when interfacing with the Arduino?

● Answer: The resistor limits the current flowing through the LED, preventing excessive current that
could damage the LED and the Arduino pin.

Question: How do you connect an LED to the Arduino board?

● Answer: The anode (longer leg) of the LED is connected to a digital output pin (e.g., pin 13), and the
cathode (shorter leg) is connected to ground (GND) through a current-limiting resistor.

Question: Which function is used to set the state of a digital pin in the Arduino program?

● Answer: The digitalWrite() function is used to set the state of a digital pin to HIGH (turning the LED
on) or LOW (turning the LED off).

Question: What does the delay() function do in the LED blinking program?

● Answer: The delay() function pauses the program for a specified amount of time in milliseconds,
creating a visible blinking effect by controlling how long the LED stays on or off.

Question: Why is the blinking LED application important in learning Arduino programming?

● Answer: The blinking LED application teaches the basics of controlling outputs using microcontroller
programming, digital I/O control, and the significance of timing, which are fundamental skills for more
complex embedded system projects.
EXPERIMENT-3

Aim:
Identification of different sensors used in IoT applications.

Objectives:

1. To study hardware related to IoT.


2. To understand and identify different sensors used in IoT.

Theory:

Temperature Sensors: Devices that measure the degree of hotness or coldness in an environment, commonly
used in HVAC systems, weather monitoring, and industrial processes.

Proximity Sensors: Sensors that detect the presence or absence of an object near them without any physical
contact, often used in automotive, manufacturing, and mobile devices.

Pressure Sensors: Devices that measure the force exerted by a liquid or gas on a surface, used in applications
like weather stations, automotive systems, and industrial equipment.

Water Quality Sensors: Sensors that monitor the quality of water by detecting pH, conductivity, turbidity,
and other parameters, commonly used in environmental monitoring and water treatment facilities.

Chemical Sensors: Devices that detect and identify chemical substances in the environment, used in
laboratories, industrial applications, and safety monitoring.

Gas Sensors: Sensors that detect the presence of gases such as carbon monoxide, methane, and oxygen,
used in industrial safety, air quality monitoring, and leak detection.

Smoke Sensors: Devices that detect smoke particles, often used in fire alarm systems to provide early
warning of a potential fire.

IR Sensors (Infrared Sensors): Sensors that detect infrared radiation, commonly used in remote controls,
night-vision cameras, and motion detection.

Level Sensors: Devices that measure the level of liquids or solids in tanks, used in various industries like
water management, food processing, and oil & gas.

Image Sensors: Sensors that capture and convert visual information into electronic signals, used in cameras,
smartphones, and various imaging applications.
Motion Detection Sensors: Sensors that detect movement within an area, commonly used in security
systems, automatic doors, and lighting control.

Accelerometer Sensors: Devices that measure acceleration forces, used in smartphones, wearables,
automotive safety systems, and robotics.

Gyroscope Sensors: Sensors that measure the rate of rotation around an axis, used in navigation systems,
drones, and mobile devices for orientation tracking.

Humidity Sensors: Devices that measure the amount of moisture in the air, used in weather stations, HVAC
systems, and industrial processes.

Optical Sensors: Sensors that detect light or changes in light, used in barcode scanners, ambient light sensing
in displays, and optical communication systems.
Viva-Voce

Q: What is the primary function of a proximity sensor?


A: A proximity sensor detects the presence or absence of an object without any physical contact, commonly
used in applications like automotive safety systems and industrial automation.

Q: How do gas sensors contribute to safety in industrial settings?


A: Gas sensors detect hazardous gases like carbon monoxide or methane, providing early warnings to prevent
accidents such as gas leaks or explosions in industrial environments.

Q: What is the difference between an accelerometer and a gyroscope sensor?


A: An accelerometer measures linear acceleration (movement in a straight line), while a gyroscope measures
rotational movement (orientation and angular velocity around an axis).

Q: In what applications are water quality sensors typically used?


A: Water quality sensors are used in environmental monitoring, water treatment plants, and aquaculture to
measure parameters like pH, turbidity, and conductivity.

Q: Why are smoke sensors essential in fire safety systems?


A: Smoke sensors detect smoke particles, providing early warning of a potential fire, allowing timely
evacuation and response to prevent damage and injury.

You might also like