Missing analog pin for moisture sensor

Hey everyone,

I am using a LCD I2C module and 5 moisture sensors (YL-69) for a personnal project. These components are controlled by an Arduino UNO. I am using 2 analog pins for my LCD I2C module and the 4 remaining analog pins are for my moisture sensors. There is no place remaining for the fifth sensor so I would like to know if there is another way to connect my last moisture sensor. Also, I just need the fifth sensor to give me a HIGH or LOW value so I wonder if I could use a digital pin for it.

Thanks for your help.

You can use a digital pin if you just want HIGH or LOW if the sensor outputs the correct voltage levels. You don't say which Arduino that you use, but for an AVR (Uno, Nano, Mega, etc.) a voltage less than 0.3 * Vcc will read LOW and a voltage above 0.6 * Vcc will read HIGH.

Ok thank you very much.

The number of analog pins is not the number of sensors you can use.
It is simply the number of analog pins and nothing more.
The number of sensors you can use is based on what you do with the analog inputs you have.

You can multiplex multiple analog sensors to a single pin using analog switches.
You could have 24 sensors (four on each of the six analog inputs) using an ADG511.

Note also:

If the chip has the surface mount '328p instead of the DIP one, you have 2 more analog-only pins (A6 and A7). On the Pro Mini, these are exposed and broken out to pins. On Uno/Nano, they're not, but I don't think they're grounded or anything - if you dug out the datasheet to locate the pin, and are good with the soldering iron, you can solder a thin wire onto one of those pins, and use that (analogRead(A6) - don't need to set pinMode, as the pin isn't a digital pin, it can only ever be an analog input). This is called a "flying lead"

Tack the wire down with hot-glue after soldering it, otherwise movement of the wire will cause it to fatigue and break off in a jiffy right where the soldered part of wire meets the rest of wire.