You will only have to use the scale three times.
Divide the coins into three groups of 9 and put 2 of the groups on either end the scale. If they weight the same amount, it means the counterfeit coin is in the pile not on the scale. Of course if one side goes up the counterfeit coin is in that stack of 9. Now take that stack of 9 and divide evenly again into stacks 3 groups of three and put two of groups of the scale. Use the same technique. You will find a group of 3 be left with a group of 3 coins. Now weigh two of those coins and voila. The counterfeit coin!