Current flowing into a motor creates a magnetic field in coils attached to the shaft, which turns in the presence of a magnetic field from fixed magnets. When a motor is run in reverse -- power is applied by turning the shaft -- a voltage is induced in the coil. Faraday's law says this voltage is proportional to the rate the magnetic field changes in the coil. Thus the faster the shaft is turned, the greater the voltage.Gear ratios
A series of gears are used within the keychain to get the generator spinning as fast as possible. When you crank the handle, it sets three compound spur gears in motion. One half of each compound gear has a small radius and the other half has a large radius. When the small radius is turned, the teeth at the edge of the larger radius change location at a proportionally faster rate. By cascading these compound gears, the cranking rate can be multiplied several times and the generator shaft can be turned much faster than a human could turn it.The need for the step-up converter and storage capacitor
The keychain's gear ratio can generate a few volts with reasonable cranking, but the voltage is not high enough to reach 5V. This voltage also varies quickly based on the shaft rotation rate. To get a steady 5V output, a step-up converter is needed. The specific integrated circuit chosen -- the MAX756 -- can turn voltages as low as 0.7V into 5V and comes in a handy 8 pin package. The step-up circuit is based on the application circuit in the MAX756 datasheet. http://datasheets.maxim-ic.com/en/ds/MAX756-MAX757.pdf
Even though these dynamo keychain flashlights are advertised as needing no batteries, they appear to have three coin-sized batteries inside. The generator is soldered to this coin battery stack in a somewhat crude charging circuit. However, I do not think these batteries are meant to be rechargeable, and they tend to drain quickly after the initial discharge. This Instructable replaces this coin stack with a large capacitor that can be recharged more frequently and is more efficient.
See the schematic for the layout of the entire circuit. The specific components were chosen for easy hand soldering while being the smallest sizes that were still rated for the voltages in the circuit. Note: The MAX756 datasheet has C3 as a 150 uF capacitor. The 150 uF capacitors I found were much physically bigger than the 100 uF ones and wouldn't fit within the small keychain. Thus I replaced C3 with a 100 uF capacitor and it appears to work fine.