I've been living in a small town on the coast for 2 months now (10 min from Barcelona) and I know lots of great, relatively cheap places to stay. Especially in the towns on the beach - they get overshadowed by Barcelona, but its a quick train/bus ride into town and a lot cheaper. Castelldefels, Gava, and Sitges to name a few. If you need any help before coming to the area, let me know!