Here's what helped me:
1) Do not ever stop reading. Set up a few subscriptions to RSS feeds. Always have a few books that you find interested lying around. You'll see that these books will help you understand that finding an idea for a project is not the hard part.
2) Do not be afraid of inventing the wheel again. Some people say that this is unnecessary but in my experience this has helped me a lot.
Take static site generators for example. There are very good ones around but I still plan to write one. Just for the fun of it. You'll be amazed to see that reinventing the wheel is a great idea to get fresh ideas and improve your coding skills.
3) This has been said a lot, and it's great advice. Try to solve a problem that frustrates you. This can be anything. Don't like the way HN looks? Try to do a redesign on the side. You find that Youtube has a lot of clutter? Try another approach. You get the idea.
4) Read http://ycombinator.com/rfs.html and http://ycombinator.com/ideas.html
5) Read other people's code. I'm by no means an experience programmer, but this is perhaps the single most important thing that I learned from Zed Shaw's excellent Learn Python the Hard Way. You'll be amazed at how much other people's project can inspire you.
7) Most of all, don't ever obsess about finding an idea. Recognize that ideas are important but the way you execute them are much more important.
I hope this helps :)