Basic Gear train calculation
base parameters
Consider the simplest of gears - spur gears (straight cut gears). There are a plenty of special literature covering the topic in details, I just want to provide the basic params that will be sufficient for you to design gears. For example, it can be used for 3D printing.
When two gears are in the mesh, the first one is a pinion gear - has number of teeth z1, and the second one is a driven one - has number of teeth z2. Thus, gear ratio is r = z2/z1