A pin-hole does not focus light in the same way as a conventional camera lens. At a basic level, changing the distance between the pin-hole and the plane of the image, essentially the length of the pin-hole camera (or focal length), has minimal effect on image sharpness.
However, close examination of images reveals that for every focal length an optimum pin-hole diameter can be identified. As the diameter of a pin-hole is increased from its optimum dimensions, more light passes into the camera and shorter exposure periods can be used. However, image sharpness also decreases to some extent. Decreasing pin-hole diameter from its optimum value also decreases image sharpness as the effects of diffraction become apparent.
Numerous formulae exist to calculate optimum pin-hole size. This optimum size is normally regarded as the pin-hole diameter that gives the sharpest images for a particular focal length and subject distance.
This diameter is given by: 0.03679 multiplied by the square root of the focal length expressed in millimeters.
Optimum pin-hole diameter = 0.03679 x (in millimetres).
The required f/stop is then obtained by dividing the focal length by the pin-hole diameter, where both are expressed in the same units.
f/stop = Focal length / Pin-hole diameter
The f/stop resulting from this calculation is unlikely to fall on the conventional scale ie f/16, f/32, f/64, f/128, f/256 etc. Just use the nearest larger aperture - ie for f/197 use f/128.
Note that the calculations above are all of a basic nature. More precise and complex formulae, such as the Prober-Wellman formula, are available.