Potentiometer Controlled Water Pump Using Arduino

by devkrishnavhora in Circuits > Arduino

33 Views, 0 Favorites, 0 Comments

Potentiometer Controlled Water Pump Using Arduino

This project controls the speed of a pump using a potentiometer and Arduino.

The potentiometer provides a variable analog input to the Arduino. The Arduino reads the potentiometer value and converts it into a PWM value. This PWM signal is used to control the speed of the pump through a motor driver.

By rotating the potentiometer, the user can increase or decrease the pump speed.

Supplies

Deshbot shield

Arduino Uno

DC Water Pump

Motor Driver

Potentiometer

Pin Connections


Pump Motor Driver

Motor DriverArduino Uno

Pump A / IN1 - D6

Pump B / IN2 - D7

GND - GND

Potentiometer

PotentiometerArduino Uno

Middle Pin - A0

One Outer Pin - 5V

Other Outer Pin - GND

Working Principle


The potentiometer produces an analog voltage between 0V and 5V.

The Arduino reads this voltage using analog pin A0.

The analogRead() function produces a value between:

0 → 1023

This value is converted into a PWM range:

0 → 255

using the map() function.

The PWM value is then applied to D6, which controls the pump speed through the motor driver.

Control

Potentiometer turned minimum
↓
PWM = 0
↓
Pump OFF

Potentiometer turned higher
↓
PWM increases
↓
Pump speed increases

Program Flow

START
↓
Set pump pins as OUTPUT
↓
Pump initially OFF
↓
Read potentiometer
↓
Read value 0–1023
↓
Convert to PWM 0–255
↓
Send PWM to pump driver
↓
Repeat continuously

Programming Concepts Used

analogRead()

Reads the analog value from the potentiometer.

int potValue = analogRead(POT_PIN);

The result ranges from 0 to 1023.

map()

Converts the potentiometer reading into a PWM value.

int pumpSpeed = map(potValue, 0, 1023, 0, 255);

analogWrite()

Outputs the PWM signal used to control the pump.

analogWrite(PUMP_A, pumpSpeed);

Motor Direction

The second motor-driver input is kept LOW:

digitalWrite(PUMP_B, LOW);

This makes the pump operate in one direction.

Features

  1. Potentiometer-based pump control
  2. Variable pump speed
  3. PWM speed control
  4. Simple Arduino program
  5. Continuous speed adjustment
  6. Motor driver controlled operation


Conclusion


The Potentiometer Controlled Pump project demonstrates how an Arduino can read an analog input and use PWM to control a DC pump.

By rotating the potentiometer, the user can continuously adjust the pump's speed. This project introduces important Arduino concepts such as analog input, PWM, map(), and motor-driver control.