When I recognize that I loose interest in coding, I try to get in touch with other developers (for example in local meetup groups) to get new inspiration and motivation. It always helps me to get new ideas for (side) projects and motivates me to code.