0% found this document useful (0 votes)
9 views3 pages

Exp#2

Uploaded by

theskylover88
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)
9 views3 pages

Exp#2

Uploaded by

theskylover88
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/ 3

Experiment No.

2: Reading Temperature from DS18B20 Sensor


Objective
The objective of this experiment is to measure the temperature using a DS18B20 sensor
connected to an ESP32 and display the temperature on the serial monitor using Arduino IDE.

Materials Required
■ ESP32 development board
■ DS18B20 temperature sensor
■ 4.7kΩ resistor (for pull-up between Data and VCC)
■ USB cable for ESP32
■ Breadboard
■ Jumper wires
■ Computer with Arduino IDE installed.
■ Install DallasTemperature and OneWire libraries.

Procedure
1. Setup Arduino IDE for ESP32.
2. Connect ESP32 to Computer.
3. Circuit Setup.

DS18B20 Connections Circuit Diagram

The DS18B20 has three pins:

VCC, GND, and Data.

 VCC: Connect to 3.3V of ESP32.

 GND: Connect to GND of ESP32.

 Data: Connect to GPIO pin 4 of ESP32.

 Pull-up Resistor (4.7kΩ): Connect

between the Data pin and VCC (3.3V).

4. Write the code and upload:


5. Observe the Output:
• After uploading the code, open the Serial Monitor (Ctrl + Shift + M) in the Arduino
IDE.
• Set the baud rate to 115200.
• Observe the temperature readings from the DS18B20 sensor printed on the
Serial Monitor and take screenshot of it.
6. Code Output:
Paste the output of your serial monitor.
Conclusion
In this experiment, we successfully interfaced a DS18B20 temperature sensor with an ESP32
development board. The sensor's data was processed and displayed on the Serial Monitor using
the Arduino IDE. This setup can be used for monitoring temperature in various applications, such
as home automation or weather stations.

Rubrics
Needs Improvement
Criteria Excellent (2) Good (1)
(0)

Assembled the circuit with


Circuit Assembled the circuit Did not assemble the
minor errors that were
Assembly correctly with no errors. circuit correctly.
corrected.

Wrote the code correctly Wrote the code with minor


Did not write the
Code Writing with no syntax errors syntax errors or missing
code correctly.
and proper comments. comments.

Uploaded the code Uploaded the code


Did not upload the
Code Uploading successfully on the first successfully after minor
code successfully.
attempt. troubleshooting.

The DS18B20 sensor The DS18B20 sensor read The DS18B20 sensor
successfully read and temperature values, but with did not read or
displayed temperature minor issues such as display temperature
values on the Serial inaccurate or inconsistent values correctly, or
Functionality Monitor as expected, readings or slight delays in no output was
with accurate and updating values. generated on the
consistent readings. Serial Monitor,
indicating a failure in
functionality.

You might also like