0% found this document useful (0 votes)
25 views13 pages

Water Flow Control Using DHT 11

Uploaded by

raguleswaran001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views13 pages

Water Flow Control Using DHT 11

Uploaded by

raguleswaran001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

WATER FLOW CONTROL USING DHT 11

ITEMS NEEDED

 Arduino UNO R3
 Submersible pump
 DHT11
 USB Cable
 Breadboard
 Computer with Arduino IDE software installed
 Wire

SCOPE

In this project, we will be using an Arduino Uno microcontroller to control the


activation and deactivation of a water pump via a relay module based on temperature and
humidity readings from a DHT11 sensor. When the temperature and/or humidity exceed a
certain threshold, the Arduino will activate the water pump to regulate the environment and
deactivate automatically when conditions are met. This project is useful for use cases such
as automating the watering of plants or regulating the humidity levels in a room or
greenhouse.
COMPONENTS DESCRIPTION

Arduino Uno

The Arduino Uno is a popular microcontroller board based on the ATmega328P. It


features 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog
inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a
reset button. The board operates at 5V, and its digital pins can be used for various
purposes, including reading sensors, controlling motors, and communicating with other
devices. The analog pins can read varying voltages from sensors like potentiometer. The
Uno can be powered via USB or an external power supply, making it versatile for a wide
range of projects.
Pin Details

 Digital I/O: Pins 2-13


 PWM Output: Pins 3, 5, 6, 9, 10, 11
 Analog Input: Pins A0-A5
 UART: Pins 0 (RX), 1 (TX)
 I2C: Pins A4 (SDA), A5 (SCL)
 SPI: Pins 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK)
 Power: VIN, 3.3V, 5V, GND
 Other: AREF, Reset

Digital Pins (0-13)

 Pins 0 (RX) and 1 (TX): Used for serial communication (receive and transmit).
 Pins 2-13: General-purpose digital I/O pins. Pins 3, 5, 6, 9, 10, and 11 can also be
used for PWM (Pulse Width Modulation) output.

Analog Pins (A0-A5)

 Pins A0-A5: Can read analog inputs (0-1023) from sensors and other devices. Each
pin can also be used as a digital I/O pin.

Power Pins

 VIN: Input voltage to the Arduino board when using an external power source (7-
12V).
 5V: Regulated 5V output from the board.
 3.3V: 3.3V output generated by the on-board regulator.
 GND: Ground pins.

Additional Pins

 AREF: Reference voltage for the analog inputs.


 Reset: Resets the microcontroller when connected to ground.

Special Function Pins


 ICSP (In-Circuit Serial Programming) Header: Used to program the firmware on
the ATmega328P.
 SCL (A5): Serial clock line for I2C communication.
 SDA (A4): Serial data line for I2C communication.
Submersible pump
A submersible pump is a type of pump that is designed to operate while fully
submerged in the fluid it is intended to pump. These pumps are widely used in various
applications, including water wells, sewage systems, and industrial fluid handling. Here is
an in-depth technical description of a submersible pump, covering its components, working
principles, and typical applications.

General Specifications

 Pump Type: Submersible


 Application: Clean water, wastewater, sewage, or slurry
 Construction Material: Stainless steel, cast iron, or thermoplastic
 Operating Temperature Range: -10°C to 50°C (14°F to 122°F), may vary by model

Mechanical Specifications

 Impeller Type: Vortex, semi-open, open, or multi-stage (for high pressure)


 Impeller Material: Stainless steel, brass, or thermoplastic
 Shaft Material: Stainless steel
 Seal Type: Mechanical seal, often made from materials such as silicon carbide or
carbon-ceramic
 Bearings: Sealed ball bearings
Electrical Specifications

 Motor Type: Single-phase or three-phase induction motor


 Voltage:
o Single-phase: 110V-240V AC
o Three-phase: 380V-415V AC
 Frequency: 50Hz or 60Hz
 Power Rating: 0.5 HP to 50 HP (horsepower), depending on the application
 Current Rating: Varies based on power and voltage, typically 5A to 50A
 Insulation Class: Class B, F, or H
 Protection Class: IP68 (completely dust-tight and can be submerged in water
beyond 1 meter.
DHT 11
The DHT11 is a basic, low-cost digital sensor designed to measure temperature and
humidity. This sensor is widely used in various applications due to its simplicity and
affordability. It features a capacitive humidity sensor and a thermistor to measure the
surrounding air, providing digital output on the data pin.

Components and Pin Configuration

The DHT11 sensor typically comes in a 4-pin package:

1. VCC: Power supply pin (3.3V to 5.5V)


2. DATA: Data output pin
3. NC: Not connected
4. GND: Ground pin

Technical Specifications

General Specifications

 Power Supply: 3.3V to 5.5V DC


 Current Consumption: 0.3 mA (measuring) to 60 µA (standby)
 Humidity Range: 20% to 90% RH (relative humidity)
 Temperature Range: 0°C to 50°C (32°F to 122°F)
 Humidity Accuracy: ±5% RH
 Temperature Accuracy: ±2°C
 Sampling Rate: 1 Hz (once every second)
 Dimensions: 15.5mm x 12mm x 5.5mm (L x W x H)
 Weight: 2.4g

Electrical specifications

 Interface: Single-wire digital interface


 Output: 1-wire digital output
 Resolution: Humidity: 1% RH, Temperature: 1°
CIRCUIT DIAGRAM
CODE

#include <DHT.h>
#define DHTTYPE DHT11 // Define the type of DHT sensor used

const int DHTPin = 2; // Pin where the DHT sensor is connected


const int pumpPin = 10; // Pin where the pump is connected

DHT dht(DHTPin, DHTTYPE);

const float temperatureThreshold = 15.0; // Temperature threshold in degrees


Celsius
const float humidityThreshold = 65.0; // Humidity threshold in percentage

unsigned long measurementDelay = 2000; // Measurement delay in


milliseconds
unsigned long lastMeasurementTime = 0; // Variable to store the last
measurement time

void setup() {
pinMode(pumpPin, OUTPUT); // Set the pump pin as output
Serial.begin(9600); // Initialize serial communication
dht.begin(); // Initialize the DHT sensor
}

void loop() {
unsigned long currentTime = millis(); // Get the current time
// Check if it's time to take a new measurement
if (currentTime - lastMeasurementTime >= measurementDelay) {
lastMeasurementTime = currentTime; // Update the last measurement time

// Read the temperature and humidity from the DHT sensor


float temperature = dht.readTemperature();
float humidity = dht.readHumidity();

// Check if any reading failed and exit early (to try again)
if (isnan(temperature) || isnan(humidity)) {
Serial.println("Failed to read from DHT sensor!");
return;
}

// Print the temperature and humidity to the Serial Monitor


Serial.print("Temperature: ");
Serial.print(temperature);
Serial.print(" °C ");
Serial.print("Humidity: ");
Serial.print(humidity);
Serial.println(" %");

// Check if the pump needs to be turned on


if (temperature > temperatureThreshold || humidity < humidityThreshold) {
digitalWrite(pumpPin, HIGH); // Turn the pump on
Serial.print("Pump ON - ");
if (temperature > temperatureThreshold) {
Serial.print("Temperature is too high!");
}
if (humidity < humidityThreshold) {
Serial.print("Humidity is too low!");
}
Serial.println();
} else {
digitalWrite(pumpPin, LOW); // Turn the pump off
Serial.println("Pump OFF");
}
}
}

OUTPUT
RESULT
Thus the control of the water pump has been done using an Arduino controller with
the presence of a DHT11 temperature and humidity sensor. The code, circuit diagram, and
output are attached for reference.

You might also like