Go Down

Topic: Capacitive soil moisture sensor V1.2 - Problem using multiple of them. (Read 172 times) previous topic - next topic

Gorkde

I have a plant-watering system and changed from nails to capacitive sensors.

As long as I connect one sensor to any of my two inputs and a voltage divider at the other all seems to work fine.

Once I connect 2 sensors (Vcc / GND in parallel to both and 2 ADC pins for each signal) the ADC signal seems to drift over time. Sometimes it starts instantly sometimes after a day or 3.

Has anybody used 2 of them at the same time? What is my problem?

I think there is no problem with the sketch I tried 100 things like delay before reading Sensors but without any success.

I got a 100R/100nF lowpass between Sensor and ADC againt interference but I cannot imagine this being part of the problem.


Look at the pictures:
One has normal values at the yellow line while the red one has no sensor but a voltage divider of 2x1k.
The other has 2 Sensors connected and you can clearly see the drift upwards (down to GND normally but I map it so when it gets wetter the vaue gues up instead down)

It's just a slight drift over time but enough to make the system not water correctly.

I assume the sensors do mess each other up by now. Maybe because interference from one Sens to the other via Vcc?

Remark:
ADC has no Vref but measures against Vcc but this could not be the reason normally because Vcc is not going up all time it could just have spikes. But this is a general slow drift over time

Any idea?

(btw. the blue and green lines are the calibration levels they should hold.)

arduarn

Please post a circuit diagram and a link to the exact sensors that you are using.

Gorkde

https://de.aliexpress.com/item/32870029267.html?spm=a2g0s.9042311.0.0.27424c4dfjFTVe

Probably the sensor most people use.

Need to draw an diagram tomorrow.
Basically both Sensor GND / Vcc are connected and connected to Arduino GND / Vcc. The Sensor Output is connected to 100R which other side is connected to the ADC and 100nF that goes to GND.

arduarn

Nothing springing to mind as yet.

I would suggest checking the output with a meter at the beginning of the test and then again when the drift has occurred to verify that the voltage on the sensor output really has changed; check your vcc too while you are at it.

You don't think that the filter has anything to do with it, but why not test without it to compare. You can filter in software instead if you need to.

How are you powering the project?


Gorkde

Thanks. I did add the filter because I had no shielded wire before and they catched lots of radio interference. Wanted to test that anyway because now with shielded wire it should not be neccessary anymore.

Problem with measuring is the difference is that low increasing you ca'nt really measure since an oscilloskop is not that good for this because if it's internal error. Also the pot wetness changes over days so you can't really compare the measurments.

I am powering it by an 6V 1A wall wart. I added 10uF at the Arduino Vcc-GND but it did nothing to the measurements. Just made the Vcc more stable.
Powering it by the PC when USB is connected gets the same result.

Basically I just need to know if anybody used more than one of these sensors before and if he had to take special precautions to make it work like filtering Vcc or such.

Has anybody?

Gorkde

I removed the filter and it seems the raise has gone. Need to test it for a longer time still.

Go Up