-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Soil moisture sensors and rain sensors can corrode over time due to the unidirectional DC current flowing through them. (This is due to electrolysis-like effects on the exposed metalwork, I guess?) One way to avoid the DC corrosion is to frequently reverse the polarity of the sensors, say for every alternate reading. Since these are resistive sensors, their reading isn't affected by polarity, and the frequent reversing of polarity extends the life of the sensor.
Polarity can be reversed by powering the sensor using two pins (as NodeManager does now), but alternating the pins' role as source or sink. The ADC reading will have to be adjusted accordingly.
You could use the example in the MySensors project for reference. It goes through quite some effort to handle this corrosion issue.