Using water level sensor to control a water pump

Hi,

I would like to control a water pump so that if the water level in my bucket reaches a specified level, the pump starts sucking the water out of the bucket, and it keeps doing it until the water level reaches the bottom of the sensor. Then the pump should turn off. (Loop)
My water pump is an external (non-arduino) 5V component.

Is there a way to do that with Arduino at all?

I'm sure it is doable, however without knowing the particulars of your level sensor and pump driver I can 't offer any specific suggestions.

Using a couple of simple float liquid level sensors I have controlled the water level in a tank with an Arduino - switching pump on when lower sensor indicates no water switching pump off when upper sensor indicates water present

1 Like

Thank you for your reply.

Well I imagined to use this sensor to detect the level of water inside the bucket:

and this is my pump:

Would it be possible you think? I have found a Video on how to programmatically detect the water level with the sensor. However I have no idea how to turn on or off the pump inside the if - statements and where to plug in the pump.

Your water depth sensor covers 16mm depth each. How deep is your bucket?

Well the bucket has 10l capacity. But for me it's enough when it wouldn't get full, since there is 1l/hour water flowing inside.

You need to know when it's empty as well as full.

I'm a bit concerned that this sensor will reliably signal "off" when the water level has fallen below it. Any drops of water, or a film of water, sticking to it might continue to be detected as "wet", don't you think?

The type used by @horace looks far more reliable to me.

I think @waminox did imply that in his first post. He needs either two sensors (high and low), or one sensor with significant hysteresis.

Show us the code that you've got. Open it up in the Arduino IDE, press Ctrl+T to auto-format it, then use the menu: Edit | Copy for Forum. Paste it into your message.

In principle all you do is set one of the Arduino pins to an output, and connect a relay board to it (the type with a driver transistor for each relay). Then connect the pump via the relay contacts to a separate power supply (but with common grounds).

I use this water level sensor to detect water is at a level in a bucket.

He needs 3 pieces of insulated wire and 2 pins.

OP text:

I would like to control a water pump so that if the water level in my bucket reaches a specified level, the pump starts sucking the water out of the bucket, and it keeps doing it until the water level reaches the bottom of the sensor. Then the pump should turn off. (Loop)

"I think @waminox did imply that in his first post. "

OP: until the water level reaches the bottom of the sensor. Then the pump should turn off.

The sensor is for measuring collected rainfall which is done in shallow "Buckets".......
we've had DIY rainfall projects here.

A bog standard industrial method is a couple of float switches and a couple of relays.
The relays are wired in what's called a "hold-on" configuration.
You can do the same with CMOS logic chips or simply do the equivalent in code for the Arduino with some states and digital inputs.