A soil moisture sensor includes a porous shell with an internal cavity. The soil moisture sensor includes a casted solid medium contained at least partially within the porous shell, where the solid medium is composed of granular particles and a binding agent such that the solid medium is porous. Electrodes in contact with the casted solid medium are spaced apart from one another, and are sized such that they extend beyond the perimeter of the porous shell. A cover is provided for the porous shell and adapted to allow electrical connection to the plurality of electrodes.