IoT 1 2 3 Final
IoT 1 2 3 Final
Aim:
Objectives:
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.
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.
● 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.
● 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.
Declaration of Variables
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.
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.
6. serial.begin(baud rate): Sets the beginning of serial communication by setting the bit rate.
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.
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.
● 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.
● 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.
● 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:
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