Ultrasonic sensor for tank water level control

Does any one know what logic to use for a water level control via ultrasonic sensor wherein the motor should start at a distance lets say greater than 80 ( the ultrasonic sensor is mounted at the top of tank.. tank height lets say 100) and stop when distance from water of sensor detected is less than 20 . :worried:

When do we have to hand in our assignment?

1 Like

I'd start with if statements.

What sensor do you have? What Arduino board are you using?

a7

Do You have code that runs the sensor perfectly as well as the motor?

Can you not use a potentiometer with a 6inch rod / float?

Haha love the assumption!

No units were mentioned. Why do you assume inches? :wink:

1 Like

Don't forget the " +Constant " haha man I do NOT miss those days

I think reply #2 scared him off.

We have heard this question before. Almost word for word. If this is a class assignment, then say so and we will be able to offer appropriate assistance.

If it's a real project then your question is simply too vague. Why does it have to be an ultrasonic sensor?