We study the asymptotic behaviour in terms of $\Gamma$-convergence of a non local phase transition type functional which model line defects on crystals (the dislocations). The variable is a two dimensional scalar phase which represent the slip on one slip system. The energy is given by a non local term, which represent the long range elastic energy, and a potential which penalizes non integer values of the phase. We add some obstacle conditions in order to model the hardening effect due to secondary dislocations or impurities. In the limit we obtain a line tension energy and a non linear extra term which account for the obstacles.