In this instructable I'll give you a simple way to collect Hydrogen gas and if you want also, to collect Oxygen. Depending on the voltage and current that you use for the project this could be hazardous. I used a 14.4 volt power drill battery pack for the process but don't recommend it, I only used it to achieve a noticeable effect in a short time period (about 20 minutes).
Step 1: Materials
The required materials are:
-Sufficient length of wire
-DC power source
-Deep water basin or bowl (preferably plastic, there is a chance you could ruin a metal one)
-Weak acid (ex.vinegar as acetic acid)
-At least two plastic bottles with caps (I like the Gatorade ones because they are thicker and for some reason the Hydrogen at least will compress itself after a few days)
-A sacrificial pencil (or if you have lead [graphite] from an architect's pencil use that instead)
-Small pencil lead case or even just the cap (the refill material case for mechanical pencils)
-Marker to label the gases
-Long piece of tubing if you cannot find a bowl deep enough
-One sided blade or knife if you use a pencil
-You may also want other materials to plate or turn into Oxide salts
Step 2: The Non-Electric Setup
Fill your bowl most of the way with water, the purity of which doesn't make much difference so long as you don't use mud or something. Now add your salt or weak acid to the water, it doesn't take a large amount of either to get a good result so be moderate with it you can always add more later but can't take it out. Fill the two bottles as full as you can with tap water and carefully put it into the water so that the lip of the bottle is turned down, do this with the second bottle. Make about two or three fingers worth of room between the bottom of the bowl and the lip of the bottle and tape it to the side so that the tape is not underwater. If you were unable to get all the air out this is the point where you want to get out that tubing and put it in the bottle while still underwater and suck the air out but try not to get a mouthful of acid or saltwater in your mouth.
Step 3: Electric Setup
Take the pencil and shave off the wood so that all you have left is graphite, if it breaks wait to throw it way if it is long enough you may be fine. Then take two lengths of wire and strip the ends off for each wire wrap one end for both around a length of the graphite. Then take your pencil lead (graphite) case and push putty into it so that it is a solid mass and has no cracks. Take one of the wires and push the end with the graphite into it so that none of the metal of the wire is showing but the graphite is. Then secure the ends of the wires that do not have graphite to your DC source
IMPORTANT-place the wire with the case on the positive (generally red) end of your source otherwise the unshielded wire will dissolve into an oxide salt
Step 4: Combined Setup
Now you're ready to place your electrodes into the electrolyte (saltwater / dilute acid). Arrange the electrodes so that the bubbles are floating into the bottles. If you have no bubbles then you did something wrong if you only have bubbles coming out of the negative side then you may be using actual lead (unless you are intentionally oxidizing some other metal this is normal).
Step 5: Filling and Conatainment
Now all you have to do is wait for the bottles to become filled with the gas coming from the electrodes. When doing this the unshielded wire's bottle should be filling faster, about twice as fast because water is two parts Hydrogen and one part Oxygen (and because they are both part of the diatomic BrINClHOF [If you have not taken Chemistry disregard this statement it's not important]). If the unshielded wire is making less than the shielded one, turning blue or falls off then you may have switched the charges.
If / when they do fill take the bottle cap of that bottle and make a ring around the inside of the cap and place it underwater and screw it on without letting air out or in. Once you do this use your marker to label it the bottle with the unshielded wire is Hydrogen and the shielded one is Oxygen if you did this correctly.
Step 6: Extra Possibilities
Along with making Hydrogen and Oxygen there are other things you can do with this concept. One is Making Oxide salts (i.e. metal+Oxygen such as Fe2O3) although this will not allow you to collect gaseous Oxygen, you can make pigments out of this such as turquoise blue with Copper or Orange with Iron. You can also make Aluminum powder for thermite, with the positive being Aluminum and the negative being Carbon (Graphite/pencil lead) the Aluminum either does not bond or it decomposes. If I'm wrong it will stay bonded but can still be used as a pyrotechnic. You may also plate a metal using this with the plating metal on the positive and the object to be plated on the negative although this will also crate it's oxide. All you have to remember is that the positive will dissolve into an oxide salt and the negative will be plated. Have fun experimenting