Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

Introduction to Sensor Modules

Importance and Utility of Sensor Modules Sensor modules are essential components in electronic systems as they allow for the detection and measurement of physical quantities. These modules enable the monitoring of various parameters such as temperature, humidity, light intensity, distance, and many others. By incorporating sensor modules into projects, engineers can create smart systems that respond to their environment, enhancing automation and improving efficiency.

Project: Creating a Temperature and Humidity Monitoring System In this project, we will create a temperature and humidity monitoring system using an Arduino board and a DHT11 sensor module. The objective is to read the temperature and humidity values from the sensor and display them on a serial monitor. This system can be used in various applications such as greenhouse monitoring, HVAC systems, and weather stations.

List of Components:

  • Arduino Uno board x1
  • DHT11 sensor module x1
  • Breadboard x1
  • Jumper wires x5

You can purchase the Arduino Uno board and DHT11 sensor module from the following links:

  • Arduino Uno: [link]
  • DHT11 sensor module: [link]

Example Code:

#include <DHT.h>

#define DHTPIN 2
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

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

void loop() {
  delay(2000);
  float temperature = dht.readTemperature();
  float humidity = dht.readHumidity();

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.print(" °C\tHumidity: ");
  Serial.print(humidity);
  Serial.println(" %");
}

Explanation:

  • We include the DHT library to interface with the DHT11 sensor module.
  • We define the pin to which the sensor module is connected (DHTPIN) and the sensor type (DHTTYPE).
  • In the setup function, we initialize the serial communication and the DHT sensor.
  • In the loop function, we read the temperature and humidity values from the sensor.
  • We print the temperature and humidity values to the serial monitor.

This code demonstrates how to read temperature and humidity values from the DHT11 sensor module and display them on the serial monitor.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.