Soil humidity sensor power up with relay vs. NPN

Hi,
I read ( on here: http://www.homautomation.org/2014/06/20/measure-soil-moisture-with-arduino-gardening/) that soil humidity sensors age quicker if they are ON all the time. So a solution with an NPN transistor which turns on the device ever T minutes was suggested as an example.

I tried to do the same with a relay however I couldn't succeed. The readings are all over the place. Could there be a reason for this?

I tried to work a pump and a sensor with the same power source, the pump seems to work fine but sensor readings are not accurate...

Would any trick with NPN's work with relays as well?

Attached is how I worked my connections.

I tried to do the same with a relay however I couldn't succeed. The readings are all over the place.

And, the readings are OK without the relay? It can be normal for the readings to jump around.

A relay is just a switch, so the contact-side of the relay shouldn't be causing any problems.

The motor could be messing-up your power supply too... Have you tried the relay without the motor?

Aref won't be stable with 4xAA and a varying load, so analogue reads won't be stable either.
Leo..

I tried to do the same with a relay however I couldn't succeed. The readings are all over the place. Could there be a reason for this?

You have 80-90mA load per relay when energized ... lots of current draw out of those AA batteries just to enable a very light sensor load. How about trying a logic level MOSFET so you can turn it on with basically 0mA.

Also, most relay contacts don't work very well with light loads less than a few mA ... I bet you'll get lots of fluctuation just because of this alone.

Check if your sensor is the same as this one.

The schematic link on this page advises to just power the sensor on/off with an output pin.
Possible, because current used by the sensor is <500uA.
Leo..