I have a capacitive moisture sensor running on A5 and Photoresistor running on A4 but neither are acting as expected.
A5 just gives a constant reading of ~1023 and A4 seems to have a minimum value of ~600.
I have connected the same sensors to A0-A3 and gotten expected results, just A4 and A5 seem to be an issue, I have also tested on multiple Arduino Nano boards and got the same result.
My assumption is that is has something to do with the SDA SCI on those pins.
I don't have easy ability to draw out the schematic so here is my best sketch.
Code snippet:
#define CMS3PIN A4
#define LRD3PIN A5
int m3;
int l3;
void setup() {
Serial.begin(9600);
}
void loop() {
delay(2000);
m3 = analogRead(CMS3PIN);
l3 = analogRead(LRD3PIN);
Serial.print(" | Light: ");
Serial.print(l3);
Serial.print(" | Moisture: ");
Serial.println(m3);
}