0% found this document useful (0 votes)
18 views33 pages

22BRS1269 Lab Report

This document contains 10 experiments conducted on various sensors as part of a lab course. Each experiment details the aim, materials used, procedure to interface the sensor with Arduino and record readings. The readings are displayed on the serial monitor for various sensors like temperature, ultrasonic distance, humidity, IR obstacle detection and soil moisture.

Uploaded by

yashu1234577
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)
18 views33 pages

22BRS1269 Lab Report

This document contains 10 experiments conducted on various sensors as part of a lab course. Each experiment details the aim, materials used, procedure to interface the sensor with Arduino and record readings. The readings are displayed on the serial monitor for various sensors like temperature, ultrasonic distance, humidity, IR obstacle detection and soil moisture.

Uploaded by

yashu1234577
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/ 33

B Yaswanth 22BRS1269

BCSE303E SENSORS
LAB
EXPERIMENTS
SUBMISSION
FALL SEMESTER (2024)

Submitted to: Dr. Noel Jeygar Robert


B Yaswanth
22BRS1269
Btech, CSE with specialization in AI and Robotics
B Yaswanth 22BRS1269

CONTENTS

S. TITLE OF PAGE
NO EXPERIMENT NO:
1 TEMPERATURE SENSOR 3
2 ULTRASONIC SENSOR 7
3 DHT 11 10
4 IR SENSOR 13
5 SOIL MISTURE SENSOR 16
6 PROXIMITY SENSOR 19
7 PULSE OXIMETER 22
8 INVERTING AMPLIFIER 25
9 NON-INVERTING AMPLIFIER 27
10 SUMMING AMPLIFIER 30
11 DIFFERENTIAL AMPLIFIER 32
B Yaswanth 22BRS1269

EXPERIMENT – 1 TEMPERATURE SENSOR

AIM: To measure the temperature using tmp36 and display it on the serial
monitor.

MATERIALS REQUIRED:
1. Arduino Uno R3

2. TMP 36 Sensor
3. Wires
4. Bread Board

PROCEDURE:
Setup Breadboard: Place the Arduino Uno R3 and the TMP36 sensor on the
breadboard. Connect the components as follows:
Connect the left pin of the TMP36 sensor to the 5V pin on the Arduino Uno.
Connect the middle pin of the TMP36 sensor to the analog pin A0 on the
Arduino Uno.
Connect the right pin of the TMP36 sensor to the GND pin on the Arduino Uno.
Connect to Computer: Connect the Arduino Uno to your computer using a USB
cable.
Open Arduino IDE: Open the Arduino IDE on your computer.
Write the Code: Write the following code in the Arduino IDE:
const int tempPin = A0;

void setup() {
Serial.begin(9600);
}
B Yaswanth 22BRS1269

void loop() {
int sensorValue = analogRead(tempPin);
float voltage = sensorValue * (5.0 / 1023.0);
float temperatureC = (voltage - 0.5) * 100.0;
Serial.print("Temperature: ");
Serial.print(temperatureC);
Serial.println(" °C");
delay(1000);
}
Upload the Code: Upload the code to the Arduino Uno by clicking on the
"Upload" button in the Arduino IDE.
Open Serial Monitor: Once the code is uploaded, open the Serial Monitor in the
Arduino IDE by clicking on "Tools" > "Serial Monitor" or by pressing
Ctrl+Shift+M.
View Temperature Readings: You should now see the temperature readings
displayed in the Serial Monitor. The readings will be updated every second.
B Yaswanth 22BRS1269
B Yaswanth 22BRS1269

RESULT:
The temperature has been detected successfully by the tmp36 sensor.
B Yaswanth 22BRS1269

EXPERIMENT – 2 ULTRASONIC SENSOR

AIM: To measure the distance using a ultrasonic sensor and display it on the
serial monitor.

MATERIALS REQUIRED:
1. Arduino Uno R3
2. HC-SR04 Ultrasonic Sensor
3. Jumper Wires
4. Breadboard

PROCEDURE:
Setup Breadboard: Place the Arduino Uno R3 and the HC-SR04 sensor on the
breadboard. Connect the components as follows:
Connect the VCC pin of the HC-SR04 sensor to the 5V pin on the Arduino Uno.
Connect the GND pin of the HC-SR04 sensor to the GND pin on the Arduino
Uno.
Connect the TRIG pin of the HC-SR04 sensor to digital pin 2 on the Arduino
Uno.
Connect the ECHO pin of the HC-SR04 sensor to digital pin 3 on the Arduino
Uno.
Connect to Computer: Connect the Arduino Uno to your computer using a USB
cable.
Open Arduino IDE: Open the Arduino IDE on your computer.
Write the Code: Write the following code in the Arduino IDE:

const int tempPin = A0;

const int trigPin = 2;


B Yaswanth 22BRS1269

const int echoPin = 3;

void setup() {
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}

void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

long duration = pulseIn(echoPin, HIGH);


float distance = duration * 0.034 / 2;

Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");

delay(100);
}
Upload the Code: Upload the code to the Arduino Uno by clicking on the
"Upload" button in the Arduino IDE.
B Yaswanth 22BRS1269

Open Serial Monitor: Once the code is uploaded, open the Serial Monitor in the
Arduino IDE by clicking on "Tools" > "Serial Monitor" or by pressing
Ctrl+Shift+M.
View Distance Readings: You should now see the distance readings displayed in
the Serial Monitor. The readings will be updated continuously.

RESULT:
The distance has been measured successfully by the ultrasonic sensor.
B Yaswanth 22BRS1269

EXPERIMENT – 3 DHT11 SENSOR

AIM: To measure the temperature using a dht11 sensor and display it on the
serial monitor.

MATERIALS REQUIRED:
1. Arduino Uno R3
2. DHT11 Temperature and Humidity Sensor
3. Jumper Wires
4. Breadboard

PROCEDURE:
Setup Breadboard: Place the Arduino Uno R3 and the DHT11 sensor on the
breadboard. Connect the components as follows:
Connect the positive (VCC) pin of the DHT11 sensor to the 5V pin on the
Arduino Uno.
Connect the negative (GND) pin of the DHT11 sensor to the GND pin on the
Arduino Uno.
Connect the data pin of the DHT11 sensor to digital pin 2 on the Arduino Uno.
Connect to Computer: Connect the Arduino Uno to your computer using a USB
cable.
Install DHT Library: Before writing the code, you need to install the DHT
library. Open the Arduino IDE, go to "Sketch" > "Include Library" > "Manage
Libraries...", then search for "DHT" and install the library named "DHT sensor
library by Adafruit".
Open Arduino IDE: Open the Arduino IDE on your computer.
Write the Code: Write the following code in the Arduino IDE:

#include <DHT.h>

#define DHTPIN 2
B Yaswanth 22BRS1269

#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

void setup() {
Serial.begin(9600);
dht.begin();
}

void loop() {
delay(2000);

float humidity = dht.readHumidity();


float temperatureC = dht.readTemperature();

if (isnan(humidity) || isnan(temperatureC)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

Serial.print("Humidity: ");
Serial.print(humidity);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(temperatureC);
Serial.println(" °C");
}
B Yaswanth 22BRS1269

Upload the Code: Upload the code to the Arduino Uno by clicking on the
"Upload" button in the Arduino IDE.
Open Serial Monitor: Once the code is uploaded, open the Serial Monitor in the
Arduino IDE by clicking on "Tools" > "Serial Monitor" or by pressing
Ctrl+Shift+M.
View Sensor Readings: You should now see the temperature and humidity
readings displayed in the Serial Monitor. The readings will be updated every 2
seconds.

RESULT:

The temperature has been measured successfully by the dht11 sensor.


B Yaswanth 22BRS1269

EXPERIMENT – 4 IR Obstacle Detection

AIM: To detect any obstacle using an IR sensor and display it in serial monitor
MATERIALS REQUIRED:
5. Arduino Uno R3

6. IR Sensor
7. Wires

PROCEDURE:
1. Take the Components Arduino UNO R3, IR sensor and connect
them using wires
2. Use a USB 2.0 Cable Type A and connect the Arduino board to the
Computer
3. Open the Arduino software and write the code given below
4. Make sure the correct COM port is selected by checking with the
device manager
5. Upload the code to Arduino
6. Run and open the Serial Monitor to check Output.

CODE:
B Yaswanth 22BRS1269

int LED = 13; // Onboard LED pin


int irPin = 7; // This is our input pin (IR LED at pin 7)
int sensorOut = HIGH; // HIGH at No Obstacle

void setup() {

pinMode(LED, OUTPUT);

pinMode(irPin, INPUT);

Serial.begin(9600);

void loop() {

sensorOut = digitalRead(irPin);

if (sensorOut == LOW)

Serial.println("What is this Obstacle?");

digitalWrite(LED, HIGH);

}
B Yaswanth 22BRS1269

else

Serial.println("No Obstacle");

digitalWrite(LED, LOW);

delay(200);

OUTPUT:
B Yaswanth 22BRS1269

RESULT:
The Obstacle has been detected successfully by the IR sensor.
B Yaswanth 22BRS1269

EXPERIMENT – 5 Soil Moisture

AIM: To measure moisture of soil using soil moisture sensor and display it in
serial monitor

MATERIALS REQUIRED:
1) Arduino Uno R3
2) Soil Moisture Sensor
3) Wires

PROCEDURE:
1) Take the Components Arduino UNO R3, Soil Moisture Sensor and
connect them using wires
2) Use a USB 2.0 Cable Type A and connect the Arduino board to the
Computer
3) Open the Arduino software and write the code given below
4) Make sure the correct COM port is selected by checking with the
device manager
5) Upload the code to Arduino
6) Run and open the Serial Monitor to check Output.

CODE:
const int moistureSensorPin = A0;

void setup() {
Serial.begin(9600);
}

void loop() {
int moistureValue = analogRead(moistureSensorPin);
int moisturePercentage = map(moistureValue, 0, 1023, 0, 100);
B Yaswanth 22BRS1269

Serial.print("Moisture Level: ");


Serial.print(moisturePercentage);
Serial.println("%");
delay(1000);
}

RESULT:
The Moisture of the soil has been detected successfully by the soil
moisture sensor.
B Yaswanth 22BRS1269

EXPERIMENT – 6 Proximity Position


Measurement

AIM: To measure proximity position using proximity sensor and display it in


serial monitor

MATERIALS REQUIRED:
1. Arduino Uno R3
2. Proximity Sensor
3. Wires

PROCEDURE:
1) Take the Components Arduino UNO R3, Soil Moisture Sensor and
connect them using wires
2) Use a USB 2.0 Cable Type A and connect the Arduino board to the
Computer
3) Open the Arduino software and write the code given below
4) Make sure the correct COM port is selected by checking with the
device manager
5) Upload the code to Arduino
6) Run and open the Serial Monitor to check Output.

CODE:
const int trigPin = 9;
const int echoPin = 10;

void setup() {

Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
B Yaswanth 22BRS1269

void loop() {
long duration;
int distance;

digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);

distance = duration * 0.034 / 2;

Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(1000);
}
B Yaswanth 22BRS1269

RESULT:
The proximity has been detected successfully by the proximity sensor.
B Yaswanth 22BRS1269

EXPERIMENT – 7 Pulse Oximeter

AIM: To measure heart rate using pulse oximeter and display it in serial
monitor

MATERIALS REQUIRED:
1. Arduino Uno R3
2. Pulse Sensor
3. Wires

PROCEDURE:
1) Take the Components Arduino UNO R3, Pulse Oximeter and
connect them using wires
2) Use a USB 2.0 Cable Type A and connect the Arduino board to the
Computer
3) Open the Arduino software and write the code given below
4) Make sure the correct COM port is selected by checking with the
device manager
5) Upload the code to Arduino
6) Run and open the Serial Monitor to check Output.
B Yaswanth 22BRS1269

CODE:

#define USE_ARDUINO_INTERRUPTS true // Set-up low-level interrupts


for most acurate BPM math
#include <PulseSensorPlayground.h> // Includes the PulseSensorPlayground
Library

const int PulseWire = 0; // 'S' Signal pin connected to A0


const int LED13 = 13; // The on-board Arduino LED
int Threshold = 550; // Determine which Signal to "count as a beat" and
which to ignore

PulseSensorPlayground pulseSensor; // Creates an object

void setup() {
Serial.begin(9600);

// Configure the PulseSensor object, by assigning our variables to it


pulseSensor.analogInput(PulseWire);
pulseSensor.blinkOnPulse(LED13); // Blink on-board LED with heartbeat
pulseSensor.setThreshold(Threshold);
// Double-check the "pulseSensor" object was created and began seeing a
signal
if (pulseSensor.begin()) {
Serial.println("PulseSensor object created!");
}
}
void loop() {
B Yaswanth 22BRS1269

int myBPM = pulseSensor.getBeatsPerMinute(); // Calculates BPM

if (pulseSensor.sawStartOfBeat()) { // Constantly test to see if a beat


happened
Serial.println(" A HeartBeat Happened ! "); // If true, print a message
Serial.print("BPM: ");
Serial.println(myBPM); // Print the BPM value
}
delay(20);
}

OUTPUT:

RESULT:
The Heartrate has been detected successfully by the pulse sensor.
B Yaswanth 22BRS1269

EXPERIMENT – 8 Inverting Amplifier

AIM: To build an Inverting Amplifier circuit

MATERIALS REQUIRED:
1. Power Supply
2. Multimeter
3. opAmp
4. Breadboard
5. Wires

CIRCUIT DIAGRAM:

PROCEDURE:
1. Build the circuit as given in the circuit diagram
2. Adjust the voltage value and take the readings
B Yaswanth 22BRS1269

OUTPUT:

RESULT:
Thus an Inverting amplifier has been built and the output has been
verified
B Yaswanth 22BRS1269

EXPERIMENT – 9 Non Inverting Amplifier

AIM: To build a Non Inverting Amplifier amplifier circuit

MATERIALS REQUIRED:
1. Power Supply
2. Multimeter
3. opAmp
4. Breadboard
5. Wires

CIRCUIT DIAGRAM:
B Yaswanth 22BRS1269

PROCEDURE:
1) Build the circuit as given in the circuit diagram
2) Adjust the voltage value and take the readings

OUTPUT:
B Yaswanth 22BRS1269

RESULT:
Thus a Non Inverting amplifier has been built and the output has been
verified
B Yaswanth 22BRS1269

EXPERIMENT – 10 Summing Amplifier

AIM: To build a Summing amplifier circuit

MATERIALS REQUIRED:
1. Power Supply
2. Multimeter
3. OpAmp
4. Breadboard
5. Wires

CIRCUIT DIAGRAM:

PROCEDURE:
1. Build the circuit as given in the circuit diagram
2. Adjust the voltage value and take the readings
B Yaswanth 22BRS1269

OUTPUT:

RESULT:
Thus a Summing amplifier has been built and the output has been
verified
B Yaswanth 22BRS1269

EXPERIMENT – 11 Differential Amplifier

AIM: To build a differential amplifier circuit

MATERIALS REQUIRED:
1. Power Supply
2. Multimeter
3. Dual Timer
4. Breadboard
5. Wires

CIRCUIT DIAGRAM:

PROCEDURE:
1. Build the circuit as given in the circuit diagram
2. Adjust the voltage value and take the readings
B Yaswanth 22BRS1269

OUTPUT:

RESULT:
Thus a differential amplifier has been built and the output has been
verified

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