Water Flow Control Using DHT 11
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
Arduino Uno
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.
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
General Specifications
Mechanical Specifications
Technical Specifications
General Specifications
Electrical specifications
#include <DHT.h>
#define DHTTYPE DHT11 // Define the type of DHT sensor used
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
// 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;
}
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.