Please, no, can you please put that aside ?
- Never call a Fritzing drawing a schematic, that drives some of us nuts
- The circuit is not a capacitive soil moisture sensor. It is mainly a resistive soil sensor with a DC part and a part radio wave. Because it is not AC, the probes will oxidize.
- I doubt if you use Timer1 correctly.
- I don't understand the calculation in your sketch.
- One wire of the probe is connected to the GND of the Arduino. That can cause issues when it is not powered by batteries or when more probes are used.
I'm sorry, but that is not the way. I'm afraid it will never work ![]()
For the Arduino Nano you can use the tone() function to generate a frequency. I forgot the maximum frequency it can do.
Sometimes I use the toneAC, I think it can go up to 1MHz.
There are other good libraries as well.
If you use capacitive soil moisture sensors with analog output, then you don't need a high frequency signal.
You can buy capacitive soil sensors with analog output which are waterproof, or buy normal capacitive soil sensors and use heatshrink with glue to make them waterproof. Don't buy the cheapest capacitive soil moisture sensors, they have issues.
This is an example of such a sensor: https://www.tindie.com/products/pinotech/soilwatch-10-soil-moisture-sensor/.
If you are a beginner, you should start with something that works.
A if-statement and for-statement don't need a ';' after the closing '}'.
Below is the schematic of the Fritzing diagram, so others can rant about it as well.

