I'm writing a paper on a side project with a friend, should I involve my supervisor?
I recommend that you should talk with the supervisor about side projects. Perhaps revealing the nature of a project at once is not a good idea if the relation with the supervisor is not so close. You can start for example telling your supervisor that you are/will be collaborating with a friend on a project and see the reaction and the comments, and after a few weeks you can expose the whole project and paper to the supervisor. I don't think you have invested such a long time in your project, 3h/week is a small amount of time, so you didn't took much effort from your principal project, you have nothing to worry about.