I'm using the analog output for obvious reasons,
So the 'hardware circuit' actually used and your 'code' and your 'obvious reasons' seem to be "for mind-readers only".
I'm sorry that I must tell you: I'm NOT a mind-reader.
And after reading your last two messages, I still don't understand what's so different that you "cannot find any other projects similar" as you wrote in the initial posting.
Especially as you already found at least one other project similar to yours at http://www.electroschematics.com/6519/simple-soil-moisture-sensor-arduino-project/
English is not my mother language. Perhaps this is the reason why I have problems understanding what you really want and expect. So I'm still clueless about your problem. And therefore I'm out now.
Perhaps ask a mind-reader or somebody else who can understand your problem better than I can.