Studsministern / 1DT305-Applied-IoT-Project

0 stars 0 forks source link

[FIX] Turn off power to soil moisture sensor when not in use #3

Closed Studsministern closed 1 year ago

Studsministern commented 1 year ago

Guides for the FC-28 soil moisture sensor recommend only supplying power to the sensor when a measurement is required.

Keeping the power on for the sensor at all times will result in ions moving to the two legs of the sensor, which damages the surface layer over time. The lifespan of the sensor will then be much shorter.

Testing is required to check if the power supplied to the sensor is affected by the time.sleep() or machine.deepsleep() functions. If this is not the case, one solution may be to use a transistor which is turned on by a GPIO pin when the sensor requires power.

Studsministern commented 1 year ago

This was solved in commit 42519447d16656ec48b3864b26d3e82d484a7569 by turning on the sensor with a GPIO pin as a digital output pin.