Arduino Controlled Pump for Draining Water




Introduction: Arduino Controlled Pump for Draining Water

About: Arduino is a newly discovered hobby of mine. I love making stuff.

The idea of this project came out when I bought a condensing gas boiler for my apartment. I don't have any drain close by for the condensed water the boiler produces. So the water is collected in a 20 liter tank (drum) for few days and when it gets filled up, i have to discharge it manually. So I decided to make an Arduino controlled pump which will discharge the water with only one push of the button. A display shows the status of the pump. I've added two level sensors to stop the pump if the drain is either overflowing or the level is dropping inside the collecting tank. This is important for the well functioning of the pump, in order to always be submerged.

Step 1: Parts Used for the Project

For this project I've used:
- Arduino uno board for testing (Arduino nano for final project)

- 12V submersible water pump

- a protoboard

- a relay module

- a 10k potentiometer

- 4 NPN transistors

- a buzzer

- jumper wires

- different resistors

- a push button

- a switch

Step 2: Last But Not Least

I've attached Arduino's source code.

This is my first Arduino project. I'm satisfied I've managed to make it work and actually save time by using this pump. I will work on its appearance though and to perfect it a bit more. I'm opened for suggestions.

Step 3: Creating the Water Level Sensors

This project has two water level sensors. One will stop the pump if the water level drops so the pump will always be submerged and the second one will stop the pump in case the discharge tank gets overfilled. The sensor is made from two wires and two NPN transistors connected as a Darlington switch. A very small current passes once the wires are submerged and this activates the signal into Arduino.

How to connect the transistors T1 and T2:

T1: Emitter to Base of T2

T1: Collector to Collector of T2

T1: Base to Ground through a 470K rezistor

T1: Base to Arduino analog Pin A0 (for the first sensor) and Pin A1 (for the second sensor)

T1: Base of the sensor's first wire that will make contact in the water

T2: Emitter to ground.

Second wire of the sensor will come from 5V through a 10K rezistor.

Once the sensor connected to Arduino A1 analog gets out of the water, the pump stops and the LCD displays the message "Pump off/Low lvl. No water in the tank". Once the wires on the second water level sensor reach the water, the pump will stop and the LCD will display "Pump off/ Hi lvl".

Step 4: Setting Up Arduino Digital Pins

I've used a 12V submersible pump which was supplied from an 12V wall adapter.

The pump is controlled by the Arduino digital pin no 9 through a relay.

Arduino digital pin No 8 is connected to a push button in order to start the pump or to stop it manually.

Arduino digital pin No 11 controls a white LED - which indicates whether the pump is available or not.

Arduino digital pin No 12 controls a green LED - which indicates when the pump is on.

Arduino digital pin No 13 controls a red LED - which indicates when the pump is stopped (I've also added a buzzer to get a sound signal when the pump has stopped).

Arduino digital pins No 2,3,4,5,6,7 are connected to the LCD.

Microcontroller Contest 2017

Participated in the
Microcontroller Contest 2017

Be the First to Share


    • Anything Goes Contest

      Anything Goes Contest
    • Cold Challenge

      Cold Challenge
    • Organization Challenge

      Organization Challenge



    3 years ago

    Hi! Great design!
    Quick question: How much current did your pump need to operate? I am planning on utilizing a 12V peristaltic pump for my project with a 12V source controlled by arduino.


    Reply 3 years ago

    Hi. My pump works on 12V and draws 400mA. I'm using a 12V power source which can supply 2A and I suggest that your power supply should be able to supply at least three times the current required by the pump. From my experience I've burned a power supply which delivered 1A although the pump reguires only 400mA. Hope this helps.
    Currently I remade my project, I've made a PCB for this design but I'm still waiting for the delivery from China and most probably I will make a new instructable with a better version of this project in the near future if time will allow me. Thanks for the interest


    Reply 2 years ago

    Hi, that is a nice project ,can I use this project using 41HP motor?


    Question 3 years ago

    which npn transistor are you use? there are many and don’t know what works better... thanks in advance.


    Answer 3 years ago

    I’ve used BC547C


    Question 4 years ago on Step 2

    Hello there! May i know the value of all the resistors that you have used? I might be doing this for my project.


    Answer 4 years ago

    Hey sorry for the late answer but due to my work i'm not always around. So the resistors values are as you can find in the instructable:
    - Resistors for led 220 ohms
    - pulldown rezistor for push button doesn't matter so much the value bit you can put 1-10k
    - resistor for the base of the transistor 470k
    - resistor for 5v line to the water 10k
    I hope i included them all. Hope this will help. All the best


    Reply 4 years ago

    Hello sir,

    Did you use this type of sensor for the project?


    Reply 4 years ago

    Thanks for the reply bro. Im on progress on re-doing your work. I found its very interesting and its my first time with arduino. I hope you dont mind. Maybe in the future, we can add IoT to it for monitoring through phone.

    Do contact me.

    This is my email -
    Facebook - Steffeno Evani Rojali


    5 years ago

    Geat idea, mate! And well done! Succes on future projects!

    DIY Hacks and How Tos

    Interesting design. Good luck in the Microcontroller contest.