I got a solicitor to draw up a 'house sharing agreement'. This is a less formal contract than you'd have if you were renting out somewhere you don't live, but gives some legal protection to both sides with regard to rent payments, damage to furniture and so on.
And I re-iterate the advice others have given you. Be very clear on what you are offering and expecting before your lodger moves in. So long as you both know exactly where you stand, it can be a very happy arrangement and a great source of income.
Also, up to a certain limit, you don't have to pay tax on income from renting a room in your house - read up on the 'rent a room scheme'.
If you end up with more people interested in your room than you need, please direct them to me if you can, I'm also trying to rent out my attic ;-).
All the best.