Electrolysis is the process used to separate water (H2O) into its component gases, oxygen (O2) and hydrogen (H2). The apparatus for electrolysis is easy to assemble, which makes it a common science fair project. Since water alone is not a good conductor of electricity, an electrolyte is usually added to form a solution to facilitate the reaction.
Electrolysis requires a DC electrical power source. For a science fair or for a home experiment, a 6V or 12V lantern battery works best. A larger power source poses a risk of severe electrical shock, and a smaller power source will slow the reaction down too much. You will need a length of wire and an electrode for the positive and the negative terminals, sized for your power source. An eight-penny nail will work as an electrode with a 12V battery.
Water alone will not conduct electricity. An electrolyte, which is a chemical that will break down into positive and negative ions in solution, will allow electricity to flow through the solution more readily. Chemistry labs often use sodium hydroxide (NaOH), which separates into Na+ and OH- ions, but many common salts will also work. Do not, however, use a chloride salt such as sodium chloride (NaCl)—table salt—because this will result in deadly chlorine gas in the electrolysis experiment. The concentration will vary depending on which electrolyte you choose. You can run a short series of tests to find the electrolyte concentration that produces the best results.
Fill a small tub with your electrolyte solution and then fill two bottles. For a 6V battery, 20-ounce soda bottles will work, but for a 12V battery, you should use two-liter soda bottles or similar containers. Invert the bottles into the tub, being careful not to allow air to seep in. Prop them up or support them so they are at least at 45-degree angles. Slide an electrode into each bottle and run the connected wire outside the tub to the battery or power source. Do not connect the wires until you are ready to start the experiment.
Once the experiment is ready, attach the wires to the battery terminals. Bubbles will form around the electrodes and begin to displace the water in the bottles. Hydrogen forms at twice the rate of oxygen, so the hydrogen bottle will soon be clearly twice as full of gas as the oxygen bottle. Keep the wires connected as long as you need to, but do not let the electrodes become exposed.