Node:Humidity Controlled Buzzer

About: I am an electronic hobbyist on Arduino, Photon, Raspberry Pi and common electronics.A passionate cook.Any assistance in electronics and web development feel free to contact me at appytechie.at@gmail.com.

Hello!!I'm Sridhar Janardhan back with another tutorial on NodeMCU.In today's tutorial, I am going to teach how to interface Servo motor and humidity sensor.This can find its application 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: Components Required:

Components required for the ibles are:

  • Arduino Uno
  • Servo Motor
  • DHT11 humidity sensor
  • breadboard
  • Jumper wires

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

Step 2: Interfacing DHT11 Humidity Sensor

The humidity sensor is a specially designed circuit that indicates the level of the humidity around its surrounding.Here I am using DHT sensor as a humidity sensor.

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 pin of Arduino 2.
  • VCC pin: this is connected to the breadboard positive railing.
  • GND pin: this is connected to the breadboard negative railing.

Let's now get connection of the buzzer

Step 3: Buzzer Connection

The buzzer is an electronic circuit that converts the electrical impulse sent by any micro controller 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.
  • The black wire is connected to the ground pin of the Node MCU.

Let's start coding

Step 4: Coding

#include "dht.h"

dht DHT; // if you require to change the pin number, Edit the pin with your arduino pin.

#define DHT11_PIN 2

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); }

Step 5: Output

The output of the sensor will determine the activity of the buzzer.Open the serial console and if the humidity reaches below 50%, Buzzer sends a sound signal.

Share

    Recommendations

    • DIY Summer Camp Contest

      DIY Summer Camp Contest
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest
    • Games Contest

      Games Contest

    Discussions