Changing research interests as an undergrad? I knew I that I wanted to get involved in research since my second year as an undergrad. 

I contacted a few of the staff whose work I thought was interesting at my institution and managed to acquire experience with two groups at my institution (through summer work), based on what I was interested in at the time. 

However, now in my final year I have settled on a topic that is quite different and will have to go somewhere else to undertake a PhD. This topic is experiments with ultra cold atoms in optical lattices. It sort of combines a few different areas of interesting physics. 

Is this a viable option to go for? Is it ethical for me to now just go somewhere else, after staff have been kind enough to let me work for them over the summer? Also this topic is quite different to my dissertation topic? Does this mean its not advisable I choose projects of this kind? I think I am for sure interested in this, but I am a little ignorant about this topic.
Your undergrad career is actually the best time to explore different research interests. It is much easier now, when you are an undergrad, than it would be at any later stage.

There is no ethical problem with changing your research interests after working for a lab over the summer - working for a lab as an undergrad is absolutely not a commitment to stay in that lab for a PhD.

Similarly, you are absolutely allowed to have research interests that are different from your undergrad dissertation. Many, many students change subfields in between their undergrad (or MS) and PhD.