Hi, I'm new to Arduino. But how to use a potentiometer to display amount of water in a LCD screen that I want to output through a 12v DC Brushless water pump? Can you explain on how to do it and what is the code to it? Thanks in advance.
Things that I have:
Relay module
LCD screen
12v DC water pump
12v battery
Arduino Uno R3
Potentiometer
I don't know what your experience is so I suggest you break your learning into a number of steps.
First, write a short program that allows you to store a value in a variable that is adjusted by the potentiometer and then display the value on the Serial Monitor.
Then write a separate short program to display "hello world" on the LCD. When you can do that extend that program a little so it can also display a value from a variable.
And write a third short program to learn how to make the pump go on and off.
You have not said how you propose to control the amount of water that gets pumped - if the plan is to run the pump for different amounts of time then include in your short pump program the ability to make it work for an amount of time that you set when compiling the program.
When you can do all the parts separately it will be time to think about bringing them together.
Assuming you know the pump's flow rate, an adjustable timer could work. Desired volume could be dialed with the pot, displayed and required run time computed and sent to a millis timer that switches the pump on/off.