TASK2 (also known as KCNK5) channels generate pH-gated leak-type K+currents to control cellular electrical excitability. TASK2 is involved in the regulation of breathing by chemosensory neurons of the retrotrapezoid nucleus in the brainstem and pH homeostasis by kidney proximal tubule cells. These roles depend on channelactivation by intracellular and extracellular alkalization. We determined cryo-electron microscopy structures of TASK2 in lipid nanodiscs in open and closed conformations.These structures were captured in distinctconformations. I will discuss how internal and external protons control intracellular and selectivity filter gates to modulate TASK2 activityand then control the breathing.