From Google:
Divide coins into 3 groups.
reference coins by number. Any coin found to be real will be indicated by "*".
First weighing
1,2,3,4 against 5,6,7,8
If 1,2,3,4=5,6,7,8 counterfeit coin must be one of 9,10,11,12 (coins 1-8 are authentic i.e. "*")
weigh 9,* against 10,11
if 9,*=10,11, counterfeit is 12. Weigh 12 against "*" to determine if it's heavy or light
if 9,* < 10,11 then either 9 is light or (10 or 11) is heavy. Weigh 10 against 11. If those two are equal, then 9 is light. If 10<11 then 11 is counterfeit, and it's heavy. If 10>11 then 10 is counterfeit and it's heavy.
If 1,2,3,4<5,6,7,8 then one of (1,2,3,4) is light or one of (5,6,7,8) is heavy
Weigh 1,2,5 against 3,6,*
If 1,2,5=3,6,* then 4 is light or (7 or 8) is heavy.
Weigh 7 against 8. If 7=8 then 4 is light, otherwise heavier coin is the counterfeit one.
If 1,2,5<3,6,* then (1 or 2) is light or 6 is heavy. Weigh 1 against 2 to determine
If 1,2,5>3,6,* then either 5 is heavy or 3 light. Weigh either against "*" to determine.
If 1,2,3,4>5,6,7,8 then one of (1,2,3,4) is heavy or one of (5,6,7,8) is light.
weigh 1,2,5 against 3,6,*
If 1,2,5<3,6,* then either 5 is light or 3 is heavy. Weigh either against "*" to determine.
If 1,2,5>3,6,* then either (1,2) is heavy or 6 is light. Weigh 1 against 2 to determine. (1=2 then 6 is light, otherwise heavier coin is counterfeit.
Follow the same procedure for case where 1,2,3,4<5,6,7,8