Hi! I am trying to diy soil meter, i have soil sensor (like a two nails). So i set it up like this:

5v -> 4,7 kOm ->1st nail->(soil)-> 2nd nail ->AnalogPin(1)

And this simple code:

``````void setup() {
Serial.begin(9600);
}
void loop() {
int data;
Serial.println(data);
delay(100);
}
``````

And all i get is this fluctuation data, which periodically goes from ~200 to ~400 .

``````210
205
206
211
213
216
219
224
218
216
224
238
244
259
267
278
282
292
302
312
320
328
339
355
367
378
394
411
424
434
444
454
451
441
434
435
437
438
437
437
437
427
418
412
404
394
387
377
369
359
345
331
322
320
310
300
285
267
250
238
226
220
211
208
204
205
208
209
``````

What is my probem? I was trying to pull down line, but this periodical fluctuation still there.

I think you see main hum...

RastafarienTargaryen: I was trying to pull down line

What's that? You tried using a pull down resistor? I think you need one because you want to create some sort of voltage divider.

What is the value of your pull up resistor? The one connected to +5? "4,7 Om" isn't conventional notation. We can't read it.

septillion: I think you see main hum... What's that? You tried using a pull down resistor? I think you need one because you want to create some sort of voltage divider.

Yes i was trying use pull-down resistor to get rid off noise, but it wont work.

aarg: What is the value of your pull up resistor? The one connected to +5? "4,7 Om" isn't conventional notation. We can't read it.

I dont have a pull-up resistor, its is current limiting resistor. It has 4,7 kOm nominal.

Then you do need a pull down from Analog pin 1 to ground. A value close to the soil resistivity.

RastafarienTargaryen:
Hi! I am trying to diy soil meter, i have soil sensor (like a two nails). So i set it up like this:

5v → 4,7 kOm ->1st nail->(soil)-> 2nd nail ->AnalogPin(1)

Look at the attach picture,

5v ->1st nail->(soil)-> 2nd nail ->AnalogPin(1) → 10 kOm → Ground

BillHo: Look at the attach picture,

5v ->1st nail->(soil)-> 2nd nail ->AnalogPin(1) -> 10 kOm -> Ground