We introduce a simple model to describe the frictional properties of granul
ar media under shear. We model the friction force in terms of the horizonta
l velocity x and the vertical position z of the slider, interpreting, z as
a constitutive variable characterizing the contact. Dilatancy is shown iu p
lay an essential role in the dynamics, inducing a stick-slip instability at
low velocity. We compute the phase diagram, analyze numerically the model
for a wide range of parameters and compare our results with experiments on
dry and wet; granular media, obtaining a good agreement. In particular, we
reproduce the hysteretic velocity dependence of the frictional force.