I am building a USB mobile charger powered by manually rotating a 12V DC motor shaft. This voltage goes as an input to a LM7805 voltage regulator and the output of the voltage regulator is used to power the mobile device.When I measure the input voltage to the regulator, it varies from 7V to 11V. Since this is a high fluctuation of input to the voltage regulator, the mobile charger is rejecting the current. However if I place a battery as an input to the 9V regulator, the mobile is getting charged with a current of 240mA. I have tried placing capacitance of 4700μF at the input but to no avail. I would like to know how could the input to the voltage regulator be smoothened so that the charger accepts the current.
Directly connecting a motor (acting as a generator) to an electronic circuit is going to cause problems. The most obvious one is commutation noise causing spikes that cyclically pulse the voltage to zero volts or even negative values. It won't be the same for every DC motor but you will get trouble from most.
The way around this is to half wave rectify the motor output and using a smoothing capacitor. You might also consider full wave rectifying the output so you can generate voltage when the motor turns in the opposite direction.
As Dmitry has said, a buck-boost converter is probably your best option because a 7805 will need typically 2 volts greater at the input to produce a stable 5 volts at the output. This means you need to guarantee 7 volts at the input (and after the diode(s)).
1st buck-booster from LT I looked at: -
You should also look at what TI can offer.
Try using a boost-buck converter instead of the linear regulator. These devices output a stable voltage whether the input voltage is higher or lower than the desired output, provided they manage to draw enough current. This will greatly increase the usable range of voltages from your generator: LM7805 will only provide 5V when it gets 6-12V from the generator, while a half-decent boost-buck converter would accept 3-12V. In the last case, a 4700μF cap should be able to provide enough smoothing.
Note that if your generator cannot output at least 240mA at 6V continuously, then all bets are off. You will need a more powerful one.
Also (unrelated to your question) if you see a schematic using 780X, 324 or 555 chips, try looking for alternatives, as there's a good chance that schematic was designed by dinosaurs.