apparatus for generating gas by electrolysis of a liquid comprises an electrolysis cell , and first , second and third chambers . liquid for supply to the electrolysis cell is stored in the first chamber . the second chamber contains liquid which is a product of the electrolysis reaction and is enriched with a first gaseous product of the electrolysis reaction , and has an outlet for controlled release of the first gaseous product . the third chamber contains liquid which is a product of the electrolysis reaction and is enriched with a second gaseous product of the electrolysis reaction , and has an outlet for controlled release of the third gaseous product . a first channel which connects the first and second chambers , and a second channel which connects the second and third chambers . each of the first and second channels provides a trap for liquid which can provide a barrier to passage of gas between the chambers which are connected by it , irrespective of the level to which liquid in the first chamber falls during operation .