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

How to Create a Monitoring System with Arduino

Monitoring systems are essential for various applications, from environmental monitoring to industrial automation. With Arduino, you can create a customizable and cost-effective monitoring system. This article will guide you through the process of setting up a basic monitoring system using Arduino.

Examples:

Example 1: Temperature and Humidity Monitoring

In this example, we will use a DHT11 sensor to monitor temperature and humidity levels. The data will be displayed on the Serial Monitor.

Components Needed:

  • Arduino Uno
  • DHT11 Sensor
  • Breadboard
  • Jumper wires

Step-by-Step Instructions:

  1. Wiring the Components:

    • Connect the VCC pin of the DHT11 sensor to the 5V pin on the Arduino.
    • Connect the GND pin of the DHT11 sensor to the GND pin on the Arduino.
    • Connect the DATA pin of the DHT11 sensor to digital pin 2 on the Arduino.
  2. Installing the DHT Library:

    • Open the Arduino IDE.
    • Go to Sketch -> Include Library -> Manage Libraries...
    • Search for DHT sensor library and install it.
  3. Writing the Code:

    #include "DHT.h"
    
    #define DHTPIN 2     // Digital pin connected to the DHT sensor
    #define DHTTYPE DHT11   // DHT 11
    
    DHT dht(DHTPIN, DHTTYPE);
    
    void setup() {
     Serial.begin(9600);
     dht.begin();
    }
    
    void loop() {
     delay(2000); // Wait a few seconds between measurements
    
     float h = dht.readHumidity();
     float t = dht.readTemperature();
    
     if (isnan(h) || isnan(t)) {
       Serial.println("Failed to read from DHT sensor!");
       return;
     }
    
     Serial.print("Humidity: ");
     Serial.print(h);
     Serial.print(" %\t");
     Serial.print("Temperature: ");
     Serial.print(t);
     Serial.println(" *C");
    }
  4. Uploading the Code:

    • Connect your Arduino to your computer via USB.
    • Select the correct board and port from the Tools menu.
    • Click the upload button.
  5. Viewing the Data:

    • Open the Serial Monitor from the Tools menu.
    • Set the baud rate to 9600.
    • You should see the temperature and humidity readings displayed.

Example 2: Light Intensity Monitoring

In this example, we will use an LDR (Light Dependent Resistor) to monitor light intensity. The data will be displayed on the Serial Monitor.

Components Needed:

  • Arduino Uno
  • LDR
  • 10kΩ Resistor
  • Breadboard
  • Jumper wires

Step-by-Step Instructions:

  1. Wiring the Components:

    • Connect one end of the LDR to the 5V pin on the Arduino.
    • Connect the other end of the LDR to analog pin A0 on the Arduino.
    • Connect one end of the 10kΩ resistor to the GND pin on the Arduino.
    • Connect the other end of the 10kΩ resistor to the junction between the LDR and A0.
  2. Writing the Code:

    void setup() {
     Serial.begin(9600);
    }
    
    void loop() {
     int lightLevel = analogRead(A0);
     Serial.print("Light Intensity: ");
     Serial.println(lightLevel);
     delay(1000);
    }
  3. Uploading the Code:

    • Connect your Arduino to your computer via USB.
    • Select the correct board and port from the Tools menu.
    • Click the upload button.
  4. Viewing the Data:

    • Open the Serial Monitor from the Tools menu.
    • Set the baud rate to 9600.
    • You should see the light intensity readings displayed.

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.