Perhaps the simplest way to make hydrogen is to stick two electrodes into water and to apply electricity. The gas that is produced is mostly hydrogen, and is sometimes suitable for welding or for addition to an automobile engine to increase the mileage. Depending on the electrodes and whether salt is added to the water, the gas that is produced can be Browns gas, HHO, town gas, or some relative of the three. We are sometimes asked if we can purify the product of this electrolysis, and my answer is typically: “maybe,” or “it depends.”
If the electrode was made of stainless steel and the water contained only KOH or baking soda, the gas that results will be mostly hydrogen and you will be able to purify it somewhat with a polymer membrane if you wish. The gas isn’t very explosive generally, since most of the oxygen that results from the electrolysis will go into rusting out the electrodes. The reaction is thus, H2O + Fe –> H2 + FeO. To see if this is what you’ve got, you can use determine the ratio of gas production with a simple version of the Hoffman apparatus made from (for example) two overturned glass jars, or by separating the electrodes with a paper towel. You can also determine the H2 to O2 ratio (if you know a bit more physics) from a measure of the amperage and the rate of gas production. The hydrogen you form with steel plates will always contain some oxygen though, as well as some nitrogen and water vapor. While a polymer membrane will remove most of the oxygen and nitrogen in this gas, it won’t remove all, and it will not generally remove any of the water. With this gas, I suspect that you would be better off just using it as it is. This is particularly so if the fraction of oxygen is more than a few percent: hydrogen with more oxygen than this becomes quite explosive.
Since this gas will contain water, you probably don’t want to store it, and you probably don’t want to purify it over a metal, either, There are two reasons for this: the water can condense out during storage, and will tend to rust whatever metal it contacts (it’s often alkaline). What’s more, the small amount of oxygen in the hydrogen is likely to react over a hydrogen storage metal to form water and heat. This may give rise to the explosion you were trying to avoid. This is clearly the quick a dirty approach to making hydrogen.
Another version of electrolysis gas, one that’s even quicker and dirtier than the above involves the use of table salt instead of KOH or baking soda. The hydrogen that results will contain chlorine as an impurity, and will be quite toxic, but it will be somewhat less explosive.The hydrogen will smell like bleach and the water you use will turn slightly greenish and quite alkaline. Both the liquid and gas are definitely bad news unless your aim was to make chlorine and alkali; this is called the chlor-alkali process for a reason. On a personal note, as a 12 year old I tried this and was confused about why I got equal volumes of gas on the cathode and anode. The reason was that I was making Cl2, and not O2: the chemistry is 2 H2O + 2 NaCl –> H2 + Cl2 + 2 NaOH. I then I used the bromide version reaction to make a nice sample of bromine liquid. That is, I used KBr instead of table salt. Bromine is brown, oily, and only sparingly soluble in water.
Another version of this electrolysis process involves the use of graphite electrodes. If you are lucky, this will give you a mix of CO and hydrogen and not H2 and O2. This mix is a called “town gas.” It’s a very good welding gas since it is not explosive. It is, however, quite toxic. If you begin to get a headache using this gas stop immediately: you’re experiencing CO poisoning. The reaction here is H2O + C –> H2 + CO. CO headaches just get worse and worse until you die. If you are not lucky here you can get HHO instead of town gas, and this is quite explosive: H2O –> H2 + 1/2 O2. The volume ratio will be a key clue as to which you are making; another clue is to put a small volume in a paper bag and light it. If the bag explodes with a terrific bang, you’ve made the wrong gas. Stop!
With all of these gases I would recommend that you add a polymer of paper membrane in the water between the electrodes. Filter paper will work fine for this as will ceramic paper; the classic membrane for this was asbestos. If you keep the two product gas streams separate as soon as they are formed, you’ll avoid most of your explosion-safety issues. Few people take this advice, I’ve found; they think there must be some simpler way. Trust me: this is the classic, safe way to make electrolysis hydrogen.
A balloon filled with pure hydrogen will not ignite. To show you, here is a 2.5 min long video where I poke a lit cigar into a mylar balloon filled with hydrogen from my membrane reactor generators. Note that this hydrogen does not even burn in the balloon because it is oxygen free. As a safety check try this with your hydrogen, but only on a much-smaller scale. Pure hydrogen will not go boom, impure hydrogen will. My advice: keep safe and healthy. You’ll feel better that way, and your heirs will be less inclined to sue me.
In case you are wondering how electrolysis hydrogen can add to the gas mileage, the simple answer is that it increases the combustion speed and the water vapor decreases the parasitic loss due to vacuum. I’ve got some more information on this here. I hope this advice helps with your car project or any other electrolysis option. In my opinion, one should use a membrane in the water to separate the components at formation in all but the smallest experiments and with the smallest amperage sources. Even these should be done only in a well-ventilated room or on a car that is parked outside of the house. Many of the great chemists of the 1800s died doing experiments like these; learn from their mistakes and stay among the living.