Jennifer Fox has constructed an irrigation controller using a Pi, a relay and a solenoid irrigation valve (amongst other bits and pieces). She’s posted the whole thing up on Instructables as a tutorial and also covered creating a capacitive soil moisture sensor on her blog.