Don’t forget about your energy counter (the small blue lightning icon)! 
 
You should upgrade it when you don’t have enough energy to open a new area or upgrade an object. 
 
All levels will include a maintenance room, and there you could upgrade the generator and the batteries. If you tap on the blue "+" button next to the thunder icon on the top-right corner of your screen, it will take you there.