All right, I think there is not an exact formula to this, even if you get rational and tell him the situation, that you feel something for him and that you can understand that he cannot feel the same for you. I tell you this because that is happening to me (or I am in the final phase of it, it's difficult to say now). Of course, you will be praised by him because of your "mature" attitude, however, if he continues keeping in contact, and being kind to you, that feeling for him is going to disappear difficultly.
I know that you want to end it with "just remaining as good friends", without hurting anyone (including you). The only thing to do is to going out with him somewhere (and not like a date) and be yourself with him, and the good side of it is that both of you are going to show your true colors because you are friends.
Communication and going out is one part to solve this problem, there is almost the 100% that both of you are going to show your true selves (well, compared to the boyfriend/girlfriend relationships, you will be truly sincere and show your true personality).