A DC bicycle generator is a relatively fun and simple project for newcomers to the world of inventing and electronics. I will be describing two different types. One is for a pedal bike that can mount wherever you go, and the other is for a stationary bike, where you can power a small TV or just charge a battery.
Acquire a DC motor from somewhere. This can be from an old printer or computer. Motors are in almost everything. You could even go buy one from Radio Shack if you were so inclined. Take all plastic gears and o-rings off of the motor.
Mount the DC motor onto the back tire so that the tire turns the shaft of the motor. You might need to put on some sort of disc to the motor arm so that it touches the tire. I have used big rubber discs in the past to get good friction. The turning causes a voltage to come across the leads on the motor.
For a stationary bicycle, or a DIY stationary bike, build a stand so your back tire is elevated.
Use a voltmeter or multimeter to measure the voltage coming out of the motor when you are pedaling. There will be enough to charge a 12 volt battery, or power a small TV.
Attach a voltage regulator from the leads of the motor to whatever you will be charging or running. Without the regulator, the batteries can explode. Voltage regulators are small chips that can simply be soldered onto the circuit. You can get a schematic for each voltage regulator. You can get them online ar at an electronics store.
From the voltage regulator, you can go straight to batteries or the appliance you are running. Expect to get about 100 to 200 watts of power if you are using the right motor. Obviously, if you are charging batteries, use rechargeable Nickel Cadmium or Lithium Ion batteries.
If you are building the generator on a moving bicycle and not a stationary one, just mount the battery holder somewhere near the back tire. I like to mount mine above the tire right next to the motor so the wires connecting it are short. Make sure that they are tight so they don't get caught up in the tire.