I hope i am in the correct catagory...
I am working on a project for automating the watering of two plants, there will be more but this is the basics of the project.
The problem i have is that the soil moisture sensors have their values going down when getting wet and powered by the pc-usb cabe only, so far so good works like a charm.
But when i power the Arduino with a seperate powersuply, the values of the sensors go up when getting wet... So it seems to reverse the values somehow and i can't seem to figure out why.
I am using an Arduino Nano (clone i think).
The sensors are Capacitive soil moisture sensors. I power the sensors with a digital output (D2 and D3) so they only power up when needed. Signal comes in on A0 and A1.
There are 2 relay's for powering the pumps (each plant get's it's own pump).
There is also an ESP32 connected with tx and rx for communication but i am testing the arduino stand-alone before connecting to the ESP32. I have allready connected everything and it works perfectly as long as i don't power up the external powersupply, at the moment this powersupply is connected to the Arduino and the relay's (grounds are all connected).
I have a good quality 5V 10A powersupply.
But because i am using the Vin on the Arduino, i have allready changed to a 9V powersupply for the Arduino's. Unfortunately that did not help.
I have also tried to power the sensors directly from the 5V powersupply, but again, no change in behaviour.
I don't think this is a programming problem as it is working correctly when powered by the pc usb.
And for testing i'm reading the value of A0 (with analogRead(0)) and print it directly to the serial monitor.
I hope someone can help me solve this problem.