Liquid Level Sensor

I am making the Liquid Level Sensor project. The resultant voltage will be on pin A0. What is the best way to read this voltage? I know I could use a multimeter but how could I use a 1602 LCD Keypad Shield which I have? I am new to the Arduino world so could do with some real help.

The project is shown on the attached PNG file

Thanks

Brian

Arduino-liquid-level-sensor-circuit.png

float voltage = analogRead(A0)*5/1024

Sorry? I have no idea what you mean. I am sorry if my question is poor but I am learning the Arduino NOT an expert.

meddyliol:
Sorry? I have no idea what you mean. I am sorry if my question is poor but I am learning the Arduino NOT an expert.

RTMS :slight_smile:
You get more help here if you try to figure things out for yourself.

The fiunction analogRead() is described in




Your diagram showed connections to 5V and A0 and you asked how you could tell what the input voltage is.
So what do you think analogRead(A0) does and why would the answer be multiplied by 5 and divided by 1024?
Do you know any C/C++ what does float voltage do?

I am learning the Arduino

Start with the simple examples that come with the Arduino IDE (development software). They teach you how to read the voltage on the analog input, among MANY other things.

Menu > File > Examples >

Oh, didn't realise there's an image provided. I was just replying to the question "how to best read a voltage on A0", and that's exactly what that line of code does.

We're not providing courses on how to use Arduino. You get the answer - but are expected to look up terms/function calls/etc you don't understand. And if you still have questions, feel free to ask.

By the way, that sensor is rather useless. It can't reliably measure levels (if there are more or less minerals in the water your measurements are off. I once tried to turn it into a capacitive sensor (after cutting off the head), even that failed. You'll probably be able to use it to sense the presence of water, e.g. whether a container is full or not.