0% found this document useful (0 votes)
1 views

Arduino Based Practicals DHT11_Bluetooth_RFID

The document outlines three experiments involving Arduino: interfacing a DHT11 temperature and humidity sensor, an HC-05 Bluetooth module for LED control, and an EM18 RFID module. Each experiment includes objectives, theory, procedures, and sample code for implementation. The results confirm successful interfacing and functionality of the components with Arduino.

Uploaded by

Komal Pokale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Arduino Based Practicals DHT11_Bluetooth_RFID

The document outlines three experiments involving Arduino: interfacing a DHT11 temperature and humidity sensor, an HC-05 Bluetooth module for LED control, and an EM18 RFID module. Each experiment includes objectives, theory, procedures, and sample code for implementation. The results confirm successful interfacing and functionality of the components with Arduino.

Uploaded by

Komal Pokale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Experiment – 1

Title: Temperature and humidity sensing using Arduino.

Aim:: To study and understand Interfacing Temperature and humidity sensor (DHT11) to Arduino.

Objectives:

 To understand the working principle of DHT11 sensor.


 To study interfacing of DHT11 sensor to Arduino.
 To study Arduino IDE software.

Software Used: Arduino IDE

Circuit Diagram:

Theory:

 The DHT11 sensor is a temperature and humidity sensor having 4 pin single row pin package,
single wire serial interface with a calibrated digital signal output.
 It ensures high
igh reliability, long term stability, excellent quality, fast response, cost effectiveness.
 The single wire serial interface makes system integration quick and easy.
 Its small size and low power consumption.
 It has humidity measurement range of 20% to 90% RH and temperature measurement range from 0
to 50 Celsius.

Key features of the DHT11 sensor:

1) Measures both temperature and humidity: Provides readings for both relative humidity and
temperature
re simultaneously.
2) Digital output: Outputs data in a digital format, simplifying data acquisition for microcontrollers.
3) Low cost: Considered a very affordable sensor option.
4) Simple to use: Requires only one data pin for communication with a microcontroller.
5) Low power consumption: Operates with minimal power draw.
6) Compact size: Small form factor suitable for compact projects.
7) Operating voltage: Typically operates on 3.3V to 5V power supply
supply.
Technical specifications:

1) Humidity range: 20% - 90% RH


2) Temperature range: 0°C - 50°C
3) Humidity accuracy: ±5% RH
4) Temperature accuracy: ±2°C

Procedure:

 Connect 5V DC power adaptor to Arduino Target board.


 Start Arduino IDE and follow the steps mention in the “Steps to use of Arduino IDE software”.
 Set the Mode_Sel slide switch in the “Arduino section” on “Pgm” mode.
 Install “dht” library (if not available) in to the Arduino IDE.
 Compile the written program, if there are no errors connect the PC with Arduino Nano Board
available on the Arduino Target board; by using USB to mini USB cable.
 Upload the program in to Arduino Nano board and don’t remove the USB to mini USB cable from
board (because we will observe the output on serial monitor of Arduino IDE).
 Make necessary connections to connect o/p pin from DHT11 section to D3 digital pin in the
Arduino section.
 Set the Mode_Sel slide switch in the “Arduino section” on “Run” mode.
 Observe the output on serial monitor of Arduino IDE.
Program:

#include<dht.h> //This includes the dht.h library, which provides functions to interface with
the DHT11 sensor.

dht DHT; //Creates an instance of the dht class called DHT. This instance will be used
to read temperature and humidity data from the sensor.

#define DHT11_PIN 3 //Defines pin 3 as the data pin for the DHT11 sensor.

void setup() //The setup() function runs once when the microcontroller starts.

Serial.begin(9600); //Initializes serial communication at 9600 baud rate

void loop() //The loop() function runs continuously.

int chk = DHT.read11(DHT11_PIN); //Reads temperature and humidity data from the
DHT11 sensor connected to DHT11_PIN (pin 3).

Serial.println("Humidity");

Serial.println(DHT.humidity, 1); // Print humidity with 1 decimal place

Serial.println("Temperature");

Serial.println(DHT.temperature, 1); // Print temperature with 1 decimal place

delay(5000); //Wait for 5 seconds before reading again

Result: Interfacing of Temperature and humidity sensor (DHT11) with Arduino is successfully studied, tested
and observe the output.

Questions:-
Experiment – 2

Title: To study Arduino based LED switching using mobile.

Aim:: To study Arduino based LED switching using mobile.

Objectives:

 To understand the working principle of HC05 Bluetooth module.


 To study interfacing of Bluetooth module to Arduino.
 To study Arduino IDE software.

Software Used: Arduino IDE

Circuit Diagram:

Theory:

 Bluetooth is a wireless technology standard used for exchanging data between fixed and mobile devices
over short distances using short-wavelength
wavelength UHF radio waves in the industrial, scientific and medical
radio bands, from 2.402 GHz to 2.480 GHz, and building personal area network
networks (PANs).
 It was originally conceived as a wireless alternative to RS
RS-232 data cables.
 The IEEE standardized Bluetooth as IEEE 802.15.1.
 Bluetooth is a one of the great example for wireless connectivity.
 It is used in many fields.
 Bluetooth consumes very small amount of energy
energy.
 Here we are going to interface a Bluetooth Module (HC (HC-05) with Arduino.
 HC-05 05 is a Bluetooth module which can communicate in two ways. Which means, It is full-duplex.
full It
operates on Serial Port
ort Protocol (SSP).
 The module communicates with the help of USART (Universal Synchronous/Asynchronous Receiver
/Transmitter) at the baud rate of 9600, and it also supports other baud rate.
 The HC05 can operate in two modes.
 One is Data mode and other is AT command mode.
 When the enable pin is "LOW" the HC HC-05
05 is in Data Mode. If that pin set as "HIGH" the module is in
AT command mode.
 Here we operate this module in Data Mode.
Technical Specifications -

 Operating Voltage: 4V to 6V (Typically +5V)


 Operating Current: 30mA
 Range: <100m
 Works with Serial communication (USART) and TTL compatible.
 Can be easily interfaced with Laptop or Mobile phones with Bluetooth.

Procedure:
1) Connect 5V DC power adaptor to Arduino Target board.
2) Set the Mode_Sel slide switch in the “Arduino section” on “Pgm” mode.
3) Compile the written program, if there are no errors connect the PC with Arduino Nano Board available
on the Arduino Target board; by using USB to mini USB cable.
4) Upload the program in to Arduino Nano board and remove the USB to mini USB cable from board.
5) Insert Bluetooth HC05 module to the HC05 connector in the Bluetooth section.
6) Make necessary connections as shown in the above circuit diagram.
7) Set the Mode_Sel slide switch in the “Arduino section” on “Run” mode.
8) Enter the commands in to the Bluetooth Terminal HC05 Mobile app. to make LED on / off, and
observe the output.

Flowchart:
Program: -

char inputbyte; // Declares a character variable (inputbyte) to store the incoming serial
data.
int led = 2; // Declares an integer variable led and assigns it the value 2, meaning
the LED
is connected to pin 2 of the Arduino board.

void setup() // The setup() function runs once when the microcontroller starts.

{
Serial.begin(9600); // Initializes serial communication at 9600 baud rate
pinMode(led, OUTPUT); // Configures pin 2 as an output, so it can control an LED

}
void loop() // The loop() function runs continuously.
{
while(Serial.available()>0) // Checks if there is data available in the serial buffer.
{
inputbyte=Serial.read(); // Reads one character from the serial buffer and stores it in inputbyte.

if (inputbyte=='1')
{
digitalWrite(led, LOW); // If the received character is '1', it turns the LED OFF by setting
digitalWrite(led, LOW);
}
else if (inputbyte=='2')
{
digitalWrite(led,HIGH); // If the received character is '2', it turns the LED ON by setting
digitalWrite(led, HIGH);

}
}
}

Applications of Bluetooth: (Student can search & write application here)

Exercises:

a. Repeat the same experiment to control two devices.


b. Repeat the same experiment with HEX commands.

Result: Interfacing of Bluetooth with Arduino is successfully studied, tested and observe the output.

Questions:-
Experiment – 3

Title: Study of RFID system

Aim:: To study EM18 RFID module interfacing to Arduino.

Objectives:

 To understand the working principle of RFID module.


 To study interfacing of EM18 RFID module to Arduino.
 To study Arduino IDE software.

Software Used: Arduino IDE

Circuit Diagram:

Theory:

 The EM-1818 RFID Reader module operating at 125kHz is an inexpensive solution for your RFID based
application.
 The Reader module comes with an onon-chip
chip antenna and can be powered up with a 5V power supply.
 Power-up
up the module and connect the transmit pin of the module to receive pin of your
microcontroller.
 Show your card within the reading distance and the card number is thrown at the output.

Features:

1) Operating Frequency: 125 kHz (Low-frequency RFID).


2) Reading Range: 5 cm to 10 cm
cm,, depending on the tag type and environment.
3) Communication Interface:
 UART (Serial - TTL 9600 baud rate, 8N1)
 Wiegand26 (Optional)
4) Operating Voltage: +5V DC (regulated power supply).
5) Current Consumption: 50mA (approximate)
6) Output Format:
 12-digit unique ID from RFID tags.
 Sent as ASCII characters via serial communication.
7) Antenna: Inbuilt antenna for RFID tag detection.
8) Compact Size: Small form factor, easy to integrate into projects.
9) LED and Buzzer Indication:
 LED blinks and buzzer sounds when an RFID tag is scanned.
10) Supported RFID Tags: Works with EM4100-compatible passive RFID cards and
tags.

Procedure:

1) Connect 12V DC power adaptor to the Arduino Target board


2) Set the Mode_Sel slide switch in the “Arduino section” on “Pgm” mode.
3) Compile the written program, if there are no errors connect the PC with Arduino Nano Board available
on the Arduino Target board; by using USB to mini USB cable.
4) Upload the program in to Arduino Nano board and don’t remove the USB to mini USB cable from
board (because we will observe the output on serial monitor of Arduino IDE).
5) Make necessary connections as shown in the above circuit diagram.
6) Set the Mode_Sel slide switch in the “Arduino section” on “Run” mode.
7) Observe the output.
Program:-

char input[12]; // Declares a character array input of size 12. This array will store up to 12
characters received from the serial input.

int count = 0; // Declares an integer variable count, initialized to 0.

void setup() //

Serial.begin(9600); //

void loop() //

if(Serial.available()) // Checks if there is any data available in the serial buffer.

count=0; // Resets the count variable to 0 before reading new data.

while(Serial.available()&&count<12) // data available in the serial buffer (Serial.available() is greater


than 0) & count is less than 12

{
input[count]=Serial.read(); // Reads one character from the serial buffer and stores it in input[count].

count++; // Increments the count, moving to the next position in the array.

delay(5); // Waits for 5 milliseconds to allow for the next character to arrive.

for(int i=0; i<12; i++)

Serial.print(input[i]); // Prints each character stored in the input array using Serial.print()

Serial.println(); // Prints a newline, ensuring that each input batch appears on a new line in
the Serial Monitor.
}

}
Applications of RFID: (Student can search & write application here)

Result: Interfacing of EM18 RFID module with Arduino is successfully studied, tested and observe the
output.

Questions:-

You might also like