Humidity Controlled Buzzer Using NodeMCU

About: Work until you no longer have to introduce yourself.

Hello!! I'm back with another tutorial on NodeMCU.

In today's tutorial, I am going to teach how to Interface Buzzer and Humidity sensor. The main application of this mini-project has a huge impact in agriculture to control the humidity level present over the land. If there is any scarcity of water, alarming the guardian through the buzzer.

Now let's start billing the component.

Step 1: Billing of Materials

Components required for the ibles are:

  1. Arduino UNO
  2. DHT11 Humidity Sensor
  3. Buzzer
  4. Jumper Wires
  5. Breadboard

Now let's start to connect the DHT11 humidity sensor to NodeMCU.

Step 2: Connecting DHT11

The humidity sensor consists of three pins

  • Signal pins: This is the signal pin that sends the input to the node telling the temperature and humidity level content of the surrounding.
  • VCC pins: the positive voltage supply pin.
  • GND pins: the negative voltage supply pin.

The connection of the humidity pin is as follow.,

  • Signal pin: this is connected to the digital pin2.
  • VCC pin: this is connected to the breadboard positive rail.
  • GND pin: this is connected to the breadboard negative rail.

Let's now get a connection of the buzzer.

Step 3: Buzzer Connection

The buzzer is an electronic circuit that converts the electrical impulse sent by a microcontroller into sound.

The connection of the buzzer is as follows:

  • Red wire indicates a positive terminal that needs to be connected to the digital pin 4.
  • Black wire is connected to the ground pin of the Node MCU0.

Let's start coding

Step 4: Coding Time

#include "dht.h"

#define DHT11_PIN 2

dht DHT;
int buzzer = 2;

void setup() {

Serial.begin(9600); Serial.println("Start"); PinMode(Buzzer,Output)

}

void loop() { // READ DATA

int chk = DHT.read11(DHT11_PIN); Serial.println(" Humidity " ); Serial.println(DHT.humidity, 1); Serial.println(" Temparature "); Serial.println(DHT.temperature, 1);

if(DHT.humidity < 50%){ PinMode(Buzzer,High); } else{ PinMode(Buzzer,High); }

delay(2000);

}

Share

    Recommendations

    • PCB Contest

      PCB Contest
    • Toys Contest

      Toys Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018

    Discussions