I've been looking to get a SWCG system for my pool, but I just can't afford it at the moment. I got to thinking about it and it just doesn't seem that difficult to generate chlorine via elecrolysis. Low voltage over a non reactive substance (titanium or maybe even better graphite plates) and enclose it.

The reaction produces hydrogen, chlorine and caustic soda. The only problem that I can see is a potential build-up of hydrogen gas, but this seems minimal given that the gas is not exposed to oxygen. I could be way off here, so I am wondering if any of you have anything to add.