I am going to use a homemade soil moisture sensor to control my lawn sprinklers. currently I am experimenting an i made sensors from plaster of paris. I realize the downfalls of such sensors and may modify my plans but for right now I have a question.
My sensor readings are a bit erratic at times. I have my arduino at my desk and about 25 feet away and outside my window is my sensor plugged into the soil of my yard.
my readings are fluctuating a bit.
I was wondering. Is there a line of code that would take the average of the last say 10 sensor readings and return that value instead so to smooth the readings?
thanks for your help.