Devansh IOT Exp 1-Merged

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Devansh Goyal (20EEAEC012)

EXPERIMENT-1

OBJECTIVE: Study the fundamental of IOT software’s and components.

RESOURCE REQUIRED: Proteus and Arduino IDE

THEORY: Internet of Things (IoT) is a network of physical objects or people called "things “that are embedded
with software, electronics, network, and sensors that allows these objects to collect and exchange data. The
thing in IoT can also be a person with a diabetes monitor implant, an animal with tracking devices, etc.

Components of IOT:
1) Sensors/Devices: Sensors or devices are a key component that helps you to collective data from the
surrounding environment. A device may have various types of sensors which performs multiple tasks apart from
sensing. Example, A mobile phone is a device which has multiple sensors like GPS, camera but your
smartphone is notable to sense these things.

2) Connectivity: All the collected data is sent to a cloud infrastructure. The sensors should be connected to
the cloud using various mediums of communications. These communication mediums include mobile or
satellite networks, Bluetooth, WI-FI,WAN, etc.

3) Data Processing: Once that data is collected, and it gets to the cloud, the software performs processing on
the gathered data. This process can be just checking the temperature, reading on devices like AC or heaters.
However, it can sometimes also be very complex like identifying objects, using computer vision on video.

4) User Interface: The information needs to be available to the end-user in some way which can be achieved
by triggering alarms on their phones or sending them notification through email or text message. The
user sometimes might need an interface which actively checks their IoT system. For example, the user has a
camera installed in his home. He wants to access video recording and all the feeds with the help of a web
server.

5) Depending on the IoT application and complexity of the system, the user may also be able to perform an
action which may create cascading effects.

6) For example, if a user detects any changes in the temperature of the refrigerator, with the help of IoT
technology the user should able to adjust the temperature with the help of their mobile phone.
Devansh Goyal (20EEAEC012)

How does Internet of Thing (IoT) Work?


The working of IoT is different for different IoT echo system (architecture). However, the key concept of there
working are similar. The entire working process of IoT starts with the device themselves, such as smartphones,
digital watches, electronic appliances, which securely communicate with the IoT platform. The platforms
collect and analyze the data from all multiple devices and platforms and transfer the most valuable data with
applications to devices.
Devansh Goyal (20EEAEC012)

Features of IOT

The most important features of IoT on which it works are connectivity, analyzing, integrating, active
engagement, and many more. Some of them are listed below: Connectivity: Connectivity refers to establish a
proper connection between all the things of IoT to IoT platform it may be server or cloud. After connecting the
IoT devices, it needs a high speed messaging between the devices and cloud to enable reliable, secure
and bi-directional communication.

Analyzing: After connecting all the relevant things, it comes to real-time analyzing the data collected and use
them to build effective business intelligence. If we have a good insight into data gathered from all these
things, then we call our system has a smart system.

Integrating: IoT integrating the various models to improve the user experience as well.

Artificial Intelligence: IoT makes things smart and enhances life through the use of data. For example, if we
have a coffee machine whose beans have going to end, then the coffee machine itself order the coffee
beans of your choice from the retailer.

Sensing: The sensor devices used in IoT technologies detect and measure any change in the environment and
report on their status. IoT technology brings passive networks to active networks. Without sensors, there could
not hold an effective or true IoT environment.

Active Engagement: IoT makes the connected technology, product, or services to active engagement between
each other.

Endpoint Management: It is important to be the endpoint management of all the IoT system otherwise, it
makes the complete failure of the system. For example, if a coffee machine itself order the coffee beans when
it goes to end but what happens when it orders the beans from retailer and we are not present at home for a
few days, it leads to the failure of the IoT system. So, there must be a need for endpoint management.

IoT Protocols
Devansh Goyal (20EEAEC012)

1. Constrained Application Protocol (CoAP)

CoAP is an internet utility protocol for constrained gadgets. It is designed to enable simple, constrained devices
to join IoT through constrained networks having low bandwidth availability. This protocol is primarily used for
machine-to-machine (M2M) communication and is particularly designed for IoT systems that are based on
HTTP protocols.

CoAP makes use of the UDP protocol for lightweight implementation. It also uses restful architecture, which
is just like the HTTP protocol. It makes use of dtls for the cozy switch of statistics within the slipping layer.

2. Message Queue Telemetry Transport Protocol (MQTT)

MQTT (Message Queue Telemetry Transport) is a messaging protocol developed with the aid of Andy
Stanford-Clark of IBM and Arlen Nipper of Arcom in 1999 and is designed for M2M communication.
It‘s normally used for faraway tracking in IoT. Its primary challenge is to gather statistics from many gadgets
and delivery of its infrastructure. MQTT connects gadgets and networks with packages and middleware. All the
devices hook up with facts concentrator servers like IBM‘s new message sight appliance. MQTT protocols
paintings on top of TCP to offer easy and dependable streams of information. These IoT protocols include 3
foremost additives: subscriber, publisher, and dealer. The writer generates the information and transmits the
facts to subscribers through the dealer. The dealer guarantees safety by means of move-checking the
authorization of publishers and subscribers.
Devansh Goyal (20EEAEC012)

3. Advanced Message Queuing Protocol (AMQP)

This was evolved by John O‘Hara at JP Morgan Chase in London. AMQP is a software layer protocol for
message-oriented middleware environment. It supports reliable verbal exchange through message transport
warranty primitives like at-most-once, at least once and exactly as soon as shipping. The AMQP – IoT
protocols consist of hard and fast components that route and save messages within a broker carrier, with a set
of policies for wiring the components together. The AMQP protocol enables patron programs to talk to the
dealer and engage with the AMQP m odel .This version has the following three additives, which might link
into processing chains in the server to create the favoured capabilities.
Exchange: Receives messages from publisher primarily based programs and routes them to ‗message
queues‘.
Message Queue: Stores messages until they may thoroughly process via the eating client software.
Binding: States the connection between the message queue and the change.

4. Data Distribution Service (DDS)

It enables a scalable, real-time, reliable, excessive-overall performance and interoperable statistics change
via the submit-subscribe technique. DDS makes use of multicasting to convey high-quality QoS to
applications.

DDS is deployed in platforms ranging from low-footprint devices to the cloud and supports green bandwidth
usage in addition to the agile orchestration of system additives. The DDS – IoT protocols have fundamental
layers: facts centric submit-subscribe (dcps) and statistics-local reconstruction layer (dlrl).

Dcps plays the task of handing over the facts to subscribers, and the dlrl layer presents an interface to dcps
functionalities, permitting the sharing of distributed data amongst IoT enabled objects.
Devansh Goyal (20EEAEC012)

I. Thing
Thing‖ in IOT is the asset that you want to control or monitor or measure, that is, observe closely. In many
IoT products, the ―thing‖ gets fully incorporated into a smart device. For example, think of products like a
smart refrigerator or an automatic vehicle. These products control and monitor themselves. There are
sometimes many other applications where the thing stands as an alone device, and a separate product is
connected to ensure it possesses smart capabilities.

ii. Data Acquisition Module


The data acquisition module focuses on acquiring physical signals from the thing which is being observed or
monitored and converting them into digital signals that can be manipulated or interpreted by a computer. This
is the hardware component of an IOT system that contains all the sensors that help in acquiring real-world
signals such as temperature, pressure, density, motion, light, vibration, etc. The type and number of sensors
you need depend on your application. This module also includes the necessary hardware to convert the
incoming sensor signal into digital information for the computer to use it. This includes conditioning of
incoming signal, removing noise, analog-to-digital conversion, interpretation, and scaling.

iii. Data Processing Module


The third building block of the IoT device is the data processing module. This is the actual―computer‖ and
the main unit that processes the data performs operations such as local analytics, stores data locally, and
performs some other computing operations.
Devansh Goyal (20EEAEC012)

iv. Communication Module


The last building block of IOT hardware is the communications module. This is the part that enables
communications with your Cloud Platform, and with 3rd party systems either locally or in the Cloud.

IoT Sensors
The most important IoT hardware might be its sensors. These devices consist of a variety of modules such as
energy modules, RF modules, power management modules, and sensing modules.

Wearable Electronic Devices


Wearable electronic devices are small devices that can be worn on the head, neck, arms, torso, and feet

Current smart wearable devices include – Head − Helmets, glasses,


Neck − Jewelry, collars
Arm − Wristwatches, wristbands, rings Torso – Clothing pieces, backpacks Feet − Shoes, Socks
Devansh Goyal (20EEAEC012)

Basic Devices
The day to day devices that we use such as desktop, cell phones and tablets remain integral parts of IoT
system.
The desktop provides the user with a very high level of control over the system and its settings.
The tablet acts as a remote and provides access to the key features of the system.
Cell phone allows remote functionality and some essential settings modification other key connected devices
include standard network devices like routers and switches.

IoT Software

Embedded systems have less storage and processing power, their language needs are different. The
most commonly used operating systems for such embedded systems are Linux or UNIX-like OSs like Ubuntu
Core or Android.
IoT software encompasses a wide range of software and programming languages from general-purpose
languages like C++ and Java to embedded-specific choices like Google‘s Go language or Parasail.
Few IoT Software’s are-
C & C++: The C programming language has its roots in embedded systems—it even got its start for
programming telephone switches. It‘s pretty ubiquitous, that is, it can be used almost everywhere and many
programmers already know it. C++ is the object-oriented version of C, which is a language popular for both
the Linux OS and Arduino embedded IoT software systems. These languages were basically written for the
hardware systems which makes them so easy to use.
Java: While C and C++ are hardware specific, the code in JAVA is more portable. It is more like a write
once and read anywhere language, where you install libraries, invests time in writing codes once and you are
good to go.
Python: There has been a recent surge in the number of python users and has now become one of the ―go-
to‖ languages in Web development. Its use is slowly spreading to the embedded control and IoT world—
specially the Raspberry Pi processor. Python is an Interpreted language, which is, easy to read, quick to learn
and quick to write. Also, it‘s a powerhouse for serving data-heavy applications.
 Unlike most of the languages mentioned so far, it was specifically designed for embedded systems, it‘s
small and compact and has less memory size.
 Data Collection: It is used for data filtering, data security, sensing, and measurement. The protocols aid in
decision making by sensing form real-time objects. It can work both ways by collecting data from devices
or distributing data to devices. All the data transmits to a central server.
Devansh Goyal (20EEAEC012)

 Device Integration: This software ensures that devices bind and connect to networks facilitating information
sharing. A stable cooperation and communication ensure between multiple devices.
 Real-Time Analytics: In this, the input from users serves as potential data for carrying out real-time analysis,
making insights, suggesting recommendations to solve organizations problems and improve its approach. This,
as a result, allows automation and increased productivity.
 Application and Process Extension: These applications extend the reach of existing systems and software to
allow a wider, more effective system. They integrate pre-defined devices for specific purposes such as
allowing certain mobile devices or engineering instruments access. It supports improved productivity and
more accurate data collection

RESULT

We have studied the fundamentals of IOT software’s and components. Internet of Things can create
information about the connected objects, analyze it, and make decisions. All IoT applications are using
sensors to detect and collect data that are used to give a proper decision that maintains a high level of security
of the installations.
Devansh Goyal (20EEAEC012)

EXPERIMENT-

OBJECTIVE: Familiarization with Arduino/Raspberry Pi and perform necessary software installation.

RESOURCE REQUIRED: Arduino IDE

THEORY: Arduino is a prototype platform (open-source) based on an easy-to-use hardware and


software. It consists of a circuit board, which can be programmed (referred to as a microcontroller) and
a ready-made software called Arduino IDE (Integrated Development Environment), which is used to
write and upload the computer code to the physical board.
Arduino provides a standard form factor that breaks the functions of the microcontroller into a more
accessible package. Arduino is a prototype platform (open- source) based on an easy- to-use hardware
and software. It consists of a circuit board, which can be programmed (referred to as a microcontroller)
and ready-made software called Arduino IDE (Integrated Development Environment), which is used to
write and upload the computer code to the physical board.

The key features are –


Arduino boards are able to read analog and 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.
We can control our board functions by sending a set of instruction to the microcontroller on the board
via Arduino IDE (referred to as uploading software).
Unlike the most programmable circuit boards. Arduino does not need an extra piece of hardware (called a
programmer) in order to load a new code on to the board. We can simply use a USB cable.
Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn and to
program controller into more accessible package.

Download the Arduino Software (IDE)


Get the latest version from Arduino.cc web site. We can choose between the Installer (.exe) and the Zip
packages. We suggest to use the first one that installs directly everything you need to use the Arduino
Software (IDE), including the drivers. With the Zip package you need to install the drivers manually.
The Zip file is also useful if we want to create a portable installation.
When the download finishes, proceed with driver installation process when you get a warning from the
operating system.
Devansh Goyal (20EEAEC012)

The process will extract and install all the required files to execute properly the Arduino Software (IDE)
Proceed with board specific instructions
When the Arduino Software (IDE) is properly installed we can go back to the different Arduino Boards:

Arduino Uno: This is the latest revision of the basic Arduino USB board. It connects to the computer
with a standard USB cable and contains everything else you need to program and use the board.
Arduino NG: REV-C Revision C of the Arduino NG does not have a built-in LED on pin 13 - instead
you'll see two small unused solder pads near the labels "GND" and "13".
Arduino Bluetooth: The Arduino BT is a microcontroller board originally was based on the ATmega168,
but now is supplied with the 328, and the Blue-giga WT11 blue- tooth module. It supports wireless serial
communication over Blue-tooth.
Arduino Mega: The original Arduino Mega has an ATmega1280 and an FTDI USB- to serial chip.
Arduino NANO: The Arduino Nano 3.0 has an ATmega328 and a two-layer PCB. The power LED
moved to the top of the board.

Advantages of using Arduino:


It offers some advantage for teachers, students, and interested amateurs over other systems:
Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller
platforms. The least expensive version of the Arduino module can be assembled by hand, and even the
pre-assembled Arduino modules cost less than $50 Cross-platform - The Arduino Software (IDE) runs
on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited
to Windows.
Simple, clear programming environment - The Arduino Software (IDE) is easy-to-use for beginners,
yet flexible enough for advanced users to take advantage of as well. For
Devansh Goyal (20EEAEC012)

teachers, it's conveniently based on the Processing programming environment, so students learning to
program in that environment will be familiar with how the Arduino IDE works. Open source and
extensible software - The Arduino software published as open source tools, available for extension by
experienced programmers. The language can be expanded through C++ libraries, and people wanting to
understand the technical details can make leap from Arduino to the AVR C programming language on
which it's based. Similarly, you can add AVR-C code directly into your Arduino programs if u want to.
Open source and extensible hardware - The plans of the Arduino boards are published under a
Creative Commons license, so experienced circuit designers can make their own version of the module,
extending it and improving it. Even relatively inexperienced users can build the breadboard version of
the module in order to understand how it works and save money.

Raspberry Pi Introduction

Raspberry Pi is a small single board computer. By connecting peripherals like Keyboard, mouse, display
to the Raspberry Pi, it will act as a mini personal computer. Raspberry Pi is popularly used for real
time Image/Video Processing, IoT based applications and Robotics applications.

Raspberry Pi is slower than laptop or desktop but is still a computer which can provide all the expected
features or abilities, at a low power consumption.

Raspberry Pi Foundation officially provides Debian based Raspbian OS. Also, they provide NOOBS OS
for Raspberry Pi. We can install several Third-Party versions of OS like Ubuntu, Archlinux, RISC OS,
Windows 10 IOT Core, etc.
Raspbian OS is official Operating System available for free to use. This OS is efficiently optimized to
use with Raspberry Pi. Raspbian have GUI which includes tools for Browsing, Python programming,
office, games, etc.

We should use SD card (minimum 8 GB recommended) to store the OS (operating System).


Raspberry Pi is more than computer as it provides access to the on-chip hardware i.e. GPIOs for
developing an application. By accessing GPIO, we can connect devices like LED, motors, sensors, etc
and can control them too.

It has ARM based Broadcom Processor SoC along with on-chip GPU (Graphics
Processing Unit). The CPU speed of Raspberry Pi varies from 700 MHz to 1.2 GHz. Also, it has
onboard SDRAM that ranges from 256 MB to 1 GB. Raspberry Pi also provides on-chip SPI, I2C, I2S
and UART modules.

There are different versions of raspberry pi available as listed below:

1. Raspberry Pi 1 Model A
2. Raspberry Pi 1 Model A+
3. Raspberry Pi 1 Model B
4. Raspberry Pi 1 Model B+
Devansh Goyal (20EEAEC012)

5. Raspberry Pi 2 Model B
6. Raspberry Pi 3 Model B
7. Raspberry Pi Zero

RASPERRY PI HARDWARE:

Some Hardware Components shown above are mention below:

1. HDMI (High-Definition Multimedia Interface): It is used for transmitting uncompressed


video or digital audio data to the Computer Monitor, Digital TV, etc. Generally, this HDMI port helps to
connect Raspberry Pi to the Digital television.
2. CSI Camera Interface: CSI (Camera Serial Interface) interface provides a connection in
between Broadcom Processor and Pi camera. This interface provides electrical connections between two
devices.
3. DSI Display Interface: DSI (Display Serial Interface) Display Interface is used for connecting
LCD to the Raspberry Pi using 15-pin ribbon cable. DSI provides fast High-resolution display interface
specifically used for sending video data directly from GPU to the LCD display.
4. Composite Video and Audio Output: The composite Video and Audio output port carries
video along with audio signal to the Audio/Video systems. 5. Power LED: It is a RED colored LED
which is used for Power indication. This LED will turn ON when Power is connected to the Raspberry
Pi. It is connected to 5V directly and will start blinking whenever the supply voltage drops below 4.63V.
6. ACT PWR: ACT PWR is Green LED which shows the SD card activity.

Getting Started with Raspberry Pi

To get started with Raspberry Pi, we have to store required OS on SD card.


Now to store OS on SD card we need to install OS on SD card. If we want to know how to install/store
OS on SD card you can refer Installing Operating System Image on SD card.
Here, we installed the Raspbian OS on SD card.
Now, we have an SD card with installed OS and Raspberry Pi Board. Initially to use raspberry Pi we
need computer monitor or Digital Display.
We can directly connect Raspberry Pi to the Digital Display using HDMI Cable.
Devansh Goyal (20EEAEC012)

HDMI Cable

But, if we have a computer monitor (VGA Display), then we need an HDMI to VGA converter along with
a VGA cable for connecting Raspberry Pi with monitors. HDMI to VGA converter and VGA cable is
shown below.

Now, connect the Raspberry Pi to the Display/monitor and Power-On Raspberry Pi. We will get a Black
command window asking for Login and Password as shown below.

Then, use the following login name and password.


Raspberry-pi Login: pi Password: raspberry
This is the default user name and password. You can change the password after the first login.
The above command window can be used to operate Raspberry Pi. To get GUI environment on
Raspberry Pi, use below command “starts”
And we will get Home Screen of Raspberry Pi as shown below:
Devansh Goyal (20EEAEC012)

On display, there is a symbol of raspberry to the top-left corner of display. After clicking on it, we will
get menu as shown below,

As we can see, the Raspbian OS has installed Python 2 & 3. It also has different programming IDE like
Geany, BlueJ Java IDE, etc. As raspberry pi 3 has On-chip WiFi, we can connect it to the network and
will get access over Internet.
We can also change password of ―Pi‖ user.
To change password, click on preferences and then select Raspberry Pi Configuration which will
provide a pop-up window.

Then, click on change password option shown below.


Devansh Goyal (20EEAEC012)

Now, we are quite familiar with Raspberry Pi OS.

How to write C program on Raspbian OS


So, let‘s write our First C code on Raspbian and execute it. First Create Empty file and label it with .c
extension.
Now write a small program to print ―Hello World‖

Program #include<stdio.h>int main(){ printf(―Hello World‖); return 0;


}

After writing the code, open terminal (ctrl+alt+t) to execute it. Then, type following commands for
compiling and execution.

RESULT:

In this experiment, we have discussed about the Arduino fundamentals and its necessary software
installation. Thus, Arduino simplifies the process of working with microcontrollers, Arduino is an open
source micro-controller which can be used as a development board for hundreds and thousands of
project. we can program the Arduino board with the help of Arduino IDE and the programming is based
on
C/C++. We have also understood the basic concepts of raspberry pi and its configuration details.
Through this knowledge, we will be able to work upon this platform easily.
Devansh Goyal (20EEAEC012)

EXPERIMENT-

OBJECTIVE: To Interface LED /BUZZER with Arduino /Raspberry Pi and write a program to turn ON
LED for 1 Sec after every 2 seconds.

RESOURCE REQUIRED: Tinker-cad

THEORY: Tinker-cad is a browser-based 3D design and modeling program created to provide a way
for a variety of users to create projects. In this software, we will interface LED with Arduino. Firstly
identify anode (+ve) & cathode (-ve) leg of LED.
Digital Write(LED, HIGH); will turn the LED ON. Now we need to keep the LED ON for 1 second.
We do so by keeping the micro controller idle (or we make it to wait) for 1 second. delay(1000); is the
function we use to keep the micro controller idle for 1 second. After 1 second, we need to turn LED
OFF.
We do so with instruction digital Write(LED, LOW); this will turn LED OFF. Now we need to keep
the LED in its OFF state for 2 second (before it is turned ON again). To do so we write a delay(2000);
instruction once again just below the instruction to turn LED OFF.
Since this is the last statement inside loop() function of our program; the micro controller will begin
executing from beginning statement inside loop() after waiting 2 second to keep LED OFF. So the LED
is ON again after 1 second.

CIRCUIT DIAGRAM:

CODE:
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH); delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(LED_BUILTIN, LOW); delay(1000); // Wait for 1000 millisecond(s) }
Devansh Goyal (20EEAEC012)

Observations: We have interfaced the led with Arduino Uno and observe the simulation result.

RESULT:
LED is interfaced with Arduino uno with ON time delay of 1 second and OFF time delay of 2 seconds.
Thus, we have performed the experiment of led interfacing with Arduino and to turn ON for 1 sec after
every 2 seconds.
Devansh Goyal (20EEAEC012)

EXPERIMAENT-

OBJECTIVE: To Interface Pushbutton/Digital sensor(IR/LDR) with Arduino /Raspberry Pi and write a


program to turn ON LED when push button is pressed or at sensor detection.

RESOURCE REQUIRED: Tinker cad

THEORY: CODE

void setup()
{
Serial.begin(9600); pinMode(2,INPUT); pinMode(13,OUTPUT);
}
void loop()
{ if(digitalRead(2) == 1)
{
digitalWrite(13,HIGH);
}
else
{
digitalWrite(13,LOW);
}
}

OBSERVATION:
Devansh Goyal (20EEAEC012)

RESULT:
We have verified that LED is glowing when pushbutton interfaced with Arduino is pressed. Pushbutton
interfacing with Arduino is done and diode is turning ON when it is pressed.
Devansh Goyal (20EEAEC012)

EXPERIMENT-

OBJECTIVE: To interface motor using relay with Arduino/Raspberry Pi and write a program to turn
ON motor when Push-button is pressed.
RESOURCE REQUIRED: Tinkercad
THEORY:

CODE:

const int buttonPin = 12; const int transistorPin = 7; int buttonState = 0; void setup()
{ pinMode(buttonPin, INPUT_PULLUP); pinMode transistorPin, OUTPUT);
}
void loop()
{ buttonState = digitalRead(buttonPin); if (buttonState == LOW)
{ digitalWrite (transistorPin, HIGH);
}
else
{
digitalWrite (transistorPin, LOW);
}
}

We can control high voltage electronic devices using relays. A Relay is actually a switch which is
electrically operated by an electromagnet.

Working Principle of the Project:

The intention behind the project is to explain how a microcontroller (in this case, an Arduino) can be
used to control a high voltage and high current devices using a relay. When the system is powered on,
the Arduino waits for the button to be pressed (as per the code written). The button terminal is pulled up
internally. Hence, when the button is pushed, the Arduino detects Logic 0 (LOW). This will send a
Logic 1 (HIGH) signal to Pin 7, which is connected to the base of the transistor. As a result, the
transistor is switched ON. As one of the coil terminals of the relay is connected to the collector of the
transistor (which is switched ON), a conduction path between the supply, coil and collector – emitter
terminals of transistor is formed. Because of this, the coil in the relay gets energized and acts as an
electromagnet. As a result, the moving contact of the coil, which was initially in the Normally Closed
(NC) position, will be attracted towards the electromagnet and moves to the Normally Open (NO)
position. This action will complete the motor circuit and hence, the motor starts rotating. The motor
keeps on rotating as long as the button is pushed. Once the button is released, the transistor is switched
OFF and the coil in the relay is de energized. Hence, the contact goes back to the Normally Closed
position and the motor is turned OFF.
Devansh Goyal (20EEAEC012)

CIRCUIT DIAGRAM

OBSERVATIONS:
When pushbutton is pressed, then the motor rotates due to amount of current provided required to turn on
relay by the pushbutton.

RESULT:
Continuous motor operation with a momentary start switch is possible if a normally- open―seal-in‖
contact from the contactor is connected in parallel with the start switch so that once the contactor is
energized it maintains power to itself and keeps itself latched on. Time delay relays are commonly used
in large motor control circuits to prevent the motor from being started (or reversed) until a certain
amount of time has elapsed from an event.
Devansh Goyal (20EEAEC012)

EXPERIMENT-

OBJECTIVE: To Interface DHT11 sensor with Arduino /Raspberry Pi and write a program to print
temperature and humidity readings.

RESOURCE REQUIRED: Arduino IDE, Arduino Uno, jumper wires, breadboard, and DHT sensor.

THEORY: DHT11 sensor is used to measure the temperature and humidity. It has a resistive humidity
sensing component and a negative temperature coefficient (NTC). An 8-bit MCU is also connected in it
which is responsible for its fast response. It is very inexpensive but it gives values of both temperature
and humidity at a time. First of all connect the ground and the VCC of the DHT11 temperature and
humidity sensor to the ground and 5v of the Arduino. Then connect the data pin of the DHT11 sensor to
the pin 2 of the Arduino. To run the following code in Arduino IDE you will first have to install the
DHT library in you Arduino directory.
Download the zip file and place it in your Arduino library folder.
The path to Arduino library folder for my computer is Documents/ Arduino/ Libraries Unzip the
downloaded file and place it in this folder.
After copying the files, the Arduino library folder should have a new folder named DHT containing the
dht.h and dht.cpp. After that copy the following code in the Arduino IDE and upload the code.

ARDUINO CODE:
#include <DHT.h>
#define DHTPIN 6 // The data pin of DHT11/DHT22 should be connected to the digtal pin 9 of Arduino.
#define DHTTYPE DHT22 DHT dht ( DHTPIN, DHTTYPE ) ;
char val; void setup ( ) { // Void setup is the function which technically created at the top of the program.
It is used to initialize variables, pin modes, start using libraries, etc. Serial.begin ( 9600 ) ; dht.begin ( ) ;
} void loop ( ) { // The loop is ran again and again and consists the main code.
float humidity = dht.readHumidity ( ) ; float Temprature = dht.readTemperature ( ) ; if ( isnan (
Temprature ) || isnan ( humidity ) ) { Serial.println ( " Sensor is not avaliable right now " ) ; } else
{
Serial.print ( " Temprature is " ) ; Serial.print ( Temprature ) ; Serial.println ( " *C " ) ; delay(2000);
Serial.print ( " Humidity in % is : " ) ; Serial.print ( humidity ) ;
Serial.print ( " % \t " ) ;
}
Devansh Goyal (20EEAEC012)

Observations: We have interfaced the led with Arduino Uno and observe the simulation result.

RESULT:
We have performed the experiment of DHT11 sensor interfacing with Arduino and verified the correct
result It displays the ambient temperature and humidity readings on serial monitor of Arduino IDE.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy