Introduction: Humidity Controlled Buzzer

Picture of Humidity Controlled Buzzer

Hello!! I'm 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: Billing of Materials

Picture of Billing of Materials

Step 2: Connecting DHT11

Picture of Connecting DHT11

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

Picture of 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

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

Comments

About This Instructable

439views

12favorites

License:

Bio: IoT Related Projects
More by tinkerproject:Tasty Biscuit LaddooSpicy Corn CurryPhulka - Fluffy Roti Breads
Add instructable to: