0% found this document useful (0 votes)
36 views30 pages

Idea Lab

Idea Lab

Uploaded by

divyanshdixit691
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)
36 views30 pages

Idea Lab

Idea Lab

Uploaded by

divyanshdixit691
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/ 30

LAB MANUAL

ON
IDEA LAB

Incharge- Dr.Rahul Saraswat

PREPARED BY:
Dr.Rahul Saraswat
Internet of Things (IOT)
Introduction: IOT stands for “Internet of Things”. The IOT is a name for
the vast collection of “things” that are being networked together in the home
and workplace (up to 20 billion by 2020 according to Gardner, a technology
consulting firm).

Characteristics of the IOT

These IOT devices talk to one another (M2M


communication) or to servers located in the
Networkin local network or on the Internet. Being on the
g network allows the device the common ability
to consume and produce data.

Sensin
g IOT devices sense something about their environment.

Actuators
IOT devices that do something. Lock doors,
beep, turn lights on, or turn the TV on
Communications in IoT

Communications are important to IOT projects. In fact, communications are


core to the whole genre. There is a trade-off for IOT devices. The more
complex the protocols and higher the data rates, the more powerful processor
needed and the more electrical power the IOT device will consume.
TCP/IP base communications (think web servers; HTTP-based commutation
(like REST servers); streams of data; UDP) provide the most flexibility and
functionality at a cost of processor and electrical power.
Low-power Bluetooth and Zigbee types of connections allow much lower
power for connections with the corresponding decrease in bandwidth and
functionality. IOT projects can be all over the map with requirements for
communication flexibility and data bandwidth requirements.

Arduino in IoT
In IoT applications the Arduino is used to collect the data from the
sensors/devices to send it to the internet and receives data for purpose of
control of actuators.
Arduino Uno
Introduction: The Arduino Uno is an open-source microcontroller board
based on the Microchip ATmega328P microcontroller and developed by
Arduino.cc. The board is equipped with sets of digital and analog input/output
(I/O) pins that may be interfaced to various expansion boards (shields) and
other circuits. The board has 14 digital I/O pins (six capable of PWM output),
6 analog I/O pins, and is programmable with the Arduino IDE (Integrated
Development Environment), via a type B USB cable. It can be powered by the
USB cable or by an external 9-volt battery, though it accepts voltages between
7 and 20 volts. The word "uno" means "one" in Italian and was chosen to mark
the initial release of Arduino Software.

Features of the Arduino


1. Arduino boards are able to read analog or digital input signals from different
sensors and turn it into an output such as activating a motor, turning LED
on/off, connect to the cloud and many other actions.
2. The board functions can be controlled by sending a set of instructions to the
microcontroller on the board via Arduino IDE.
3. Arduino IDE uses a simplified version of C++, making it easier to learn to
program.
4. Arduino provides a standard form factor that breaks the functions of the micro-
controller into a more accessible package.
Arduino IDE
(Integrated Development
Environment)
Introduction: The Arduino Software (IDE) is easy-to-use and is based
on the Processing programming environment. The Arduino Integrated
Development Environment (IDE) is a cross-platform application (for
Windows, macOS, Linux) that is written in functions from C and C++.
The open-source Arduino Software (IDE) makes it easy to write code
and upload it to the board. This software can be used with any Arduino
board.

The Arduino Software (IDE) – contains:

• A text editor for writing code


• A message area
• A text consoles
• A toolbar with buttons for common functions and a series of menus.
It connects to the Arduino hardware to upload programs and
communicate with them.
Installation of Arduino Software (IDE)

Step1: Downloading
➢ To install the Arduino software, download this page:
http://arduino.cc/en/Main/Software and proceed with the installation by
allowing the driver installation process.

Step 2: Directory Installation


➢ Choose the installation directory.
Step 3: Extraction of Files

➢ The process will extract and install all the required files to execute properly
the Arduino Software (IDE)
Step 4: Connecting the board

The USB connection with the PC is necessary to program the board and
not just to power it up. The Uno and Mega automatically draw power from
either the USB or an external power supply. Connect the board to the
computer using the USB cable. The green power LED (labelled PWR)
should go on.

Step 5: Working on the new project


➢ Open the Arduino IDE software on your computer. Coding in the Arduino
language will control your circuit.
➢ Open a new sketch File by clicking on New.
Step 6: Working on an existing project
To open an existing project example, select File → Example → Basics →
Blink.
Step 7: Select your Arduino board.
To avoid any error while uploading your program to the board, you must select the
correct Arduino board name, which matches with the board connected to your
computer.
Go to Tools → Board and select your board.

Step 8: Select your serial port


Select the serial device of the Arduino board.
Go to Tools → Serial Port menu. This is likely to be COM3 or higher (COM1
and COM2 are usually reserved for hardware serial ports).
To find out, you can disconnect your Arduino board and re-open the menu,
the entry that disappears should be of the Arduino board. Reconnect the board
and select that serial port.
Step 9: Upload the program to your board.
Click the "Upload" button in the environment.
Wait a few seconds; you will see the RX and TX LEDs on the board, flashing.
If the upload is successful, the message "Done uploading" will appear in the
status bar.

A Verify

B Upload

C New

D Open

E Save

F Serial Motor
Experiment 1
Interfacing Light Emitting Diode(LED)-

Blinking LED.
Introduction: Interfacing a Light Emitting Diode (LED) and making it
blink is one of the simplest projects you can do with an Arduino. Below is a
basic procedure for interfacing an LED and making it blink using an
Arduino.
Components Required:

1. Arduino board (e.g., Arduino Uno)


2. Breadboard and jumper wires
3. LED (any color)
4. Resistor (220-330 ohms)

Procedure:

1. Connect the components on the breadboard according to the circuit


connections mentioned above.
2. Connect the Arduino to your computer using a USB cable.
3. Open the Arduino IDE on your computer.
4. Copy and paste the provided Arduino code into the IDE.
5. Select the correct board and port from the Tools menu in the Arduino IDE.
6. Click the "Upload" button to upload the code to the Arduino.
7. Observe the LED on Pin 13 blinking on and off at a 1-second interval.

Circuit Connections:
• Connect the positive (longer leg) of the LED to a digital pin on the Arduino (
Pin 8).
• Connect the negative (shorter leg) of the LED to a current-limiting resistor
(220-330 ohms).
• Connect the other end of the resistor to the ground (GND) on the Arduino.
Arduino Code:
Precautions:
1. The pushbutton is square so it is important to set it appropriately on
breadboard.
2. While making the connections make sure to use a pull-down resistor
because directly connecting two points of a switch to the circuit will
leave the input pin in floating condition and circuit may not work
according to the program.
3. It is very important to set pinMode() as OUTPUT first before using
digitalWrite() function on that pin.
4. If you do not set the pinMode() to OUTPUT, and connect an LED to a
pin, when calling digitalWrite(HIGH), the LED may appear dim.
Experiment 2
Interfacing the RGB LED with the Arduino
Introduction: There are actually two types of RGB LED’s; the common
cathode one and the common anode one. In the common cathode RGB led, the
cathode of all the LED’s is common and we give PWM signals to the anode
of LED’s while in the common anode RGB led, the anode of all the LED’s is
common and we give PWM signals to the cathode of LED’s. Inside the RGB
led, there are three more LED’s. So, by changing the brightness of these
LED’s, we can obtain many other colors. To change brightness of RGB led,
we can use the PWM pins of Arduino. The PWM pins will give signal different
duty cycles to the RGB led to obtain different colors.
Hardware Required:

Component Name Quantity

Arduino UNO 1

RGB LED 1

220Ω/330Ω resistor 3

USB Cable 1

Breadboard 1

Jumper wires several

Connection Diagram:
Steps of working
1. Insert the RGB LED into your breadboard and connect its cathode pin
to the GND of the Arduino.
2. Insert the LED into the breadboard. Attach Red pin to pin 8, Green pin
to pin 9 and Blue pin to pin 10 of the Arduino via the 220-ohm resistor,
and the negative leg to GND.
3. Upload the code as given below.
4. Observe the changes in the color of the RGB LED.

Arduino Code
This sketch works by setting pinsD8, D9, D10 as for the different legs of RGB
LED. After that the run a loop that continually reads the value from the pins
and sends that value as voltage to the LED. The voltage value is between 0–5
volts, and the blinking of the LED will vary accordingly.
Experiment 3
Interfacing Temperature Sensor(LM35)
and/or humidity sensor (e.g.DHT11).
Introduction: Interfacing a temperature sensor (such as LM35) and/or a
humidity sensor (such as DHT11) with an Arduino is a common project in
the realm of environmental sensing. Below, there is a simple procedure for
connecting both the LM35 temperature sensor and the DHT11 humidity
sensor to an Arduino.

Component Required:
1. Arduino board (e.g., Arduino Uno)
2. Breadboard and jumper wires
3. LM35 temperature sensor
4. DHT11 humidity and temperature sensor (optional)
5. Resistors (if needed for DHT11)
6. Capacitor (if needed for DHT11)
Procedure:
1. Connect the components on the breadboard according to the circuit connections
mentioned above.
2. Connect the Arduino to your computer using a USB cable.
3. Open the Arduino IDE on your computer.
4. Copy and paste the provided Arduino code into the IDE.
5. Select the correct board and port from the Tools menu in the Arduino IDE.
6. Click the "Upload" button to upload the code to the Arduino.
7. Open the Serial Monitor to observe the temperature and humidity readings.

Working Diagram:
Steps of working
• For LM35 Temperature Sensor:
• Connect the LM35's VCC pin to 5V on the Arduino.
• Connect the LM35's GND pin to GND on the Arduino.
• Connect the LM35's OUT pin to an analog pin on the Arduino ( A0).
• For DHT11 Humidity and Temperature Sensor:
• Connect the DHT11's VCC pin to 5V on the Arduino.
• Connect the DHT11's GND pin to GND on the Arduino.
• Connect the DHT11's DATA pin to a digital pin on the Arduino (D2).
• Optionally, add a pull-up resistor (5k ohms) between the VCC
and DATA pins of the DHT11.

Arduino Code:
Experiment 4
Interfacing Air Quality Sensor-pollution (e.g.
MQ135) – display data on LCD switch on
LED when data sensed is higher than
specified value.

Introduction: Interfacing an Air Quality Sensor (e.g., MQ135) with an


Arduino, displaying data on an LCD, and activating an LED when the
sensed pollution level exceeds a specified threshold is a valuable project for
monitoring air quality. Below is a step-by-step procedure for setting up this
project

Component Required:
1. Arduino board (e.g., Arduino Uno)
2. Breadboard and jumper wires
3. MQ135 Air Quality Sensor
4. LCD (16x2 or 20x4)
5. Potentiometer (10k ohms) for adjusting LCD contrast
6. LED
7. Resistor (220-330 ohms) for the LED
8. Resistors (if needed for MQ135)
9. Capacitors (if needed for MQ135)

Procedure:
1. Connect the components on the breadboard according to the circuit
connections mentioned above.
2. Connect the Arduino to your computer using a USB cable.
3. Open the Arduino IDE on your computer.
4. Install the "LiquidCrystal_I2C" library from the Library Manager in
the Arduino IDE (Sketch -> Include Library -> Manage
Libraries...).
5. Copy and paste the provided Arduino code into the IDE.
6. Select the correct board and port from the Tools menu in the Arduino IDE.
7. Click the "Upload" button to upload the code to the Arduino.
8. Adjust the potentiometer to set the LCD contrast.
9. Observe the air quality readings displayed on the LCD, and the
LED should turn on when the pollution level exceeds the specified
threshold.

Circuit Connections:
• Connect the MQ135 sensor to the Arduino:
• Connect the VCC pin of the MQ135 to 5V on the Arduino.
• Connect the GND pin of the MQ135 to GND on the Arduino.
• Connect the OUT pin of the MQ135 to an analog pin on the Arduino (A0).
• Connect the LCD to the Arduino as described in the previous answer.
• Connect the LED to the Arduino:
• Connect the anode (longer leg) of the LED to a digital pin on the Arduino
(D7).
• Connect the cathode (shorter leg) of the LED to a current-
limiting resistor (220-330 ohms).
• Connect the other end of the resistor to GND on the Arduino.
Arduino Code:
Experiment 5
Interfacing of the Active Buzzer with
Arduino.
Introduction:
A piezo buzzer is a type of electronic device that’s used to produce beeps and
tones. The working principle of the device is piezoelectric effect. The main
component of this device is a piezo crystal, which is a special material that
changes shape when a voltage applied to it. The active buzzer will only
generate sound when it will be electrified. It generates sound at only one
frequency. This buzzer operates at an audible frequency of about 2 KHz.

Specifications:

Specification Range

VoltageRange 3.3-5V

Frequency 2KHz
Pin Name Description

Positive Identified by (+) symbol or longer terminal


lead. Can be powered by 6V DC

Negative Identified by short terminal lead. Typically


connected to the ground of the circuit

Components Required:

Component Name Quantity

Arduino UNO 1

Buzzer / piezo 1
speaker

220-ohm resistors 1

USB Cable 1

Breadboard 1

Jumper wires several


Connection Diagram:

Steps of working:
Connect the Supply wire (RED) of the buzzer to the Digital Pin 9 of the
Arduino through a 100-ohm resistor.
Connect the Ground wire (BLACK) of the buzzer to any Ground Pin on the
Arduino.
Upload the code
Observe the changes in the pitch and volume of the buzzer.
Aurduino Code

You might also like