0% found this document useful (0 votes)
44 views13 pages

Interfacing Temperature Sensor

The document discusses interfacing a temperature sensor using a Node MCU board. It describes the components needed, including a DHT11/DHT22 sensor and Node MCU board. It provides instructions on connecting the sensor to the board and writing an Arduino program to read and output the temperature and humidity readings.

Uploaded by

krishchitraveni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views13 pages

Interfacing Temperature Sensor

The document discusses interfacing a temperature sensor using a Node MCU board. It describes the components needed, including a DHT11/DHT22 sensor and Node MCU board. It provides instructions on connecting the sensor to the board and writing an Arduino program to read and output the temperature and humidity readings.

Uploaded by

krishchitraveni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

INTERFACING TEMPERATURE SENSOR USING

NODE MCU

• AIM : To study about interfacing temperature sensor using node mcu.


• Components Required : DHT11/DHT22 sensor
Node mcu Board
Jumper wires
USB cable

• Software Used : Arduino IDE


THEORY
• DHT11 is a low cost digital sensor for sensing temperature and humidity .
• DHT11 sensor consists of a capacitive humidity sensing element and a
thermistor for the purpose of sensing temperature.
• It has two electrodes with a moisture holding substrate as a dielectric
between them.
• Change in the capacitance value occurs with the change in humidity levels.
HARDWARE PROCEDURE
• Connect VCC pin of DHT11 sensor to 3.3v input pin of node mcu board.
• Connect Data out pin to any GPIO pin in the board.
• Connect Ground pin to the ground in the board.
• Connect USB connector to node mcu to monitor.
SOFTWARE PROCEDURE
• Open Arduino IDE software.
• Click on file , go to New.
• Write a program as per circuit pin connections.
• Go to sketch select include library and go to manage library.
• Install some libraries which are used in the program .
• Go to tools and select type of board.
• Now go to port and select other board and port.
• Now click on save and verify the program.
• Click on upload and dump the code into node mcu using USB cable.
• Observe the output in the serial monitor.

PROGRAM :
#include "DHT.h"
#define DPIN 4 //Pin to connect DHT sensor (GPIO number) D2
#define DTYPE DHT11 // Define DHT 11 or DHT22 sensor type
DHT dht(DPIN,DTYPE);
void setup() {
Serial.begin(9600);
dht.begin();
}
void loop() {
delay(2000);
float tc = dht.readTemperature(false); //Read temperature in C
float tf = dht.readTemperature(true); //Read Temperature in F
float hu = dht.readHumidity(); //Read Humidity
Serial.print("Temp: ");
Serial.print(tc);
Serial.print(" C, ");
Serial.print(tf);
Serial.print(" F, Hum: ");
Serial.print(hu);
Serial.println("%");
}
OUTPUT :

RESULT : Thus , study about interfacing temperature sensor using


node mcu board is completed and verified successfully.

You might also like